/* =========================================
   1. ESTILOS DE LA BARRA FIJA SUPERIOR (NAV)
   ========================================= */
@keyframes glHeaderFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.gl-mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: linear-gradient(180deg, #154178 0%, #05122C 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

/* Fila superior: Logo izq, Hamburguesa der */
.gl-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px 20px;
}

/* Contenedor del enlace del logo protegido contra Elementor */
.gl-nav-top>a {
    display: flex;
    align-items: center;
    width: 300px !important;
    /* Ancho absoluto forzado */
    max-width: 200px !important;
    flex-shrink: 0;
    /* Evita que crezca o se encoja */
    margin: 0 !important;
    padding: 0 !important;
}

/* Logotipo - Blindado contra estilos globales */
.gl-logo-nav {
    width: 100% !important;
    height: auto !important;
    max-height: 45px !important;
    /* Mantiene la sutileza */
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Botón Hamburguesa */
.gl-btn-hamburguesa {
    background-color: transparent;
    border: none;
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    height: 40px;
    width: 44px;
    margin-left: 20px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
    animation: glHamburgerScale 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes glHamburgerScale {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gl-btn-hamburguesa:active {
    transform: scale(0.95);
}

.gl-btn-hamburguesa:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* Las rayitas del icono hamburguesa */
.gl-btn-hamburguesa .gl-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #FFD700;
    border-radius: 2px;
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

/* Símbolo de notificación (circulito blanco) */
.gl-notificacion-dot {
    position: absolute;
    top: 6px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Fila inferior: Los 3 enlaces de texto */
.gl-nav-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 14px 20px;
}

.gl-nav-bottom a {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Estilo especial sutil para el botón central de OFERTAS */
.gl-nav-bottom a.gl-link-resaltado {
    color: #FFD700;
    font-weight: 700;
}

.gl-nav-bottom a:active,
.gl-nav-bottom a:hover {
    opacity: 0.7;
}

.gl-nav-bottom a.gl-link-resaltado:active,
.gl-nav-bottom a.gl-link-resaltado:hover {
    color: #ffffff;
    opacity: 1;
}

/* =========================================
   2. ESTILOS DEL OVERLAY Y MENÚ LATERAL
   ========================================= */
.gl-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gl-menu-overlay.activo {
    opacity: 1;
    visibility: visible;
}

.gl-menu-lateral {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    padding-top: 80px;
    /* Evitar que el panel se sobreponga bajo el navbar principal */
    background: linear-gradient(180deg, #154178 0%, #05122C 100%);
    z-index: 99999;
    /* Empieza fuera de la pantalla. Visibility previene parpadeos */
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.5s;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.gl-menu-lateral.activo {
    transform: translateX(0);
    visibility: visible;
}

.gl-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gl-titulo-menu {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.gl-btn-cerrar {
    background: none;
    border: none;
    font-size: 30px;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gl-btn-cerrar:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.gl-menu-scrollable {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.gl-menu-links {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

@keyframes glSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.gl-menu-links a {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    /* Ocultos por defecto para la animacion */
    transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.gl-menu-lateral.activo .gl-menu-links a {
    animation: glSlideInRight 0.5s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(1) {
    animation-delay: 0.1s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(2) {
    animation-delay: 0.15s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(3) {
    animation-delay: 0.2s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(4) {
    animation-delay: 0.25s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(5) {
    animation-delay: 0.3s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(6) {
    animation-delay: 0.35s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(7) {
    animation-delay: 0.4s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(8) {
    animation-delay: 0.45s;
}

.gl-menu-lateral.activo .gl-menu-links a:nth-child(n+9) {
    animation-delay: 0.5s;
}

.gl-menu-links a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 32px;
    /* Efecto de empuje hacia la derecha al hacer hover */
    color: #FFD700;
}

.gl-menu-links a svg {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.gl-badge {
    margin-left: 10px;
    font-size: 0.7em;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.gl-badge-novedad {
    background-color: #FFD700;
    color: #111111;
    animation: glPulse 2s infinite;
}

.gl-badge-proximamente {
    background-color: rgba(255, 255, 255, 0.15);
    color: #dddddd;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gl-menu-publicidad {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gl-menu-publicidad a {
    display: block;
}

.gl-menu-publicidad img {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes glPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* =========================================
   3. RESPONSIVE DESIGN (DESKTOP)
   ========================================= */
.gl-nav-desktop-links {
    display: none;
}

@media (min-width: 768px) {
    .gl-nav-bottom {
        display: none !important;
        /* Oculta la barra inferior en Desktop */
    }

    .gl-nav-desktop-links {
        display: flex !important;
        align-items: center;
        gap: 25px;
        margin-left: auto;
        margin-right: 20px;
    }

    .gl-nav-desktop-links a {
        color: #ffffff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        position: relative;
        padding-bottom: 4px;
        transition: color 0.3s ease;
    }

    .gl-nav-desktop-links a::after {
        content: '';
        position: absolute;
        width: 0%;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: #FFD700;
        transition: width 0.3s ease;
    }

    .gl-nav-desktop-links a.gl-link-resaltado {
        color: #FFD700;
        font-weight: 700;
    }

    .gl-nav-desktop-links a:hover {
        color: #FFD700;
    }

    .gl-nav-desktop-links a:hover::after {
        width: 100%;
    }
}

/* =========================================
   4. AISLAMIENTO PARA PREVIEW EN WP ADMIN
   ========================================= */
.gl-header-preview-mode {
    position: relative;
    background: #f1f1f1;
    border: 2px dashed #154178;
    border-radius: 6px;
    z-index: 10;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0 auto;
    /* Para centrar la vista móvil */
}

/* Base Override de fixed a absolute */
.gl-header-preview-mode .gl-mobile-nav {
    position: absolute !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

.gl-header-preview-mode .gl-menu-overlay {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

.gl-header-preview-mode .gl-menu-lateral {
    position: absolute !important;
    height: 100% !important;
    top: 0 !important;
    bottom: auto !important;
    /* Remover right: 0 !important porque rompía el transform: translateX de la animación */
}

/* =========================================
   5. CONTROLES DE VISTA PREVIA (BOTONES)
   ========================================= */

/* --- MODO DESKTOP --- */
.gl-preview-desktop {
    width: 100%;
    height: 70px;
    /* Alto solo de la barra Top en Desktop */
}

.gl-preview-desktop .gl-nav-bottom {
    display: none !important;
}

.gl-preview-desktop .gl-nav-desktop-links {
    display: flex !important;
    align-items: center;
    gap: 25px;
    margin-left: auto;
    margin-right: 20px;
}

.gl-preview-desktop .gl-nav-desktop-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.gl-preview-desktop .gl-nav-desktop-links a.gl-link-resaltado {
    color: #FFD700;
    font-weight: 700;
}

.gl-preview-desktop .gl-nav-desktop-links a:hover {
    opacity: 0.7;
}

/* Permitir que la caja crezca solo si el menú DESKTOP se abre (por el alto del sidebar) */
.gl-preview-desktop.gl-menu-is-open {
    height: 500px;
}

/* --- MODO MOBILE --- */
.gl-preview-mobile {
    width: 375px;
    /* Simular ancho de celular típico */
    height: 125px;
    /* Alto de logo + Barra Bottom */
}

.gl-preview-mobile .gl-nav-desktop-links {
    display: none !important;
}

.gl-preview-mobile .gl-nav-bottom {
    display: flex !important;
}

/* Permitir que la caja móvil crezca si el menú se abre */
.gl-preview-mobile.gl-menu-is-open {
    height: 500px;
}