/* ===================================================================
   HEADER FUNDESI — Versión unificada con degradado institucional
   Archivo: css/header.css
   ===================================================================
   Contenido:
   0. Wrapper del header con fondo crema/degradado
   1. Configuración del header (vidrio, no sticky)
   2. Estado scrolled
   3. Navbar general (header más fino)
   4. Logo
   5. Enlaces del menú
   6. Botón DONAR
   7. Submenús + animación hover
   8. Menú responsive
   9. Separador tricolor bajo el header
   =================================================================== */


/* ============================================================
   0) WRAPPER DEL HEADER (FONDO SUAVE INSTITUCIONAL)
   - Usa el mismo degradado que la sección "Qué hacemos" y footer
   ============================================================ */

.site-header-wrapper {
    position: relative;
    z-index: 2000;

    /* Degradado verde–rojo muy suave, tipo crema metalizado */
    background: linear-gradient(
        135deg,
        rgba(15, 138, 59, 0.16),
        rgba(227, 49, 45, 0.14)
    );

    border-bottom: 1px solid rgba(148, 163, 184, 0.40);
}

/* Evitar sticky si algún CSS global toca el header */
header {
    position: relative !important;
    top: auto !important;
    z-index: 2000;
}


/* ============================================================
   1) NAVBAR PRINCIPAL (EFECTO VIDRIO, NO STICKY)
   ============================================================ */

.site-header {
    /* NO fijo, NO sticky */
    position: relative !important;
    top: auto !important;

    /* Fondo vidrio blanco suave encima del degradado */
    background: rgba(255, 255, 255, 0.68);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);

    /* Efecto vidrio (blur del fondo) */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    z-index: 9999;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}


/* ============================================================
   2) HEADER CUANDO SE HACE SCROLL
   (se activa con body.header-scrolled desde footer.php)
   ============================================================ */

body.header-scrolled .site-header {
    background: linear-gradient(to bottom, #ffffff, #f7f7f7);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}


/* ============================================================
   3) NAVBAR — HEADER MÁS FINO
   ============================================================ */

.navbar {
    font-size: 0.95rem;
    min-height: auto !important;
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10000;
}

.navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
    margin-right: 1rem;
    display: flex;
    align-items: center;
}


/* ============================================================
   4) LOGO FUNDESI
   ============================================================ */

.logo-fundesi {
    max-height: 82px;
    width: auto;
    object-fit: contain;
    display: block;

    margin-top: 5px;
    margin-bottom: 5px;
}

@media (max-width: 575.98px) {
    .logo-fundesi {
        max-height: 82px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
}


/* ============================================================
   5) ENLACES DEL MENÚ PRINCIPAL
   ============================================================ */

.nav-link {
    color: var(--fundesi-gray) !important;
    font-weight: 500;
    padding: 0.35rem 1rem !important;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--fundesi-red) !important;
}


/* ============================================================
   6) BOTÓN DONAR — SIEMPRE ROJO
   ============================================================ */

.btn-donar {
    background-color: #E3312D !important;
    color: #ffffff !important;
    border: 1px solid #E3312D !important;
    border-radius: 999px !important;
    padding: 0.45rem 1.3rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

header .navbar .btn.btn-donar {
    background-color: #E3312D !important;
    color: #ffffff !important;
    border-color: #E3312D !important;
}

header .navbar .btn.btn-donar:hover,
header .navbar .btn.btn-donar:focus {
    background-color: #bf1f24 !important;
    border-color: #bf1f24 !important;
    color: #ffffff !important;
}


/* ============================================================
   7) SUBMENÚS (DROPDOWN) + ANIMACIÓN
   ============================================================ */

.dropdown-menu {
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 0.75rem;
    padding: 0.5rem 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
    position: absolute;
    z-index: 11000;
}

.dropdown-item {
    color: var(--fundesi-gray);
    padding: 0.55rem 1.2rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: rgba(227, 49, 45, 0.10);
    color: var(--fundesi-red);
}

/* ============================================================
   7.1) SPLIT DROPDOWN (Solo para "Quiénes somos")
   - Texto: navega a la página interna
   - Flecha: abre el submenú
   ============================================================ */

.navbar .nav-item.dropdown.nav-split {
    display: flex;
    align-items: center;
}

/* Mantiene el mismo padding general del nav-link, pero evita separación rara */
.navbar .nav-item.dropdown.nav-split > a.nav-link:first-child {
    padding-right: 0.35rem !important;
}

/* Flecha: más compacta, pero clicable */
.navbar .nav-item.dropdown.nav-split > a.dropdown-toggle-split {
    padding-left: 0.15rem !important;
    padding-right: 1rem !important;
}

/* Ajuste fino del caret */
.navbar .nav-item.dropdown.nav-split > a.dropdown-toggle-split::after {
    margin-left: 0.15rem;
}

/* Evita que al hacer hover el color cambie solo en uno de los dos */
@media (min-width: 992px) {
    .navbar .nav-item.dropdown.nav-split:hover > a.nav-link {
        color: var(--fundesi-red) !important;
    }
}

/* Hover animado en escritorio */
@media (min-width: 992px) {

    .navbar .nav-item.dropdown .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s linear 0.18s;
        z-index: 11000;
    }

    .navbar .nav-item.dropdown:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s linear 0s;
    }

    .navbar .nav-item.dropdown:hover > .nav-link {
        color: var(--fundesi-red) !important;
    }
}


/* ============================================================
   8) MENÚ RESPONSIVE (MÓVIL)
   ============================================================ */

.navbar-toggler {
    border: none;
}

.navbar-toggler-icon {
    filter: brightness(0.15);
}

@media (max-width: 991.98px) {
    .dropdown-menu {
        border-radius: 0.5rem;
        padding-left: 1rem;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        z-index: 11000;
    }

    /* En móvil, split se comporta bien dentro del collapse */
    .navbar .nav-item.dropdown.nav-split {
        display: block;
    }

    .navbar .nav-item.dropdown.nav-split > a.dropdown-toggle-split {
        display: inline-block;
        padding-left: 0.25rem !important;
    }
}


/* ============================================================
   9) SEPARADOR TRICOLOR BAJO EL HEADER
   ============================================================ */

.header-separator {
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--fundesi-green),
        var(--fundesi-yellow),
        var(--fundesi-red)
    );
}



/* Split "Quiénes somos": evita salto de línea y quita estilo de botón */
.nav-split-wrap { 
    white-space: nowrap; 
}

.nav-split-wrap .dropdown-toggle-split{
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0.15rem !important;
    padding-right: 1rem !important;
    line-height: 1 !important;
}
