/*
 * header_footer.css
 * Navbar (transparent → sticky), mobile slide-in, footer, go-to-top
 * BEM : header__, footer__, go-top
 */

/* ==========================================================================
   1. HEADER — Conteneur
   ========================================================================== */

.header {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--white);
}

/* ==========================================================================
   2. NAVBAR — Barre de navigation
   ========================================================================== */

.header__navbar {
    padding: var(--space-4) 0;
    transition: all var(--transition-base);
}

.header__navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-3);
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   3. BRAND — Logo + titre
   ========================================================================== */

.header__brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.header__brand-logo {
    height: 100px;
    width: auto;
    display: block;
}

.header__brand-text {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.4;
}

/* Brand blanc sur fond hero */
.header__navbar .header__brand-text {
    color: var(--gray-800);
    transition: color var(--transition-fast);
}

.header__brand-text--dark {
    color: var(--ocean-deep);
}

/* ==========================================================================
   4. NAVIGATION DESKTOP — Menu principal
   ========================================================================== */

.header__nav-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.header__nav-desktop .navbar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Style glass des liens de navigation */
.header__nav-desktop .nav-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 var(--space-3);
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: all var(--transition-fast);
}

/* ==========================================================================
   5. ACTIONS — Icônes droite + hamburger
   ========================================================================== */

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
    margin-left: auto;
}

.header__action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    text-decoration: none;
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: all var(--transition-fast);
}

.header__hamburger {
    display: none;
    cursor: pointer;
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    transition: all var(--transition-fast);
}

/* Hover unifié — éléments interactifs de la navbar */
.header__nav-desktop .nav-link:hover,
.header__action-link:hover,
.header__hamburger:hover {
    background: var(--ocean-mist);
    color: var(--ocean-primary);
}

/* ==========================================================================
   6. USER MENU — Dropdown utilisateur
   ========================================================================== */

.header__user-menu {
    position: relative;
}

.header__user-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.header__user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(
        135deg,
        var(--ocean-primary),
        var(--ocean-lighter)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.875rem;
    transition: box-shadow var(--transition-fast);
}

.header__user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + var(--space-2));
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 200;
}

.header__user-menu:hover .header__user-dropdown,
.header__user-dropdown:focus-within {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__user-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header__user-dropdown a,
.header__user-dropdown button {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    color: var(--gray-700);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.header__user-dropdown a:hover,
.header__user-dropdown button:hover {
    background: var(--ocean-mist);
    color: var(--ocean-primary);
}

/* ==========================================================================
   7. ÉTAT STICKY — Navbar fixée au scroll
   ========================================================================== */

.header__navbar--sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
    padding: var(--space-2) 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.header--transparent .header__navbar--sticky .header__brand-text {
    color: var(--gray-800);
}

.header__navbar--sticky .header__brand-logo {
    height: 55px;
}

/* Retirer le glass en sticky (fond blanc suffit) */
.header--transparent .header__navbar--sticky .header__nav-desktop .nav-link,
.header--transparent .header__navbar--sticky .header__action-link,
.header--transparent .header__navbar--sticky .header__hamburger {
    color: var(--gray-800);
}

.header__navbar--sticky .header__nav-desktop .nav-link:hover,
.header__navbar--sticky .header__action-link:hover,
.header__navbar--sticky .header__hamburger:hover {
    background: var(--ocean-mist);
    color: var(--ocean-primary);
}

.header__navbar--sticky .header__user-avatar {
    box-shadow: 0 0 0 2px var(--white);
}
.header--transparent {
    position: absolute;
    background: transparent;
    box-shadow: none;
}


/* ==========================================================================
   8. MOBILE — Overlay + Slide-in (hors du <header> dans le DOM)
   ========================================================================== */

/* Masqué en desktop */
.header__nav {
    display: none;
}

.header__nav-top {
    display: none;
}

.header__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    transition: all var(--transition-base);
}

.header__overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.footer {
    background: var(--ocean-deep);
    color: var(--white);
    margin-top: var(--space-8);
}

.footer__top {
    padding: var(--space-10) 0 var(--space-8);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: var(--space-8);
}

.footer__logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sand-primary);
    text-decoration: none;
    display: block;
    margin-bottom: var(--space-3);
}

.footer__logo:hover {
    color: var(--sand-light);
}

.footer__tagline {
    color: var(--gray-300);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.footer__social {
    display: flex;
    gap: var(--space-3);
}

.footer__social-link {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-fast);
}

.footer__social-link:hover {
    background: var(--sand-primary);
    color: var(--ocean-deep);
    transform: translateY(-2px);
}

.footer__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--white);
    margin-bottom: var(--space-4);
}

.footer__contact-list {
    list-style: none;
    margin: 0 0 var(--space-5) 0;
    padding: 0;
}

.footer__contact-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: 0.875rem;
    color: var(--gray-300);
}

.footer__contact-list a {
    color: var(--gray-300);
    text-decoration: none;
}

.footer__contact-list a:hover {
    color: var(--white);
}

.footer__contact-list address {
    font-style: normal;
}

.footer__contact-list svg {
    flex-shrink: 0;
    color: var(--gray-400);
}

.footer__newsletter-text {
    color: var(--gray-300);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
}

.footer__newsletter-form {
    display: flex;
    gap: var(--space-2);
}

.footer__newsletter-form input {
    flex: 1;
    padding: var(--space-2) var(--space-4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 0.875rem;
}

.footer__newsletter-form input::placeholder {
    color: var(--gray-400);
}

.footer__newsletter-form input:focus {
    outline: none;
    border-color: var(--ocean-primary);
    box-shadow: none;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-4) 0;
}

.footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.footer__bottom-inner p {
    color: var(--gray-400);
    margin: 0;
}

.footer__legal {
    display: flex;
    gap: var(--space-5);
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer__legal a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer__legal a:hover {
    color: var(--white);
}

/* ==========================================================================
   11. GO TO TOP
   ========================================================================== */

.go-top {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    width: 40px;
    height: 40px;
    background: var(--ocean-primary);
    color: var(--white);
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
    z-index: 90;
    text-decoration: none;
}

.go-top.active {
    opacity: 0.9;
    visibility: visible;
    transform: translateY(0);
}

.go-top:hover {
    opacity: 1;
    background: var(--ocean-deep);
    color: var(--white);
}

/* ==========================================================================
   12. RESPONSIVE — Tablette
   ========================================================================== */

@media (max-width: 1024px) {
    .header__brand-text {
        font-size: 1.2rem;
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer__col:first-child {
        grid-column: span 2;
    }
}

/* ==========================================================================
   13. RESPONSIVE — Mobile
   ========================================================================== */

@media (max-width: 768px) {
    /* Hamburger visible */
    .header__hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
    }

    /* Cibles tactiles min 44px */
    .header__action-link {
        width: 40px;
        height: 40px;
    }

    /* Masquer le menu desktop */
    .header__nav-desktop {
        display: none;
    }

    /* Masquer le texte du brand si logo présent */
    .header__brand-logo + .header__brand-text {
        display: none;
    }

    .header__action-link span {
        display: none;
    }

    /* --- Slide-in mobile --- */
    .header__nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 300px;
        height: 100%;
        background: var(--white);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        transform: translateX(100%);
        visibility: hidden;
        transition:
            transform var(--transition-base),
            visibility var(--transition-base);
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .header__nav.active {
        transform: translateX(0);
        visibility: visible;
    }

    .header__nav-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-5) var(--space-4);
        border-bottom: 1px solid var(--gray-200);
    }

    .header__nav-close {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--gray-600);
        padding: var(--space-2);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header__nav .navbar-nav {
        flex-direction: column;
        gap: 0;
        padding: var(--space-2) 0;
    }

    .header__nav .nav-link {
        display: block;
        width: 100%;
        padding: var(--space-4) var(--space-5);
        color: var(--gray-800);
        font-size: 1rem;
        font-weight: 600;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid var(--gray-100);
        border-radius: 0;
        text-decoration: none;
        transition: background var(--transition-fast);
        -webkit-box-decoration-break: slice;
        box-decoration-break: slice;
    }

    .header__nav .nav-link:hover {
        background: var(--ocean-mist);
        color: var(--ocean-primary);
    }

    /* --- Footer mobile --- */
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer__col:first-child {
        grid-column: unset;
    }

    .footer__bottom-inner {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .footer__legal {
        justify-content: center;
    }
}

/* ==========================================================================
   14. RESPONSIVE — Petit mobile
   ========================================================================== */

@media (max-width: 480px) {
    .header__actions {
        gap: var(--space-2);
    }
}
