/**
 * FLAME & CO. — Header premium « floating island »
 */

/* ═══ SHELL FIXE ═══ */
.site-header {
    position: relative;
    z-index: 1040;
}

.nav-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1045;
    padding: max(1.125rem, env(safe-area-inset-top, 0px)) 1.25rem 0;
    pointer-events: none;
    transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-compact .nav-shell {
    padding: 0.5rem 1rem 0;
}

/* ═══ ÎLOT GLASS ═══ */
.nav-island {
    pointer-events: auto;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 0.875rem;
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.52);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition:
        background 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.5s ease,
        box-shadow 0.5s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-compact .nav-island {
    transform: scale(0.98);
}

/* État scrollé — fond clair */
.site-header.is-scrolled .nav-island {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ═══ LOGO ═══ */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
    transition: color 0.4s ease;
}

.site-header.is-scrolled .nav-brand {
    color: var(--flame-black);
}

.nav-brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-flame-ring {
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    background: conic-gradient(from 0deg, #E63946, #F77F00, #FFD60A, #E63946);
    animation: brandRingSpin 4s linear infinite;
    opacity: 0.85;
}

.brand-flame-ring::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    background: #0a0a0a;
    transition: background 0.4s ease;
}

.site-header.is-scrolled .brand-flame-ring::after {
    background: #fff;
}

.brand-flame-core {
    position: relative;
    z-index: 1;
    font-size: 1.15rem;
    background: linear-gradient(135deg, #F77F00, #FFD60A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(247, 127, 0, 0.5));
}

.nav-brand-logo {
    position: relative;
    z-index: 1;
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.nav-brand-logo--sm {
    height: 28px;
    max-width: 90px;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.nav-brand-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.nav-brand-wordmark .brand-main {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.06em;
}

.nav-brand-wordmark .brand-sub {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-top: 2px;
}

@keyframes brandRingSpin {
    to { transform: rotate(360deg); }
}

/* ═══ CATÉGORIES — SEGMENTED CONTROL ═══ */
.nav-categories {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.category-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header.is-scrolled .category-track {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}

.category-indicator {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    width: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #E63946 0%, #F77F00 100%);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
    pointer-events: none;
}

.category-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.site-header.is-scrolled .category-pill {
    color: var(--flame-gray-light);
}

.category-pill i {
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.category-pill:hover {
    color: #fff;
    transform: translateY(-1px);
}

.site-header.is-scrolled .category-pill:hover {
    color: var(--flame-black);
}

.category-pill.is-active {
    color: #fff !important;
}

.category-pill.is-active i {
    transform: scale(1.15);
}

.site-header.is-scrolled .category-pill.is-active {
    color: #fff !important;
}

/* ═══ ACTIONS ═══ */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Panier premium */
.btn-cart-premium {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.875rem 0.45rem 0.45rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-scrolled .btn-cart-premium {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--flame-dark);
}

.btn-cart-premium:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.site-header.is-scrolled .btn-cart-premium:hover {
    background: rgba(230, 57, 70, 0.08);
    color: var(--flame-red);
}

.cart-icon-ring {
    position: absolute;
    left: 0.45rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    background: linear-gradient(#0a0a0a, #0a0a0a) padding-box,
                linear-gradient(135deg, #E63946, #F77F00) border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-header.is-scrolled .cart-icon-ring {
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(135deg, #E63946, #F77F00) border-box;
}

.btn-cart-premium:hover .cart-icon-ring {
    opacity: 1;
    animation: cartRingPulse 1.5s ease infinite;
}

.cart-icon-inner {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.btn-cart-premium .cart-count {
    position: absolute;
    top: -2px;
    left: 32px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: linear-gradient(135deg, #E63946, #F77F00);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.5);
    z-index: 2;
}

.cart-label {
    font-size: 0.8125rem;
    font-weight: 600;
    padding-right: 0.25rem;
}

@keyframes cartRingPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.12); opacity: 1; }
}

/* CTA Commander */
.btn-nav-order {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.55rem 0.55rem 0.55rem 1.25rem;
    background: linear-gradient(135deg, #E63946 0%, #F77F00 55%, #FFD60A 100%);
    background-size: 200% 200%;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(230, 57, 70, 0.45);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease;
    animation: btnOrderGradient 4s ease infinite;
}

.btn-nav-order:hover {
    color: #fff;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 36px rgba(230, 57, 70, 0.55);
}

.btn-nav-order-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: btnOrderShine 3s ease infinite;
    pointer-events: none;
}

.btn-nav-order-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

@keyframes btnOrderGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes btnOrderShine {
    0%   { left: -100%; }
    50%, 100% { left: 150%; }
}

/* Burger mobile */
.nav-burger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-header.is-scrolled .nav-burger {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.nav-burger-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 18px;
}

.nav-burger-lines span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-scrolled .nav-burger-lines span {
    background: var(--flame-black);
}

.nav-burger.is-open .nav-burger-lines span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-burger.is-open .nav-burger-lines span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-burger.is-open .nav-burger-lines span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ═══ CATÉGORIES MOBILE ═══ */
.category-nav-mobile {
    position: fixed;
    top: var(--nav-shell-bottom, 88px);
    left: 0;
    right: 0;
    z-index: 1040;
    padding: 0.5rem 0;
    background: rgba(10, 10, 10, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: top 0.35s ease, background 0.4s ease;
}

.category-nav-mobile::before,
.category-nav-mobile::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5rem;
    z-index: 2;
    pointer-events: none;
}

.category-nav-mobile::before {
    left: 0;
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.85), transparent);
}

.category-nav-mobile::after {
    right: 0;
    background: linear-gradient(270deg, rgba(10, 10, 10, 0.85), transparent);
}

.site-header.is-scrolled .category-nav-mobile::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
}

.site-header.is-scrolled .category-nav-mobile::after {
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.95), transparent);
}

.site-header.is-scrolled .category-nav-mobile {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.category-nav-scroll {
    position: relative;
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 1rem;
}

.category-nav-scroll::-webkit-scrollbar { display: none; }

.category-nav-scroll .category-pill {
    scroll-snap-align: start;
    flex-shrink: 0;
    padding: 0.45rem 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header.is-scrolled .category-nav-scroll .category-pill {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--flame-gray-light);
}

.category-nav-scroll .category-pill.is-active {
    background: linear-gradient(135deg, #E63946, #F77F00);
    border-color: transparent;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
}

.category-indicator-mobile {
    display: none;
}

/* ═══ MENU MOBILE IMMERSIF ═══ */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
    visibility: hidden;
}

.mobile-menu.is-open {
    pointer-events: auto;
    visibility: visible;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.45s ease;
}

.mobile-menu.is-open .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 400px);
    height: 100%;
    background: linear-gradient(165deg, #0f0f0f 0%, #1a1a1a 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}

.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.mobile-menu-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-brand i {
    color: #F77F00;
}

.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(230, 57, 70, 0.2);
    border-color: rgba(230, 57, 70, 0.4);
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transform: translateX(30px);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.mobile-menu.is-open .mobile-menu-link {
    animation: mobileLinkIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--link-i) * 0.07s + 0.15s);
}

.mobile-menu-link:hover {
    background: rgba(247, 127, 0, 0.12);
    border-color: rgba(247, 127, 0, 0.25);
    color: #fff;
}

.mobile-menu-link-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(247, 127, 0, 0.2));
    border-radius: 12px;
    font-size: 1.25rem;
    color: #FCBF49;
}

.mobile-menu-link-text {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.04em;
}

.mobile-menu-link-arrow {
    opacity: 0.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-link:hover .mobile-menu-link-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.mobile-menu-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-note {
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1rem;
    margin-bottom: 0;
}

.mobile-menu-note i {
    color: #F77F00;
}

@keyframes mobileLinkIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Entrée header après loader */
.site-header.is-revealed .nav-island {
    animation: navIslandIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes navIslandIn {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header.is-compact.is-revealed .nav-island {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .brand-flame-ring,
    .btn-nav-order,
    .btn-nav-order-shine,
    .site-header.is-revealed .nav-island {
        animation: none !important;
    }

    .mobile-menu-link {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ═══ RESPONSIVE HEADER ═══ */
@media (max-width: 1199.98px) {
    .category-pill span {
        display: none;
    }

    .category-pill {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .nav-shell {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
        padding-top: max(0.625rem, env(safe-area-inset-top, 0px));
    }

    .nav-island {
        padding: 0.35rem 0.35rem 0.35rem 0.55rem;
        gap: 0.4rem;
    }

    .nav-actions {
        gap: 0.35rem;
    }

    .btn-cart-premium {
        padding: 0.35rem;
    }

    .btn-cart-premium .cart-icon-inner {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .btn-cart-premium .cart-count {
        left: 28px;
        min-width: 18px;
        height: 18px;
        font-size: 0.625rem;
    }

    .nav-burger {
        width: 40px;
        height: 40px;
    }

    .nav-brand-wordmark .brand-sub {
        display: none;
    }

    .nav-brand-wordmark .brand-main {
        font-size: 1.15rem;
    }

    .nav-brand-mark {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 380px) {
    .nav-brand-wordmark {
        display: none;
    }
}
