.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;
}
.header-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-style: italic;
    font-size: 18px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    font-style: italic;
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
}

.header-nav a:hover {
    color: var(--primary);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.header-nav a:hover::after {
    width: 100%;
}

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

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--background);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    width: 220px;
}

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

.header-search i {
    color: var(--text-secondary);
    font-size: 14px;
}

.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;
}

.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-nav {
        gap: 20px;
    }

    .header-search {
        width: 180px;
    }
}

@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-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .header-mobile-top .logo-text {
        font-size: 16px;
        font-weight: 700;
        font-style: italic;
    }

    .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 .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);
        /* Permet à .header-mobile-nav__scroll (inline-flex) de se centrer
           quand les 5 liens tiennent dans la largeur, tout en gardant le
           scroll horizontal + alignement à gauche dès que ça déborde. */
        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) {
    .header-mobile-top .logo-text {
        display: none;
    }

    .nav-link-mobile {
        font-size: 13px;
        padding: 6px 8px;
    }
}