/* ==========================================================================
   MarcadorSoftware — Capa global responsive (móviles y tablets)
   Se carga después de general.css/dark.css. Usa !important solo para
   anular los estilos inline y el CSS cargado de forma diferida (ocLazyLoad).
   ========================================================================== */

/* Imágenes nunca desbordan su contenedor */
img { max-width: 100%; height: auto; }

/* ==========================================================================
   Tablas: desplazamiento horizontal táctil en pantallas angostas
   ========================================================================== */
@media (max-width: 768px) {
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================================================
   Contenedores de contenido con altura fija -> fluidos en móvil
   ========================================================================== */
@media (max-width: 768px) {
    .col[style*="height: 100vh"],
    .col[style*="height:100vh"] {
        height: auto !important;
        min-height: 100vh;
    }
    .contenedor_admin {
        height: auto !important;
        min-height: 100vh;
        border-radius: 0 !important;
    }
    .contenedor-icon,
    .Contenedor-icon {
        height: auto !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   Modales: ocupan todo el ancho disponible y son desplazables
   ========================================================================== */
@media (max-width: 768px) {
    .modal-dialog {
        width: 100% !important;
        max-width: 100vw !important;
        height: auto !important;
        max-height: 92vh !important;
        margin: 1rem auto !important;
    }
    [style*="max-width: 80vw"], [style*="width: 80vw"],
    [style*="max-width: 90vw"], [style*="width: 90vw"],
    [style*="max-width: 95vw"], [style*="width: 95vw"] {
        max-width: 100vw !important;
        width: 100vw !important;
        max-height: 92vh !important;
        height: auto !important;
    }
    .modal-content { border-radius: 12px !important; }
    .modal-body {
        max-height: 72vh !important;
        overflow-y: auto !important;
    }
    .modal-body[style*="height: 500px"] {
        height: auto !important;
        max-height: 72vh !important;
    }
}

/* ==========================================================================
   Navbar: búsqueda y acciones en una sola columna
   ========================================================================== */
@media (max-width: 576px) {
    .navbar .container-fluid { flex-wrap: wrap !important; }
    .navbar .d-flex {
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: .4rem !important;
    }
    .navbar .d-flex > .form-control {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   Campos con ancho fijo -> ancho completo en móvil
   ========================================================================== */
@media (max-width: 576px) {
    [style*="width: 20%"],
    [style*="width: 33%"],
    [style*="width: 50%"],
    [style*="width: 70%"] {
        width: 100% !important;
    }
    [style*="max-width: 180px"],
    [style*="max-width: 200px"],
    [style*="max-width: 220px"] {
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Despacho: las dos columnas se apilan; las tarjetas de lote fluyen
   ========================================================================== */
@media (max-width: 992px) {
    .container-despacho {
        flex-direction: column !important;
        height: auto !important;
    }
    .despacho1,
    .despacho2 {
        width: 100% !important;
        padding-left: .5rem !important;
        padding-right: .5rem !important;
        padding-top: .75rem !important;
        padding-bottom: .75rem !important;
    }
    .contenido_info_empresa,
    .contenido_info_lotes {
        height: auto !important;
    }
}
@media (max-width: 992px) {
    .card-lotes {
        width: 44% !important;
        margin: 3% !important;
    }
}
@media (max-width: 576px) {
    .card-lotes { width: 100% !important; margin: 4% 0 !important; }
    .despacho1 input[type="text"],
    .despacho1 input[type="number"] { width: 100% !important; }
}

/* ==========================================================================
   Gráficas: altura útil fija dentro de contenedores fluidos
   ========================================================================== */
@media (max-width: 768px) {
    [id^="Grafico"],
    [id^="ch"] {
        height: 260px !important;
        min-height: 240px;
    }
}

/* ==========================================================================
   Controles táctiles: objetivos de toque generosos en móvil
   ========================================================================== */
@media (max-width: 576px) {
    .btn {
        min-height: 42px;
        white-space: normal;
    }
    .card-icon-boton {
        width: 64px !important;
        height: 64px !important;
    }
}
