/**
 * GLOBAL.CSS - Estilos globales (Header, Footer, Elementos comunes)
 * Ortega y Gasset - Academist Child Theme
 * Version: 1.3.2
 */

/* ========================================
   TIPOGRAFÍA LEXEND (Google Fonts)
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&display=swap');

/* Aplicar Lexend a todo el sitio */
* {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Asegurar que todas las imágenes sean responsive */
img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   PREVENIR SCROLL HORIZONTAL
   ======================================== */

html, body {
    overflow-x: hidden; /* Prevenir scroll horizontal */
    max-width: 100%;
}

body {
    position: relative;
}

/* Asegurar que todos los contenedores no excedan el viewport */
.eltdf-wrapper,
.eltdf-wrapper-inner,
.eltdf-content {
    overflow-x: hidden;
    max-width: 100%;
}

/* Captcha responsive - prevenir overflow */
.grecaptcha-badge,
iframe[src*="recaptcha"] {
    max-width: 100% !important;
    transform-origin: 0 0;
}

/* En móvil, si el captcha es muy grande, escalarlo */
@media (max-width: 768px) {
    .grecaptcha-badge {
        transform: scale(0.85);
        transform-origin: bottom right;
    }
}

/* ========================================
   HEADER
   ======================================== */

/* Contenedor general del header (logo + botón + menú) */
.og-header {
    display: block;
    width: 100%;
    position: fixed;         /* SIEMPRE fijo arriba */
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;          /* por encima de sliders, etc. */
    transition: transform 0.3s ease;
}

/* Clase para ocultar header en móvil al hacer scroll down */
.og-header.og-header-hidden {
    transform: translateY(-100%);
}

/* Ajuste cuando está el admin bar de WordPress */
body.admin-bar .og-header {
    top: 32px; /* altura típica de la barra de admin */
}

/* Empujamos el contenido hacia abajo para que no quede oculto bajo el header */
body {
    padding-top: 140px; /* ajusta si ves que sobra o falta espacio */
}

/* Y si hay admin bar, sumamos un poco más */
body.admin-bar {
    padding-top: 172px; /* 140 + 32 */
}

.og-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.og-header-top {
    background: #ffffff;
    padding: 12px 0;
    width: 100%;
}

.og-header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.og-logo a,
.og-logo img {
    display: block;
    max-height: 100px;
}

/* Botón "Campus virtual" */
.og-campus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 26px;
    border-radius: 999px;
    background: #0079d7;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(0, 121, 215, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.og-campus-btn:hover {
    background: #0065b3;
}

/* Barra azul del menú */
.og-main-nav {
    background: #0593f3;
    width: 100%;
}

.og-main-nav-inner {
    display: flex;
    justify-content: center;
}

.og-menu {
    list-style: none;
    display: flex;
    gap: 48px;
    padding: 0;
    margin: 0;
}

.og-menu li a {
    display: inline-block;
    padding: 18px 0;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}

/* Submenús desplegables */
.og-menu-item-has-children {
    position: relative;
}

.og-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #0079d7;
    list-style: none;
    padding: 12px 0;
    margin: 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.og-menu-item-has-children:hover .og-submenu {
    opacity: 1;
    visibility: visible;
}

.og-submenu li {
    padding: 0;
}

.og-submenu li a {
    display: block;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.og-submenu li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Botón hamburguesa (oculto por defecto) */
.og-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.og-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.og-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.og-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.og-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   FOOTER
   ======================================== */

/* Eliminar espacios del wrapper del tema padre */
.eltdf-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.eltdf-content-inner {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.eltdf-wrapper {
    margin-bottom: 0 !important;
}

.eltdf-wrapper-inner {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ocultar footer del tema padre si existe */
.eltdf-page-footer {
    display: none !important;
}

.og-footer {
    background: #003b72;
    color: #ffffff;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 14px;
    line-height: 1.6;
    clear: both;
}

.og-footer-top {
    padding: 50px 0 40px;
}

.og-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.og-footer-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.og-footer h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.og-footer p {
    margin: 0 0 8px;
    line-height: 1.7;
}

.og-footer-address {
    margin-bottom: 20px;
}

.og-footer a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.og-footer a:hover {
    opacity: 0.8;
}

.og-footer-links {
    display: flex;
    justify-content: center;
}

.og-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.og-footer-list li {
    margin-bottom: 12px;
}

.og-footer-list li a {
    font-size: 15px;
    font-weight: 500;
}

.og-footer-sedes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.og-sede h4 {
    margin-bottom: 8px;
}

.og-sede p {
    font-size: 13px;
    line-height: 1.6;
}

.og-sede-web {
    display: inline-block;
    margin-top: 4px;
}

.og-footer-bottom {
    background: #0593f3;
    text-align: center;
    padding: 14px 0;
    font-size: 13px;
    color: #ffffff;
}

.og-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.og-footer-icon-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}

.og-footer-icon-line .og-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.og-footer-icon-line svg {
    display: block;
}

/* Forzar texto blanco en líneas de iconos del footer */
.og-footer-icon-line span,
.og-footer-icon-line p,
.og-footer-icon-line a {
    color: #ffffff !important;
}

/* Asegurar que todo el texto del footer es blanco */
.og-footer,
.og-footer p,
.og-footer li,
.og-footer h4 {
    color: #ffffff !important;
}

/* ========================================
   BOTÓN BACK TO TOP
   ======================================== */

.og-back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: #0593f3;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(5, 147, 243, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.og-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.og-back-to-top:hover {
    background: #003b72;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(5, 147, 243, 0.6);
}

/* ========================================
   BOTÓN FLOTANTE INSCRIBIRME AHORA
   ======================================== */

.og-inscribirme-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 32px;
    background: #003d71;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0, 61, 113, 0.4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.og-inscribirme-btn.visible {
    opacity: 1;
    visibility: visible;
}

.og-inscribirme-btn:hover {
    background: #0593f3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(5, 147, 243, 0.6);
    color: #ffffff;
}

/* ========================================
   RESPONSIVE GLOBAL
   ======================================== */

/* Tablet (768px - 1024px) - Menú normal pero más compacto */
@media (max-width: 1024px) {
    .og-menu {
        gap: 24px;
    }

    .og-menu li a {
        font-size: 15px;
    }

    .og-container {
        padding: 0 16px;
    }
}

/* Tablet pequeña y móvil grande (641px - 768px) */
@media (max-width: 768px) {
    body {
        padding-top: 0;
    }

    body.admin-bar {
        padding-top: 32px;
    }
    
    /* Agregar margen al contenido */
    .eltdf-content {
        margin-top: 130px;
    }

    .og-logo a,
    .og-logo img {
        max-height: 60px;
    }

    .og-menu {
        gap: 20px;
    }

    .og-menu li a {
        font-size: 14px;
        padding: 14px 0;
    }

    .og-campus-btn {
        font-size: 13px;
        padding: 8px 20px;
    }

    .og-submenu {
        min-width: 180px;
    }
    
    /* Botones flotantes en tablet */
    .og-inscribirme-btn {
        font-size: 14px;
        padding: 14px 24px;
        right: 20px;
        bottom: 20px;
    }

    /* Footer en tablet */
    .og-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .og-footer-sedes {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Móvil (hasta 640px) - Menú hamburguesa */
@media (max-width: 640px) {
    body {
        padding-top: 0;
    }

    body.admin-bar {
        padding-top: 32px;
    }

    /* En móvil el header se oculta al hacer scroll */
    .og-header {
        position: fixed;
    }

    /* Agregar margen al contenido para que no quede debajo del header */
    .eltdf-content {
        margin-top: 120px;
    }

    body.admin-bar .eltdf-content {
        margin-top: 120px;
    }

    .og-header-top {
        padding: 12px 0;
    }

    .og-header-top-inner {
        flex-direction: row;
        justify-content: space-between;
    }

    .og-logo a,
    .og-logo img {
        max-height: 45px;
    }

    .og-campus-btn {
        font-size: 12px;
        padding: 8px 16px;
    }

    /* Mostrar botón hamburguesa */
    .og-menu-toggle {
        display: flex;
    }

    /* Menú en versión móvil */
    .og-main-nav-inner {
        position: relative;
    }

    .og-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0593f3;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease;
    }

    .og-menu.active {
        max-height: 500px;
        opacity: 1;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .og-menu > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .og-menu > li:last-child {
        border-bottom: none;
    }

    .og-menu > li {
        text-align: center;
    }

    .og-menu > li > a {
        padding: 16px 20px;
        display: block;
    }

    /* Submenús en móvil */
    .og-submenu {
        position: static;
        transform: none;
        background: rgba(0, 0, 0, 0.15);
        min-width: auto;
        opacity: 1;
        visibility: visible;
        display: none;
        padding: 0;
        box-shadow: none;
    }

    .og-menu-item-has-children:hover .og-submenu {
        display: block;
    }

    .og-submenu li {
        text-align: center;
    }

    .og-submenu li a {
        padding: 12px 20px;
        font-size: 13px;
    }

    .og-submenu li a:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Footer en móvil */
    .og-footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .og-footer-top {
        padding: 35px 0 25px;
    }

    .og-footer-column {
        text-align: center;
    }

    .og-footer-links {
        justify-content: center;
    }

    .og-footer-sedes {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .og-footer-address {
        font-size: 13px;
    }

    .og-footer h4 {
        font-size: 15px;
    }

    .og-footer-icon-line {
        justify-content: center;
    }

    /* Botón back-to-top en móvil */
    .og-back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    /* Botón flotante móvil */
    .og-inscribirme-btn {
        font-size: 13px;
        padding: 12px 20px;
        right: 15px;
        bottom: 90px;
    }
}
