body {
    padding-top: 0;
}

/* ============================================
   HEADER ANFECA - VERSIÓN MEJORADA
   ============================================ */

/* Contenedor principal - ESTO AFECTA A TODO, lo vamos a anular para el header-top */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header completo - FIJADO */
.anfeca-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
}

/* ============================================
   PRIMERA CINTILLA - LOGO PEGADO A LA IZQUIERDA
   ============================================ */

.header-top {
    background-image: url('/ANFECA/img/cintilla/4.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 7px 0;
    width: 100%;
}

/* ANULAMOS COMPLETAMENTE EL PADDING DEL CONTAINER */
.header-top .container {
    padding: 0 !important;        /* ¡Quita todo el padding! */
    max-width: 100%;              /* Ocupa todo el ancho disponible */
    margin: 0;                    /* Sin márgenes */
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-left: 0;              /* Aseguramos que no haya padding */
}

/* Para que el botón no se pegue a la derecha, le damos un margin-right */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 24px;           /* Este margen da el espacio del lado derecho */
}

/* ============================================
   ESTRUCTURA: LOGOS | SIGLAS + NOMBRE COMPLETO
   ============================================ */

.logo-integrado {
    display: flex;
    align-items: center;
    gap: 0;                       /* Quitamos el gap para controlar mejor */
}

/* Logos a la izquierda */
.logo-anfeca,
.logo-aniversario {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* Línea vertical roja - MÁS GRUESA (3px) */
.separador-vertical {
    width: 3px;                   /* Aumentado de 2px a 3px */
    height: 45px;
    background-color: #cd0000;
    margin: 0 20px;               /* Espaciado alrededor de la línea */
}

/* Contenedor de texto */
.texto-anfeca {
    display: flex;
    flex-direction: column;
}

/* Siglas ANFECA - TAMAÑO AJUSTADO */
.siglas {
    font-size: 20px;              /* Reducido de 36px a 24px */
    font-weight: 800;
    color: #cd0000;
    line-height: 1.2;
    margin: 0;
    letter-spacing: 1px;
}

/* Nombre completo en dos líneas */
.nombre-completo {
    font-size: 13px;              /* Un poco más pequeño para mejor proporción */
    color: #4a5568;
    margin: 2px 0 0 0;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;    /* Mayúsculas para darle formalidad */
    max-width: 380px;
}

/* ============================================
   BOTÓN INICIO - OPCIÓN 1: ROJO CON BORDE BLANCO
   ============================================ */
.btn-inicio-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: #cd0000;     /* Rojo institucional */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid white;        /* Borde blanco que resalta */
}

.btn-inicio-header i {
    font-size: 20px;
}

.btn-inicio-header:hover {
    background-color: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: #f0f0f0;
}

/* Botón hamburguesa - SOLO EN MÓVIL */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #cd0000;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   SEGUNDA CINTILLA - MENÚ CENTRADO (CON PADDING ORIGINAL)
   ============================================ */

.header-bottom {
    background-color: #cd0000;
    padding: 0;
    height: 45px;
}

/* Restauramos el padding original para el menú */
.header-bottom .container {
    padding: 0 24px !important;    /* Mantiene el padding original */
    max-width: 1200px;
    margin: 0 auto;
}

/* Navegación principal */
.main-nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    gap: 1px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    height: 45px;
    line-height: 45px;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Icono dropdown */
.dropdown-icon {
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.has-submenu.submenu-open .dropdown-icon {
    transform: rotate(180deg);
}

/* ============================================
   SUBMENÚS
   ============================================ */

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: auto;
    min-width: max-content;
    max-width: 350px;
    background-color: white;
    list-style: none;
    margin: 0;
    padding: 12px 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border-top: 3px solid #cd0000;
}

.has-submenu:hover .submenu,
.has-submenu.submenu-open .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-submenu .submenu {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cd0000 #f0f0f0;
}

.has-submenu .submenu::-webkit-scrollbar {
    width: 8px;
}

.has-submenu .submenu::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.has-submenu .submenu::-webkit-scrollbar-thumb {
    background-color: #cd0000;
    border-radius: 4px;
}

.has-submenu .submenu::-webkit-scrollbar-thumb:hover {
    background-color: #a00000;
}

.submenu a {
    display: block;
    padding: 12px 24px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    padding-right: 32px;
    width: 100%;
    box-sizing: border-box;
}

.submenu a:hover {
    color: #cd0000;
    background-color: rgba(205, 0, 0, 0.03);
}

/* ============================================
   LINKS DE LOGOS INDIVIDUALES - SOLO EFECTO EN IMÁGENES
   ============================================ */

/* Links de logos - sin efecto en texto porque no hay texto aquí */
.logo-anfeca-link,
.logo-aniversario-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;           /* Elimina espacio extra debajo de las imágenes */
}

/* Efecto hover SOLO en las imágenes - ESCALA */
.logo-anfeca-link:hover .logo-anfeca,
.logo-aniversario-link:hover .logo-aniversario {
    transform: scale(1.08);   /* La imagen crece un 8% */
    transition: transform 0.3s ease;
}

/* Transición suave para las imágenes */
.logo-anfeca,
.logo-aniversario {
    transition: transform 0.3s ease;
    display: block;           /* Evita espacios extra */
}

/* El texto NO tiene ningún efecto */
.texto-anfeca {
    display: flex;
    flex-direction: column;
    pointer-events: none;      /* El texto no es clickeable */
}

/* La línea vertical tampoco tiene efecto */
.separador-vertical {
    pointer-events: none;      /* La línea no es clickeable */
}

/* ============================================
   MENÚ MÓVIL - SIN CAMBIOS (IGUAL QUE ANTES)
   ============================================ */

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1099;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.menu-open::before {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden !important;
}

/* ============================================
   VERSIÓN MÓVIL - HEADER MÁS ALTO
   ============================================ */

@media (max-width: 992px) {
    /* HEADER MÁS ALTO */
    .header-top {
        padding: 12px 0;              /* Aumentado de 7px a 12px */
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .header-bottom {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100vh;
        background: #cd0000;
        z-index: 1100;
        padding: 0;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
    }
    
    .header-bottom.active {
        left: 0;
    }
    
    .main-nav {
        display: block;
        height: 100%;
        position: relative;
        padding: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }
    
    .nav-link {
        padding: 18px 24px;
        height: auto;
        line-height: normal;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        justify-content: space-between;
        min-height: 56px;
        font-size: 16px;
    }
    
    .submenu {
        position: static;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        background: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
        padding: 0;
        margin: 0;
        max-height: 0 !important;
        overflow-y: hidden !important;
    }
    
    .has-submenu.submenu-open .submenu {
        max-height: 300px !important;
        overflow-y: auto !important;
        padding: 8px 0;
        position: relative;
    }

    .nav-item.has-submenu:nth-child(2).submenu-open .submenu::after {
        display: block;
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
        padding: 15px 20px;
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.2));
        position: sticky;
        bottom: 0;
        width: 100%;
        letter-spacing: 1px;
        font-weight: 500;
        border-top: 1px dashed rgba(255, 255, 255, 0.3);
        animation: bounce 1.5s infinite;
    }

    @keyframes bounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(5px); }
    }

    .has-submenu.submenu-open .submenu {
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.5) rgba(0,0,0,0.2);
    }

    .has-submenu.submenu-open .submenu::-webkit-scrollbar {
        width: 5px;
    }

    .has-submenu.submenu-open .submenu::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.2);
    }

    .has-submenu.submenu-open .submenu::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 20px;
    }
    
    .submenu a {
        color: rgba(255, 255, 255, 0.9);
        padding: 14px 24px 14px 40px;
        min-height: 48px;
        font-size: 15px;
        white-space: normal;
        line-height: 1.4;
        width: 100%;
        box-sizing: border-box;
    }
    
    .submenu a:hover {
        color: white;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-close-btn {
        position: relative !important;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        width: 100% !important;
        height: 70px !important;
        padding: 0 24px !important;
        margin: 0 0 10px 0 !important;
        background: transparent !important;
        border: none !important;
        color: white !important;
        font-size: 28px !important;
        cursor: pointer !important;
        z-index: 1101 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    }

    .mobile-close-btn svg {
        width: 32px;
        height: 32px;
    }
    
    .mobile-close-btn:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        transform: none;
    }
    
    .header-bottom.active .mobile-close-btn {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-btn.active {
        display: none !important;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        background-color: #cd0000;
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
        background-color: #cd0000;
    }
    
    /* ============================================
       VERSIÓN MÓVIL DE LOGOS Y TEXTO - MÁS GRANDES
       ============================================ */
       
    .logo-anfeca,
    .logo-aniversario {
        width: 52px !important;       /* Aumentado de 44px a 52px */
        height: 52px !important;
    }
    
    /* Línea vertical en móvil - más alta también */
    .separador-vertical {
        width: 3px !important;
        height: 42px;                 /* Aumentado de 35px a 42px */
        margin: 0 15px;               /* Un poco más de espacio */
    }
    
    .siglas {
        font-size: 24px;               /* Aumentado de 20px a 24px */
    }
    
    /* OCULTAR NOMBRE COMPLETO EN MÓVIL */
    .nombre-completo {
        display: none !important;
    }
    
    /* BOTÓN INICIO - MÁS GRANDE EN MÓVIL */
    .btn-inicio-header {
        width: 48px !important;        /* Aumentado de 44px a 48px */
        height: 48px !important;
        background-color: #cd0000 !important;
        color: white !important;
        border: 2px solid white !important;
    }
    
    .btn-inicio-header i {
        font-size: 24px !important;    /* Aumentado de 22px a 24px */
    }
    
    /* Botón hamburguesa - más grande */
    .mobile-menu-btn {
        width: 48px !important;
        height: 48px !important;
    }
    
    .mobile-menu-btn span {
        width: 28px;                   /* Un poco más ancho */
        height: 4px;                   /* Un poco más grueso */
    }
    
    .header-actions {
        gap: 15px;                     /* Más espacio entre botones */
        margin-right: 0;
    }
    
    .header-bottom.active {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ajuste para hover en móvil (opcional, no es necesario pero lo dejamos) */
    .logo-anfeca-link:hover .logo-anfeca,
    .logo-aniversario-link:hover .logo-aniversario {
        transform: scale(1.08);
    }
}

/* ============================================
   PANTALLAS MUY PEQUEÑAS (< 576px)
   ============================================ */

@media (max-width: 576px) {
    .header-top {
        padding: 10px 0;              /* Un poco menos que en 992px pero más que antes */
    }
    
    .logo-anfeca,
    .logo-aniversario {
        width: 48px !important;       /* Aumentado de 40px a 48px */
        height: 48px !important;
    }
    
    .separador-vertical {
        width: 3px !important;
        height: 38px;                 /* Aumentado de 30px a 38px */
        margin: 0 10px;
    }
    
    .siglas {
        font-size: 22px;              /* Aumentado de 18px a 22px */
    }
    
    .btn-inicio-header {
        width: 44px !important;       /* Un poco más pequeño que en 992px */
        height: 44px !important;
    }
    
    .btn-inicio-header i {
        font-size: 22px !important;
    }
    
    .mobile-menu-btn {
        width: 44px !important;
        height: 44px !important;
    }
    
    .mobile-close-btn {
        top: 15px !important;
        left: 15px !important;
        width: 44px;
        height: 44px;
        font-size: 24px !important;
    }
    
    .nav-link {
        padding: 16px 20px;
        min-height: 52px;
        font-size: 15px;
    }
    
    .submenu a {
        padding: 13px 20px 13px 36px;
        font-size: 14px;
    }
}

/* ============================================
   ESCRITORIO (> 992px)
   ============================================ */

@media (min-width: 993px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .header-bottom {
        display: block !important;
        position: relative !important;
        height: 45px !important;
        left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .mobile-close-btn {
        display: none !important;
    }
    
    .submenu {
        max-width: 350px;
    }
    
    .nav-item.has-submenu:nth-child(3) .submenu {
        max-width: 400px;
    }
    
    body.menu-open::before {
        display: none !important;
    }
}

/* ============================================
   PANTALLAS GRANDES (> 1200px)
   ============================================ */

@media (min-width: 1200px) {
    .submenu {
        max-width: 400px;
    }
    
    .nav-item.has-submenu:nth-child(3) .submenu {
        max-width: 450px;
    }
}