/* =========================================
   1. TIPOGRAFÍA
   ========================================= */
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

/* Opcionales: cursivas */
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-MediumItalic.ttf") format("truetype");
    font-weight: 500;
    font-style: italic;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-SemiBoldItalic.ttf") format("truetype");
    font-weight: 600;
    font-style: italic;
}
@font-face {
    font-family: "GoogleSans";
    src: url("fonts/GoogleSans-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
}

/* Aplicar la fuente */
body {
    font-family: "GoogleSans", sans-serif;
}

/* =========================================
   OTROS ESTILOS (sin cambios)
   ========================================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #ffde59; }

a { text-decoration: none; transition: color 0.3s ease, background-color 0.3s ease; }

/* =========================================
   2. TÍTULOS Y CABECERAS
   ========================================= */
.page-title { font-weight: 700; color: #1a1a1d; margin-top: 15px; margin-bottom: 10px; letter-spacing: -0.5px; }
.exe-web-site .page-title, .exe-single-page .page-title { text-shadow: none; }
.exe-epub .page-title, .exe-scorm .page-title, .exe-ims .page-title { color: #1a1a1d; }

.page > header, .package-header { display: none !important; }

body.exe-export { padding: 1em 0; }
body.exe-export.exe-scorm, body.exe-export.exe-ims, body.exe-export.exe-epub { padding: 0; }

body.exe-scorm .page-title, body.exe-ims .page-title, body.exe-epub .page-title { padding: 0 32px; }

@media (max-width: 750px) { body.exe-scorm .page-title, body.exe-ims .page-title, body.exe-epub .page-title { padding: 0 24px; } }

body.exe-web-site { padding: 0; }
.exe-content a { color: #1a1a1d; font-weight: 600; border-bottom: 2px solid #ffde59; }
.exe-content a:hover, .exe-content a:focus { color: #000; background-color: #ffde59; text-decoration: none; border-radius: 2px;}

.exe-accordion .fx-accordion-title, .fx-pagination .fx-current a { background-color: #ffde59; color: #1a1a1d; }
.exe-fx a { color: #1a1a1d; }
.exe-fx a:hover, .exe-fx a:focus { color: #000; background-color: #ffde59; }

.exe-download-package-link a {
    background: rgba(255, 255, 255, 0.8); color: #1a1a1d; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 20px; backdrop-filter: blur(8px); transition: all 0.3s ease;
}
.exe-download-package-link a:hover { background: #ffde59; border-color: #ffde59; box-shadow: 0 4px 15px rgba(255, 222, 89, 0.4); transform: translateY(-2px); }

/* =========================================
   3. CONTENEDOR PRINCIPAL Y FONDO
   ========================================= */
#node-content-container.exe-content #node-content { padding-top: 10px; padding-bottom: 20px; max-width: 1280px; margin: 0 auto; display: block; }

.exe-content {
    font-family: "Fredoka", Arial, sans-serif; 
    font-size: 120%; 
    color: #333; 
    background-color: #fafafa; 
    background-image: radial-gradient(#d5d5d5 1px, transparent 1px);
    background-size: 24px 24px; 
}
.js .exe-export .exe-content { min-height: calc(100vh - 30px); }
.js .in-iframe .exe-content { min-height: 0; }
.sr-av { display: none; }
.exe-content .package-title, .exe-single-page .package-header h1 { font-size: 1.7rem; text-align: left; font-weight: 700; }
.exe-single-page .package-node { margin-bottom: 3.5em; }

/* =========================================
   4. CAJAS DE CONTENIDO 
   ========================================= */
.box {
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(10px); 
    border: 1px solid #ffde59; 
    border-bottom: 24px solid #ffde59; 
    border-radius: 16px; 
    padding: 2.25rem; 
    margin-bottom: 32px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); 
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.box:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); 
}
.exe-content .box { margin: 35px 0; }
.exe-web-site .exe-content .box { margin: 30px 0; }
.exe-content .box-head { border-bottom: 0; }
#node-content-container.exe-content .box.hidden-idevices { border-style: solid; }

.exe-content .box header { 
    min-height: auto; 
    border-bottom: 3px solid #ffde59; 
    margin-bottom: 20px; 
    padding-bottom: 12px;
}
.exe-content .box-head .box-title { 
    color: #1a1a1d; 
    font-size: 1.65rem !important; 
    font-weight: 700; 
    border-left: 6px solid #ffde59;
    padding-left: 12px;
}
.exe-content .box-head .exe-icon { float: left; }

.exe-web-site .page-content, #exe-client-search, .exe-web-site main > header, .exe-export .exe-content { max-width: 1280px; padding: 0 60px; margin: 0 auto; }
.exe-single-page .exe-content { max-width: 100% !important; }
.exe-single-page .exe-content main, .exe-single-page .exe-content footer { max-width: 1280px; margin: 0 auto; }
.exe-single-page .exe-content main { padding-top: 4em; }
.exe-web-site .exe-content { max-width: none; padding: 0; }
.exe-scorm .exe-export main, .exe-ims .exe-export main, .exe-epub .exe-export main { padding-top: 5em; padding-bottom: 1em; }
body.exe-export.exe-scorm .exe-content, body.exe-export.exe-ims .exe-content, body.exe-export.exe-epub .exe-content { padding: 0 40px; }
.exe-content.cover-on .exe-interactive-video, .exe-content .exe-interactive-video { width: 100%; }
.exe-export main { padding-top: 1.5em; }

.exe-web-site main { padding-top: 165px; } 
.exe-web-site main.page { box-sizing: border-box; width: 100%; padding-left: 0; padding-bottom: 24px; }
.exe-web-site #siteFooter { padding-left: 60px; padding-right: 60px; padding-bottom: 2em; transition: padding 0.4s ease; }

/* =========================================
   MENÚ 100% CSS (SIN JS NI HTML)
   ========================================= */

/* 1. ARREGLO DE CAPAS (Para que no se encimen los desplegables) */
#siteNav {
    position: fixed; 
    top: 173px; 
    left: 0; 
    width: 100%; 
    min-height: 70px; 
    height: auto;      
    background-color: #ffde59; 
    z-index: 9999; /* Máxima prioridad */
    padding: 10px 0;  
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
    display: flex; 
    justify-content: center;
    align-items: center;
}

#siteNav > ul { 
    display: flex; 
    flex-direction: row; 
    flex-wrap: wrap; 
    justify-content: center;
    margin: 0; 
    padding: 0; 
    list-style: none; 
    gap: 5px;
}

#siteNav > ul > li { 
    position: relative; 
    list-style: none;
}

/* 2. SUBMENÚS (Corrección de visibilidad y posición) */
#siteNav ul ul { 
    visibility: hidden; 
    opacity: 0;
    position: absolute; 
    top: 100%; 
    left: 0; 
    background-color: #ffffff; 
    display: flex;
    flex-direction: column; 
    min-width: 220px; 
    border-radius: 8px; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.2); 
    padding: 10px 0; 
    margin: 0; 
    transition: all 0.2s ease-in-out;
    z-index: 10000; /* Siempre por encima de los otros botones */
    border: 1px solid rgba(0,0,0,0.1);
}

/* El puente invisible para evitar el parpadeo */
#siteNav li:hover > ul { 
    visibility: visible; 
    opacity: 1;
    margin-top: 0; 
}

/* 3. ADAPTACIÓN AUTOMÁTICA POR ZOOM (MEDIA QUERY) */
/* Cuando la pantalla mide menos de 980px o el zoom es muy alto */
@media (max-width: 980px) {
    #siteNav {
        position: relative; /* Deja de flotar para no tapar contenido si es muy largo */
        top: 0; 
        flex-direction: column;
        padding: 0;
    }

    #siteNav > ul {
        flex-direction: column; /* Se vuelve una lista vertical */
        width: 100%;
        gap: 0;
    }

    #siteNav > ul > li {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    #siteNav a {
        width: 100%;
        justify-content: flex-start; /* Alinea texto a la izquierda */
        padding: 15px 20px;
        border-radius: 0;
    }

    /* En modo móvil/zoom alto, los submenús se muestran al tocar/hover de forma simple */
    #siteNav ul ul {
        position: static; /* Ya no flotan, empujan el contenido hacia abajo */
        visibility: visible;
        opacity: 1;
        display: none; /* Ocultos por defecto */
        width: 100%;
        box-shadow: none;
        background-color: #f9f9f9;
        border: none;
    }

    #siteNav li:hover > ul {
        display: block; /* Se despliegan al pasar el mouse o tocar */
    }
    
    /* Flechas para indicar que hay más */
    .daddy::after {
        content: ' ▼';
        font-size: 10px;
        margin-left: 10px;
    }
}

/* 4. ESTILOS DE ENLACES (Limpieza) */
#siteNav a { 
    color: #1a1a1d; 
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-weight: 600;
    transition: 0.3s;
}

#siteNav a:hover {
    background-color: rgba(255,255,255,0.5);
}

/* =========================================
   6. PAGINACIÓN
   ========================================= */
.nav-buttons .nav-button, button.toggler {
    position: fixed; 
    top: 50px; 
    right: 60px; 
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto; background-image: url(img/back_arrow.svg); background-size: 20px;
    background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9); background-repeat: no-repeat; border-radius: 12px; z-index: 999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); padding: 14px 18px; color: #1a1a1d; font-weight: 600; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-buttons span.nav-button { opacity: 0.5; cursor: not-allowed; background-color: rgba(230, 230, 230, 0.6); color: #999; box-shadow: none; }
.nav-buttons .nav-button-left { background-position: left 14px center; padding-left: 42px; right: 180px; }
.nav-buttons .nav-button-right { background-position: right 14px center; padding-right: 42px; background-image: url(img/forward_arrow.svg); right: 20px; }
.nav-buttons a:hover, .nav-buttons a:focus, button.toggler:hover, button.toggler:focus {
    background-color: #ffde59; color: #1a1a1d; border-color: #ffde59; transform: scale(1.05) translateY(-2px); box-shadow: 0 8px 25px rgba(255, 222, 89, 0.4);
}

/* =========================================
   7. INTERFAZ DE CAJAS (TOGGLES Y TABLAS)
   ========================================= */
.exe-export .box { position: relative; }

.exe-export .box-toggle {
    width: 36px; height: 36px; background: rgba(255, 255, 255, 0.9) url(img/arrow.svg); background-size: auto 20px; background-repeat: no-repeat; background-position: center;
    border-radius: 50%; border: 1px solid #e0e0e0; position: absolute; top: 24px; right: 24px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.exe-export .box-toggle:hover { background-color: #ffde59; border-color: #ffde59; transform: scale(1.1); }
.exe-export .minimized .box-toggle { transform: rotate(180deg); }
.box-toggle span { display: none !important; }

#node-content-container.exe-content .box-head .exe-icon { width: 60px; height: 60px; font-size: 40px; }
#node-content-container.exe-content .box-head .exe-icon img { height: 40px; }
.exe-export .box-icon img { display: block; float: left; margin-right: 15px; width: 40px; height: auto; }
.exe-export .box-title { padding-top: 5px; }
.exe-export .box.minimized .box-head { border-bottom: 1px solid #f0f0f0; }
.exe-export .box.no-header.minimized .box-head { border-color: #fff; }
.exe-export .box .box-content { padding-top: 20px; }
.exe-export .box.no-header .box-content { background: none; border: none; padding: 20px 0; }

.exe-export #siteFooterContent {
    background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); padding: 20px; border-radius: 16px; width: 100%; max-width: 1160px; margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid rgba(255,255,255,1);
}

.exe-content table {
    display: table; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100% !important; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

/* =========================================
   8. COMPONENTES Y UTILIDADES
   ========================================= */
.exe-content .iDevice_buttons input, .exe-content .iDevice_buttons button {
    background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(5px); color: #1a1a1d; border: 1px solid #d0d0d0; padding: 8px 16px; border-radius: 8px; font-weight: 600; transition: all 0.3s ease; cursor: pointer;
}
.exe-content .iDevice_buttons input:hover, .exe-content .iDevice_buttons button:hover {
    background: #ffde59; color: #1a1a1d; border-color: #ffde59; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255, 222, 89, 0.3);
}

.page-counter {
    text-align: right; font-size: 0.9em; font-weight: 600; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,1);
    border-radius: 20px; position: fixed; 
    top: 260px; 
    right: 32px; margin: 0; padding: 6px 14px; color: #1a1a1d; box-shadow: 0 4px 10px rgba(0,0,0,0.03); z-index: 500;
}
.exe-web-site .page-counter { right: 340px; }

/* =========================================
   9. RESPONSIVE DESIGN (Móviles y Tablets)
   ========================================= */
@media (max-width: 1200px) {
    body.cover-on #activity { width: 100% !important; }
    #activity { width: 100%; margin: 0 auto; }
    #activity #player { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 1024px) {
    .nav-buttons .nav-button span { display: none; }
    .nav-buttons .nav-button { height: 50px; width: 50px; padding: 0; }
    .nav-buttons .nav-button-right { right: 20px; background-position: center; }
    .nav-buttons .nav-button-left { right: 85px; background-position: center; }
    .exe-web-site .page-counter { right: 160px; top: 260px; }
    .page-counter-label { display: none; }
}

@media (max-width: 750px) {
    /* Menú vertical integrado con efecto acordeón */
    #siteNav { 
        position: relative; 
        top: 0;
        display: flex; 
        flex-direction: column;
        padding: 15px 20px;
        height: auto;
    }
    
    #siteNav > ul { 
        flex-direction: column; 
        width: 100%;
        gap: 8px; 
    }
    
    #siteNav > ul > li {
        width: 100%;
        flex-direction: column; /* Apila el enlace principal y su submenú */
        align-items: stretch;
    }
    
    #siteNav a {
        width: 100%; 
        justify-content: flex-start; 
        padding: 12px 20px;
    }

    /* Submenús en Móvil (Acordeón Oculto por defecto) */
    #siteNav ul ul {
        position: static; 
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0;
        background-color: rgba(255, 255, 255, 0.4);
        max-height: 0;       /* Oculta el contenido */
        overflow: hidden;    /* Evita que se desborde */
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
        margin-top: 0;
    }

    /* Al tocar la opción padre, se expande el submenú */
    #siteNav li:hover > ul,
    #siteNav li:focus-within > ul {
        max-height: 800px; /* Un valor alto para asegurar que quepan todos los enlaces */
        opacity: 1;
        visibility: visible;
        margin-top: 5px;
        padding: 5px 0;
    }

    .exe-web-site main { padding-top: 30px; } 
    .exe-web-site main.page { padding-left: 0; padding-top: 15px; }
    .exe-web-site .exe-content .box { margin-top: 20px; }
    
    .nav-buttons .nav-button { top: auto; bottom: 20px; }
    .nav-buttons .nav-button-left { right: 80px; }
    .page-counter { display: none; } 
}

@media print {
    html body.exe-export { background: #fff; }
    .exe-content { color: #000; padding: 0; background-image: none !important; }
    @page { margin: 1.5cm; }
    .exe-export .box-toggle { display: none; }
    .exe-web-site #siteNav, .exe-web-site .nav-buttons, .exe-web-site button.toggler { display: none; }
    .exe-web-site #siteFooter, .exe-web-site main.page { padding-left: 0; padding-right: 0; }
}