/* ======================= REGLAS GENERALES ======================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ======================= HEADER Y LOGO ======================= */
.main-header {
    background: #042bec;
    color: white;
    padding: 0.75rem 0 0.55rem 0;
    width: 100%;
}
.header-bar, .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 56px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
}
.logo-link {
    display: flex;
    align-items: center;
    margin-right: 18px;
    text-decoration: none;
    flex-shrink: 0;
    padding: 4px 8px 4px 0;
}
.logo-meta18 {
    height: 48px;
    max-width: 200px;
    min-width: 80px;
    margin-right: 18px;
    margin-left: 0px;
    object-fit: contain;
    display: block;
    transition: height 0.18s, max-width 0.18s;
}

/* ======================= NAVEGACIÓN Y MENÚ ======================= */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 0;
    z-index: 1001;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: thin;
}
.nav-links::-webkit-scrollbar { height: 6px; }
.nav-links::-webkit-scrollbar-thumb { background: #143cff38; border-radius: 6px; }
.nav-links::-webkit-scrollbar-track { background: transparent; }
.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-link {
    color: white;
    margin: 0 4px;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
    font-size: 1.10rem;
    padding: 2px 0;
}
.nav-link:hover,
.footer-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}
.nav-login, .nav-register, .nav-logout {
    color: #FFD700 !important;
    font-weight: bold;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    position: relative;
    z-index: 1100 !important;
    cursor: pointer;
}

/* ======================= CONTENIDO PRINCIPAL ======================= */
.central-content {
    flex: 1 1 auto;
    overflow-y: auto;
    max-width: 100%;
    margin: auto;
    padding: 2rem 0 120px 0;
    background: linear-gradient(to bottom,#042bec, #ffffff);
    position: relative;
    z-index: 0 !important;
    min-height: 65vh;
}

/* ======================= MENSAJES FLASH ======================= */
.flash-container {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 420px;
    width: 92vw;
    margin: 0;
    z-index: 4000;
    border-radius: 16px;
    text-align: center;
    background: rgba(24, 59, 210, 0.32);  /* Ajusta opacidad aquí */
    box-shadow: 0 6px 32px #042bec22, 0 1px 4px #042bec22;
    backdrop-filter: blur(5px) saturate(1.15);
    pointer-events: none;
    animation: flashIn 0.33s;
    border: 1.5px solid #2f73f8aa;
}

.alert {
    padding: 16px 30px;
    background: transparent !important;
    color: #fff;
    font-size: 1.14em;
    font-weight: 600;
    border-radius: 12px;
    margin: 0;
    border: none;
    box-shadow: none;
    letter-spacing: 0.01em;
    text-shadow: none;
}


.flash-container .alert,
.flash-container .alert-info,
.flash-container .alert-success,
.flash-container .alert-warning,
.flash-container .alert-danger,
.flash-container .alert-error {
    color: #fff !important;
    background: transparent !important;
    border: none !important;
}

/* ======================= FOOTER ======================= */
.main-footer {
    background: #042bec;
    color: white;
    padding: 40px 0;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 10;
}
.footer-link {
    color: white;
    margin: 0 8px;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 1.1rem;
}
.footer-link:hover { color: #FFD700; }
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}
.footer-socials img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}
.footer-socials img:hover { transform: scale(1.1);}
.copyright { font-size: 0.9em; color: #bbb; margin-top: 20px; display: block; font-weight: 500; }
.footer-separator { border-top: 1px solid #ddd; margin: 20px 0; }
/* =================== HEADER & LOGO RESPONSIVE =================== */
/* Desktop grande */
@media (min-width: 1401px) {
    .header-bar, .header-content { min-height: 72px; padding-left: 24px; padding-right: 24px; }
    .logo-meta18 { height: 80px; width: auto !important; padding-top: 0; padding-bottom: 0; }
    .main-footer { min-height: 80px; padding: 40px 0; }
}
/* Laptop/desktop medio */
@media (max-width: 1400px) {
    .header-bar, .header-content { min-height: 62px; padding-left: 18px; padding-right: 18px; }
    .logo-meta18 { height: 80px; width: auto !important; padding-top: 0; padding-bottom: 0; }
    .main-footer { min-height: 70px; padding: 35px 0; }
}
/* Tablet horizontal */
@media (max-width: 1120px) {
    .header-bar, .header-content { min-height: 56px; padding-left: 12px; padding-right: 12px; }
    .logo-meta18 { height: 80px; width: auto !important; padding-top: 0; padding-bottom: 0; }
    .main-footer { min-height: 60px; padding: 30px 0; }
}

/* Tablet vertical y móviles grandes */
@media (max-width: 850px) {
    .header-content, .header-bar {
        padding-left: 6px; padding-right: 6px;
        min-height: 44px;
    }
    .logo-meta18 {
        height: 50px;
        width: auto !important;
        min-width: 0;
        max-width: 200px;
        vertical-align: middle;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: 6px;
        padding-right: 40px;
        background: none;
        border: none;
        font-size: 2.3rem;
        color: white;
        z-index: 1100;
        height: 2.3rem;
        width: 2.3rem;
        line-height: 1;
        cursor: pointer;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 54px;
        left: 0;
        width: 100vw;
        min-width: 0;
        min-height: unset;
        flex-direction: column;
        background: #042bec;
        z-index: 1001;
        box-shadow: 0 8px 24px #1458a622;
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
        padding: 0 0 10px 0;
        animation: navDropDown 0.19s;
    }
    .main-nav.mostrar {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        max-height: 95vh;
        overflow-y: auto;
        z-index: 1001 !important;
        background: #042bec;
        box-shadow: 0 8px 24px #1458a622;
    }
    .main-nav .nav-links,
    .main-nav .nav-auth {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 0 !important;
        row-gap: 0 !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    .main-nav .nav-links {
        border-bottom: 1px solid #1e42a9;
        padding: 0;
    }
    .main-nav .nav-auth {
        border-top: 1px solid #264dcf55;
        padding: 2px 0 6px 0;
    }
    .main-nav .nav-link {
        display: block !important;
        width: 100% !important;
        padding: 15px 0 15px 18px !important;
        margin: 0 !important;
        text-align: left !important;
        font-size: 1.13rem !important;
        color: #fff !important;
        border-bottom: 1px solid #1e42a9 !important;
        background: #042bec !important;
        box-sizing: border-box !important;
    }
    .main-nav .nav-link:last-child { border-bottom: none !important; }
    .logo-link { margin-right: 7px; }
    .main-footer { min-height: 50px; padding: 25px 0; }
}
/* Móviles normales */
@media (max-width: 600px) {
    .header-bar, .header-content { min-height: 38px; padding-left: 5px; padding-right: 5px; }
    .logo-meta18 { height: 50px !important; width: auto !important; min-width: 16px; max-width: 130px; padding-top: 0 !important; padding-bottom: 0 !important; }
    .menu-toggle { height: 1.7rem !important; width: 1.7rem !important; padding-right: 35px !important; }
    .header-content { min-height: 32px; }
    .main-footer { min-height: 45px; padding: 20px 0; }
    .footer-socials { gap: 12px; margin: 10px 0;}
    .footer-socials img { width: 18px; height: 18px;}
    .footer-link { font-size: 0.93rem; margin: 0 3px;}
    .copyright { font-size: 0.8em; margin-top: 6px;}
    .nav-link, .main-nav .nav-link {
        font-size: 0.97rem !important;
        padding: 10px 0 10px 13px !important;
    }
    .main-nav .nav-link {
        border-bottom-width: 1px !important;
        line-height: 1.1;
    }
}
/* Móviles pequeños (tipo SE, <=400px) */
@media (max-width: 400px) {
    .header-bar, .header-content { min-height: 24px; padding-left: 2px; padding-right: 2px; }
    .logo-meta18 { height: 50px !important; width: auto !important; min-width: 8px; max-width: 120px; padding-top: 0 !important; padding-bottom: 0 !important; }
    .menu-toggle { height: 1.13rem !important; width: 1.13rem !important; padding-right: 35px !important; }
    .main-footer { min-height: 40px; padding: 15px 0; }
    .footer-link { font-size: 0.85rem; margin: 0 1px;}
    .copyright { font-size: 0.7em; margin-top: 2px;}
    .nav-link, .main-nav .nav-link {
        font-size: 0.85rem !important;
        padding: 8px 0 8px 10px !important;
    }
}
/* Móviles muy chicos */
@media (max-width: 370px) {
    .header-bar, .header-content { min-height: 16px; padding-left: 1px; padding-right: 1px; }
    .logo-meta18 { height: 30px !important; width: auto !important; min-width: 4px; max-width: 200px; padding-top: 0 !important; padding-bottom: 0 !important; }
    .menu-toggle { height: 0.89rem !important; width: 0.89rem !important; padding-right: 35px !important; }
    .main-footer { min-height: 60px; padding: 10px 0;}
    .footer-link { font-size: 0.74rem; margin: 0 1px;}
    .copyright { font-size: 0.65em; margin-top: 0;}
    .nav-link, .main-nav .nav-link {
        font-size: 0.75rem !important;
        padding: 5px 0 5px 7px !important;
    }
}

/* ======================= ANIMACIONES ======================= */
@keyframes navDropDown {
    from { opacity: 0; transform: translateY(-8px);}
    to   { opacity: 1; transform: none;}
}
@keyframes dropDownMenu {
    from { opacity: 0; transform: translateY(-12px);}
    to   { opacity: 1; transform: none;}
}

/* Pequeño fix por si se repite reglas por z-index */
@media (max-width: 850px) {
    .main-nav.mostrar {
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* ======================= ZOOM (DEJA ESTO INTACTO) ======================= */
body.zoom-page .main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}
body.zoom-page .main-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
}
body.zoom-page .central-content {
    margin-top: 120px;
    margin-bottom: 148px;
}
@media (max-width: 600px) {
    body.zoom-page .central-content {
        margin-top: 60px;
        margin-bottom: 100px;
        min-height: calc(100vh - 60px - 100px);
    }
}

.header-bar.nav-disabled .nav-link,
.header-bar.nav-disabled .nav-login,
.header-bar.nav-disabled .nav-register,
.header-bar.nav-disabled .nav-logout {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    text-decoration: none !important;
}

@media (max-width: 850px) {
  .main-nav.mostrar {
    position: fixed !important;
    top: 56px; /* o ajusta según tu header */
    left: 0;
    width: 100vw !important;
    background: #042bec;
    z-index: 3000 !important;
    box-shadow: 0 8px 24px #1458a622;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 0 0 10px 0;
    display: flex !important;
    flex-direction: column !important;
    max-height: 95vh;
    overflow-y: auto;
    animation: navDropDown 0.19s;
  }
  /* Botón hamburguesa SIEMPRE encima del panel */
  .menu-toggle {
    z-index: 3010 !important;
    position: relative !important;
  }
  /* Todas las promos debajo del menú */
  .promo-container, .promo-images, .promo-image, .promo-image.middle {
    z-index: 0 !important;
    position: static !important;
  }
}

