/* ==========================================================================
   HOJA DE ESTILOS: VISOR DE DOCUMENTOS Y MENÚS EN PDF
   Archivo: css/visor-menu.css
   ========================================================================== */


/* ==========================================================================
   BLOQUE 1: ESTRUCTURA PRINCIPAL DEL CUERPO (BODY)
   - Permite que el header se mantenga arriba y la página fluya hacia abajo.
   ========================================================================== */
body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Habilita el desplazamiento natural de la página */
    background-color: #fdf4e8;
}


/* ==========================================================================
   BLOQUE 2: ENCABEZADO Y MARCA (HEADER & BRANDING)
   - Integra el color oficial y alineación flexible.
   ========================================================================== */
.header-visor {
    padding: 12px 20px;
    background: linear-gradient(to right, #ff4800, #ff9e00);
    /* Fondo oficial del sitio */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.header-contenido {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 12px;
}

/* El contenedor de la marca toma el espacio sobrante de forma elástica */
.brand-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* TÍTULO PRINCIPAL (ESCRITORIO / PANTALLAS GRANDES) */
.brand-info h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    text-transform: none;
    letter-spacing: normal;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}


/* ==========================================================================
   BLOQUE 3: BOTONES DE ACCIÓN (CERRAR Y DESCARGAR)
   ========================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Botón de Cerrar / Volver */
.btn-cerrar {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-cerrar:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* Botón de Descarga de PDF */
.btn-descarga-header {
    background: linear-gradient(to right, #0199ff, #0145ff);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(1, 69, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-descarga-header:hover {
    background: linear-gradient(to right, #0088e6, #003cd6);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(1, 69, 255, 0.45);
    transform: translateY(-1px);
}


/* ==========================================================================
   BLOQUE 4: CONTENEDOR DEL DOCUMENTO PDF (MAIN & IFRAME / CANVAS)
   - Altura fluida que empuja al footer naturalmente hacia abajo.
   ========================================================================== */
.contenedor-pdf {
    flex-grow: 1;
    width: 100%;
    height: auto;
    /* Permite crecimiento dinámico según las páginas del PDF */
    min-height: auto;
    background-color: #fdf4e8;
    padding: 20px 0;
    box-sizing: border-box;
}

.contenedor-pdf iframe {
    width: 100%;
    height: 80vh;
    /* Se mantiene solo cuando iframe está visible en PC */
    border: none;
    display: block;
}

/* Ajuste para las páginas renderizadas por PDF.js */
.contenedor-pdf canvas {
    display: block;
    max-width: 95% !important;
    height: auto !important;
    margin: 0 auto;
}


/* ==========================================================================
   BLOQUE 5: ADAPTACIÓN MÓVIL FLUIDA Y SIMETRÍA LATERAL (RESPONSIVE DESIGN)
   ========================================================================== */
@media (max-width: 600px) {

    .header-visor {
        padding-left: 0;
        padding-right: 0;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* Margen simétrico exacto a ambos lados en dispositivos móviles */
    .header-contenido {
        padding: 0 16px;
        box-sizing: border-box;
        width: 100%;
        gap: 10px;
    }

    .header-actions {
        margin-right: 0;
        flex-shrink: 0;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .brand-info h1 {
        font-size: 1.3rem;
        font-weight: 700;
    }

    /* Oculta las etiquetas de texto de los botones en móviles */
    .button .btn-texto {
        display: none;
    }

    /* Botones compactos */
    .button {
        padding: 8px 10px;
    }

    .button i {
        margin-right: 0 !important;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   PROTECCIÓN DE LECTURA PARA EL FOOTER
   ========================================================================== */

/* Aseguramos que el footer fluya libremente al final del flujo del documento */
footer {
    position: relative;
    z-index: 100;
    width: 100%;
    margin-top: auto;
    /* Empuja el footer al final si la pantalla es más grande que el contenido */
}

/* En celulares y pantallas pequeñas, elevamos ligeramente el botón flotante si es necesario */
@media (max-width: 600px) {
    .share-notification-container {
        bottom: 25px;
    }
}