.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 32px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.icon-lucide {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.header-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 64px;
    min-width: 0;
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.15em;
    /* pour annuler le space après S */
    margin-right: -0.15em;
    color: var(--text-primary);
    line-height: 1;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    text-decoration: none;
    color: #4A4A4A;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.006em;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: #5e39c2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--background);
    padding: 10px 16px;
    border-radius: 24px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    flex: 1 1 auto;
    max-width: 420px;
}

.header-search:focus-within {
    border-color: var(--primary);
    background: white;
}

.header-search .icon-lucide {
    color: var(--text-secondary);
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
    width: 100%;
}

.header-search input::placeholder {
    color: var(--text-secondary);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: var(--background);
}

.icon-btn i {
    font-size: 18px;
}


.avatar-badge {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #F2F2EF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.avatar-badge:hover {
    background: #E9E9E5;
    transform: scale(1.06);
}

.profile-menu {
    position: relative;
    display: inline-block;
}

.profile-menu__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 226px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    overflow: hidden;
    padding: 6px;
}

.profile-menu--open .profile-menu__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.profile-menu__item:hover {
    background: var(--background);
}

.profile-menu__item .icon-lucide {
    width: 17px;
    height: 17px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.profile-menu__item--logout {
    color: var(--text-secondary);
}

.profile-menu__divider {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
}

.cart-counter {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 14px;
    height: 14px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    padding: 0 3px;
    border: 1.5px solid white;
    line-height: 1;
}

.btn-header {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-header:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

@media (max-width: 1024px) {
    .header {
        padding: 16px 20px;
        gap: 16px;
    }

    .header-left {
        gap: 40px;
    }

    .header-nav {
        gap: 20px;
    }

    .header-search {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .header-search {
        display: none;
    }

    .header {
        padding: 12px 16px;
    }
}


.header-mobile {
    display: none;
}


@media (max-width: 768px) {

    .header-desktop {
        display: none !important;
    }

    .header-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
    }


    .header {
        padding: 0;
        flex-direction: column;
        align-items: stretch;
    }


    .header-mobile-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: white;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);

        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header-mobile-top .header-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: inherit;
    }

    .header-mobile-top .logo-text {
        font-size: 20px;
    }

    .header-mobile-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header-mobile-actions .icon-btn {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        border-radius: 10px;
        color: var(--text-primary);
        font-size: 16px;
        cursor: pointer;
        transition: background 0.15s ease, transform 0.15s ease;
        text-decoration: none;
        position: relative;
    }

    .header-mobile-actions .icon-btn:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .header-mobile-actions .avatar-badge {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .header-mobile-actions .icon-btn:active {
        background: rgba(0, 0, 0, 0.1);
        transform: scale(0.92);
    }

    .header-mobile-actions .cart-counter {
        position: absolute;
        top: 2px;
        right: 2px;
        background: var(--primary);
        color: white;
        font-size: 10px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }



    .header-mobile-nav {
        position: relative;
        background: var(--background);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        text-align: center;
    }

    .header-mobile-nav__scroll {
        display: inline-flex;
        max-width: 100%;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .header-mobile-nav__scroll::-webkit-scrollbar {
        display: none;
    }

    .header-mobile-nav__fade {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 36px;
        background: linear-gradient(to right, rgba(250, 250, 247, 0), var(--background));
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .nav-link-mobile {
        display: block;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
        padding: 7px 14px;
        border-radius: 20px;
        transition: all 0.2s ease;
        white-space: nowrap;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .nav-link-mobile:active {
        background: rgba(0, 0, 0, 0.06);
    }

    .nav-link-mobile.is-active {
        color: var(--text-primary);
        font-weight: 700;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }



    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: white;
        z-index: 200;
        display: flex;
        align-items: center;
        padding: 0 12px;

        transform: translateY(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .mobile-search-overlay.is-open {
        transform: translateY(0);
    }

    .mobile-search-form {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    .mobile-search-close,
    .mobile-search-submit {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        border-radius: 10px;
        color: var(--text-primary);
        font-size: 16px;
        cursor: pointer;
        transition: background 0.2s ease;
        flex-shrink: 0;
    }

    .mobile-search-close:hover,
    .mobile-search-close:active,
    .mobile-search-submit:hover,
    .mobile-search-submit:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .mobile-search-submit {
        color: var(--primary);
    }

    .mobile-search-form input[type="text"] {
        flex: 1;
        height: 42px;
        padding: 0 14px;
        border: 1.5px solid var(--border);
        border-radius: 12px;
        font-size: 15px;
        color: var(--text-primary);
        background: var(--background);
        outline: none;
        transition: all 0.2s ease;
    }

    .mobile-search-form input[type="text"]:focus {
        border-color: var(--primary);
        background: white;
        box-shadow: 0 0 0 3px rgba(247, 127, 0, 0.1);
    }

    .mobile-search-form input[type="text"]::placeholder {
        color: var(--text-secondary);
        opacity: 0.6;
    }
}

@media (max-width: 360px) {
    .nav-link-mobile {
        font-size: 13px;
        padding: 6px 8px;
    }
}

/* ==========================================================================
   Menu hamburger mobile (remplace l'ancienne barre de nav en pastilles +
   les icônes profil/déconnexion séparées : tout est regroupé ici pour
   désencombrer le header sur petit écran)
   ========================================================================== */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 300;
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 84vw);
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 16px;
}

.mobile-menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
}

.mobile-menu-profile .avatar-badge {
    width: 44px;
    height: 44px;
    font-size: 16px;
    flex-shrink: 0;
}

.mobile-menu-profile__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-menu-profile__text strong {
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-profile__text span {
    font-size: 13px;
    color: var(--text-secondary);
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F2F2EF;
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu-signup {
    display: block;
    margin: 0 16px 4px;
    padding: 12px;
    text-align: center;
    background: var(--text-primary);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 16px 8px;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
    gap: 2px;
    overflow-y: auto;
}

.mobile-menu-links a {
    padding: 14px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.mobile-menu-links a:active {
    background: var(--background);
}

.mobile-menu-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.mobile-menu-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}