﻿/* Comodidad de los controles de captura en PC, celular y tableta.
   "html body" adelante para ganarle a los estilos de cada componente, que se cargan después que este. */

/* ---------- En todos los equipos ---------- */

/* Sí/no: se ve dónde está el foco al llegar con Tab (se cambia con la barra espaciadora). */
html body .toggle.btn:focus {
    outline: none;
}

html body .toggle.btn:focus-visible {
    outline: 2px solid #66afe9;
    outline-offset: 2px;
}

/* Calendario: los botones de abajo dicen lo que hacen (en celular no hay globo de ayuda al pasar el ratón). */
html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action] {
    display: block;
    padding: 4px 2px;
    border-radius: 4px;
    color: #337ab7;
    text-decoration: none;
    cursor: pointer;
}

html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action]:hover {
    background: #eee;
}

html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action] > span {
    display: block;
    height: auto;
    line-height: 1.4;
    margin: 0;
}

html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action]::after {
    display: block;
    font-size: 11px;
    line-height: 1.3;
}

html body .bootstrap-datetimepicker-widget a[data-action="today"]::after {
    content: "Hoy";
}

html body .bootstrap-datetimepicker-widget:not(:has(.datepicker)) a[data-action="today"]::after {
    content: "Ahora";
}

html body .bootstrap-datetimepicker-widget a[data-action="clear"]::after {
    content: "Limpiar";
}

html body .bootstrap-datetimepicker-widget a[data-action="close"]::after {
    content: "Cerrar";
}

html body .bootstrap-datetimepicker-widget a[data-action="togglePicker"]::after {
    content: "Hora";
}

html body .bootstrap-datetimepicker-widget a[data-action="togglePicker"]:has(.glyphicon-calendar)::after {
    content: "Fecha";
}

/* ---------- Pantalla táctil (celular y tableta) ---------- */
@media (pointer: coarse) {

    /* Con letra menor a 16px el iPhone y el iPad acercan la página al tocar una caja. */
    html body .form-control,
    html body .bootstrap-select > .dropdown-toggle,
    html body .bs-searchbox .form-control {
        font-size: 16px;
    }

    html body .ui-jqgrid .form-control {
        font-size: inherit;
    }

    /* Cajas de 44px de alto: más fáciles de tocar con el dedo. El combo copia la clase form-control a su contenedor: a ese
       no se le pone relleno, solo a su botón. Las cajas de tags crecen con sus etiquetas: llevan alto mínimo (más abajo). */
    html body .divFG .form-control:not(textarea):not(.input-sm):not([type="checkbox"]):not([type="radio"]):not(.bootstrap-select):not(.tagify):not(.bootstrap-tagsinput),
    html body .form-group .form-control:not(textarea):not(.input-sm):not([type="checkbox"]):not([type="radio"]):not(.bootstrap-select):not(.tagify):not(.bootstrap-tagsinput),
    html body .modal-body .form-control:not(textarea):not(.input-sm):not([type="checkbox"]):not([type="radio"]):not(.bootstrap-select):not(.tagify):not(.bootstrap-tagsinput),
    html body .divFG .bootstrap-select > .dropdown-toggle,
    html body .form-group .bootstrap-select > .dropdown-toggle,
    html body .modal-body .bootstrap-select > .dropdown-toggle {
        height: 44px;
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    html body .divFG .bootstrap-select.form-control,
    html body .form-group .bootstrap-select.form-control,
    html body .modal-body .bootstrap-select.form-control {
        height: auto;
    }

    html body .divFG .input-group-addon,
    html body .form-group .input-group-addon,
    html body .modal-body .input-group-addon {
        font-size: 16px;
    }

    /* Botones pegados a la caja (quitar, buscar, más/menos): cuadrados de 44px con el ícono al centro. Sin cambiar su display:
       los componentes ocultan algunos con clases sin !important (krajee, el Cancelar de Archivo) y volverían a verse. */
    html body .divFG .input-group-btn > .btn,
    html body .form-group .input-group-btn > .btn,
    html body .modal-body .input-group-btn > .btn {
        height: 44px;
        min-width: 44px;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 16px;
        line-height: 42px;
        vertical-align: top;
    }

    /* Tags libres: etiquetas más grandes y la "x" para quitarlas del tamaño de un dedo. */
    html body .bootstrap-tagsinput.form-control {
        height: auto;
        min-height: 44px;
        padding: 4px 6px;
        line-height: 32px;
    }

    html body .bootstrap-tagsinput .tag {
        display: inline-flex;
        align-items: center;
        margin: 2px 4px 2px 0;
        padding: 4px 0 4px 10px;
        font-size: 14px;
        line-height: 20px;
        white-space: normal;
        text-align: left;
        vertical-align: middle;
    }

    html body .bootstrap-tagsinput .tag [data-role="remove"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: stretch;
        min-width: 34px;
        margin: -4px 0 -4px 2px;
        font-size: 16px;
    }

    html body .bootstrap-tagsinput input {
        height: 32px;
        font-size: 16px;
        line-height: 32px;
    }

    /* Tags con búsqueda (tagify). */
    html body tags.tagify.form-control {
        height: auto;
        min-height: 44px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    html body .tagify__tag > div {
        padding: .45em .6em;
        font-size: 15px;
    }

    html body .tagify__tag__removeBtn {
        width: 28px;
        height: 28px;
        margin-right: 2px;
        font-size: 18px;
    }

    html body .tagify__dropdown .tag-list-item {
        padding: 11px 16px;
        font-size: 16px;
    }

    /* Sí/no más grande, con el texto al centro. */
    html body .toggle.btn:not(.btn-sm):not(.btn-xs) {
        min-height: 44px;
        min-width: 76px;
    }

    html body .toggle.btn:not(.btn-sm):not(.btn-xs) .toggle-on,
    html body .toggle.btn:not(.btn-sm):not(.btn-xs) .toggle-off {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }

    /* Opciones de la caja de búsqueda. */
    html body ul.typeahead.dropdown-menu > li > a {
        padding: 11px 16px;
        font-size: 16px;
        line-height: 22px;
        white-space: normal;
    }

    /* Opciones de los combos en tableta (en celular las dibuja ComboMovil a pantalla completa). */
    html body .bootstrap-select .dropdown-menu:not(.combo-movil-panel) li > a {
        padding-top: 10px;
        padding-bottom: 10px;
        font-size: 16px;
    }

    /* Calendario con días de 44px (34 + el relleno de la tabla). */
    html body .bootstrap-datetimepicker-widget.dropdown-menu:not(.timepicker-sbs) {
        width: 300px;
    }

    html body .bootstrap-datetimepicker-widget table td.day {
        height: 34px;
        line-height: 34px;
        font-size: 15px;
    }

    html body .bootstrap-datetimepicker-widget table thead th {
        height: 34px;
        line-height: 34px;
        font-size: 15px;
    }

    html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action] {
        padding: 8px 2px;
    }

    html body .bootstrap-datetimepicker-widget .picker-switch td a[data-action]::after {
        font-size: 13px;
    }

    /* Botones de las ventanas (Aceptar, Cerrar, Guardar...). */
    html body .modal-footer .btn:not(.btn-sm):not(.btn-xs) {
        min-height: 44px;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---------- Celular ---------- */
@media (max-width: 767px) {

    /* El calendario ocupa todo el ancho de la caja: días más grandes y no se sale de la pantalla. */
    html body .input-group.date > .bootstrap-datetimepicker-widget.dropdown-menu {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
    }
}
