/**
 * FNTI – Navigation (barre header + menu desktop / tiroir mobile)
 */

:root {
    --fnti-nav-gold: #c9a962;
    --fnti-nav-gold-light: #e8d5a3;
    --fnti-nav-ink: #0c1118;
    --fnti-nav-ink-soft: #151d28;
    --fnti-nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Barre header ─── */
.site-header .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-toolbar__shop,
.header-toolbar__account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 98, 0.35);
    color: inherit;
    background: rgba(201, 169, 98, 0.06);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.header-toolbar__shop:hover,
.header-toolbar__account:hover {
    background: rgba(201, 169, 98, 0.16);
    border-color: rgba(201, 169, 98, 0.6);
    color: var(--fnti-nav-gold);
}

.fnti-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.fnti-nav-toggle:hover {
    background: rgba(201, 169, 98, 0.12);
    border-color: rgba(201, 169, 98, 0.45);
    color: var(--fnti-nav-gold);
}

.fnti-nav-toggle__icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 18px;
    height: 14px;
}

.fnti-nav-toggle__bar {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

body.fnti-nav-open .fnti-nav-toggle__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.fnti-nav-open .fnti-nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

body.fnti-nav-open .fnti-nav-toggle__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ─── Backdrop (mobile / tablette) ─── */
.fnti-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(8, 12, 18, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.fnti-nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Panneau : tiroir latéral (mobile) ─── */
.fnti-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    width: min(420px, 100vw);
    visibility: hidden;
    pointer-events: none;
}

.fnti-nav-panel.is-open {
    visibility: visible;
    pointer-events: auto;
}

.fnti-nav-panel__inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 32px;
    background: linear-gradient(165deg, var(--fnti-nav-ink) 0%, var(--fnti-nav-ink-soft) 100%);
    color: #fff;
    border-left: 1px solid rgba(201, 169, 98, 0.2);
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.45s var(--fnti-nav-ease);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.fnti-nav-panel.is-open .fnti-nav-panel__inner {
    transform: translateX(0);
}

.fnti-nav-panel__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--fnti-nav-gold) 0%, rgba(201, 169, 98, 0.15) 100%);
    pointer-events: none;
}

.fnti-nav-panel__header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fnti-nav-panel__brand {
    min-width: 0;
}

.fnti-nav-panel__eyebrow {
    display: block;
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--fnti-nav-gold);
}

.fnti-nav-panel__title {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.2;
}

.fnti-nav-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.fnti-nav-panel__close:hover {
    background: rgba(201, 169, 98, 0.15);
    border-color: rgba(201, 169, 98, 0.45);
    color: var(--fnti-nav-gold);
    transform: rotate(90deg);
}

/* ─── Liste de navigation (tiroir) ─── */
.fnti-nav-panel__nav .menu-primary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fnti-nav-panel__nav .menu-primary > li {
    border: none;
}

.fnti-nav-panel__nav .menu-primary > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    text-transform: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.fnti-nav-panel__nav .menu-primary > li > a::after {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.35;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fnti-nav-panel__nav .menu-primary > li > a:hover,
.fnti-nav-panel__nav .menu-primary > .current-menu-item > a,
.fnti-nav-panel__nav .menu-primary > .current-menu-ancestor > a {
    color: var(--fnti-nav-gold-light);
    background: rgba(201, 169, 98, 0.1);
    border-color: rgba(201, 169, 98, 0.2);
    transform: translateX(4px);
}

.fnti-nav-panel__nav .menu-primary > li > a:hover::after,
.fnti-nav-panel__nav .menu-primary > .current-menu-item > a::after {
    opacity: 0.85;
    transform: rotate(45deg) translate(2px, -2px);
}

.fnti-nav-panel.is-open .menu-primary > li > a {
    animation: fntiNavItemIn 0.45s var(--fnti-nav-ease) backwards;
}

.fnti-nav-panel.is-open .menu-primary > li:nth-child(1) > a { animation-delay: 0.04s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(2) > a { animation-delay: 0.07s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(3) > a { animation-delay: 0.10s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(4) > a { animation-delay: 0.13s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(5) > a { animation-delay: 0.16s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(6) > a { animation-delay: 0.19s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(7) > a { animation-delay: 0.22s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(8) > a { animation-delay: 0.25s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(9) > a { animation-delay: 0.28s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(10) > a { animation-delay: 0.31s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(11) > a { animation-delay: 0.34s; }
.fnti-nav-panel.is-open .menu-primary > li:nth-child(12) > a { animation-delay: 0.37s; }

@keyframes fntiNavItemIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fnti-nav-panel__nav .sub-menu {
    margin: 4px 0 8px;
    padding: 4px 0 4px 16px;
    list-style: none;
    border-left: 2px solid rgba(201, 169, 98, 0.3);
}

.fnti-nav-panel__nav .sub-menu a {
    display: block;
    padding: 10px 12px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.3s ease, background 0.3s ease;
}

.fnti-nav-panel__nav .sub-menu a:hover {
    color: var(--fnti-nav-gold-light);
    background: rgba(255, 255, 255, 0.04);
}

/* ─── Pied du panneau (mobile) ─── */
.fnti-nav-panel__footer {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fnti-nav-panel__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fnti-nav-ink);
    background: linear-gradient(135deg, var(--fnti-nav-gold) 0%, #d4b56e 100%);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(201, 169, 98, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.fnti-nav-panel__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(201, 169, 98, 0.35);
    filter: brightness(1.05);
    color: var(--fnti-nav-ink);
}

.fnti-nav-panel__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.3s ease;
}

.fnti-nav-panel__link:hover {
    color: var(--fnti-nav-gold);
}

.fnti-nav-panel__phone {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--fnti-nav-gold);
    text-transform: none;
}

body.fnti-nav-open {
    overflow: hidden;
}

/* ─── Desktop : navigation horizontale dans le header ─── */
@media (min-width: 1100px) {
    .fnti-nav-backdrop {
        display: none;
    }

    .fnti-nav-toggle {
        display: none;
    }

    .fnti-nav-panel {
        position: static;
        flex: 1;
        min-width: 0;
        width: auto;
        visibility: visible;
        pointer-events: auto;
    }

    .fnti-nav-panel__inner {
        position: static;
        height: auto;
        padding: 0;
        background: transparent;
        color: inherit;
        border: none;
        box-shadow: none;
        transform: none;
        overflow: visible;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .fnti-nav-panel__inner::before {
        display: none;
    }

    .fnti-nav-panel__header,
    .fnti-nav-panel__footer {
        display: none;
    }

    .fnti-nav-panel__nav {
        width: 100%;
    }

    .fnti-nav-panel__nav .menu-primary {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 2px 0;
    }

    .fnti-nav-panel__nav .menu-primary > li > a {
        padding: 8px 11px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.78);
        border-radius: 6px;
        white-space: nowrap;
    }

    .fnti-nav-panel__nav .menu-primary > li > a::after {
        display: none;
    }

    .fnti-nav-panel__nav .menu-primary > li > a:hover,
    .fnti-nav-panel__nav .menu-primary > .current-menu-item > a,
    .fnti-nav-panel__nav .menu-primary > .current-menu-ancestor > a {
        color: var(--fnti-nav-gold);
        background: rgba(201, 169, 98, 0.12);
        border-color: transparent;
        transform: none;
        box-shadow: inset 0 -2px 0 var(--fnti-nav-gold);
    }

    .fnti-nav-panel.is-open .menu-primary > li > a {
        animation: none;
    }

    .fnti-nav-panel__nav .sub-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        min-width: 220px;
        margin: 0;
        padding: 8px;
        background: var(--fnti-nav-ink);
        border: 1px solid rgba(201, 169, 98, 0.2);
        border-left: none;
        border-radius: 8px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
        z-index: 20;
    }

    .fnti-nav-panel__nav .menu-primary > li {
        position: relative;
    }

    .fnti-nav-panel__nav .menu-primary > li:hover > .sub-menu,
    .fnti-nav-panel__nav .menu-primary > li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    body.fnti-nav-open {
        overflow: auto;
    }
}

@media (min-width: 1280px) {
    .fnti-nav-panel__nav .menu-primary > li > a {
        padding: 8px 13px;
        font-size: 11.5px;
    }
}

/* ─── Mobile : libellés compacts ─── */
@media (max-width: 520px) {
    .header-toolbar__account-label,
    .header-toolbar__shop-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-toolbar__account {
        padding: 0;
        width: 44px;
    }

    .header-toolbar__shop {
        padding: 0;
        width: 44px;
    }

    .fnti-nav-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .fnti-nav-toggle {
        padding: 0;
        width: 44px;
    }

    .fnti-nav-panel__inner {
        padding: 20px 20px 28px;
    }
}

/* ─── Intégration thème premium ─── */
.fnti-premium .header-toolbar__shop,
.fnti-premium .header-toolbar__account {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(201, 169, 98, 0.35);
}

.fnti-premium .header-toolbar__shop:hover,
.fnti-premium .header-toolbar__account:hover {
    color: var(--fnti-nav-gold);
}

.fnti-premium .fnti-nav-toggle {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.18);
}

.fnti-premium .fnti-nav-toggle:hover {
    border-color: rgba(201, 169, 98, 0.5);
    color: var(--fnti-nav-gold);
}

.fnti-premium:not(.fnti-home-premium) .site-header {
    background: rgba(12, 17, 24, 0.98);
    border-bottom: 1px solid rgba(201, 169, 98, 0.12);
}

.fnti-home-premium .header-toolbar__shop,
.fnti-home-premium .header-toolbar__account,
.fnti-home-premium .fnti-nav-toggle {
    color: rgba(255, 255, 255, 0.92);
}

.fnti-home-premium .site-header.scrolled .header-toolbar__shop,
.fnti-home-premium .site-header.scrolled .header-toolbar__account,
.fnti-home-premium .site-header.scrolled .fnti-nav-toggle,
.fnti-home-premium .site-header.fnti-hp-header-solid .header-toolbar__shop,
.fnti-home-premium .site-header.fnti-hp-header-solid .header-toolbar__account,
.fnti-home-premium .site-header.fnti-hp-header-solid .fnti-nav-toggle {
    color: rgba(255, 255, 255, 0.92);
}

@media (min-width: 1100px) {
    .fnti-home-premium .fnti-nav-panel__nav .menu-primary > li > a {
        color: rgba(255, 255, 255, 0.82);
    }

    .fnti-home-premium .fnti-nav-panel__nav .menu-primary > li > a:hover,
    .fnti-home-premium .fnti-nav-panel__nav .menu-primary > .current-menu-item > a {
        color: var(--fnti-nav-gold-light);
    }
}

/* Pages internes : liens nav sombres sur fond clair si header blanc */
.fnti-premium:not(.fnti-home-premium):not(.page-congres):not(.page-inscription-congres) .fnti-nav-panel__nav .menu-primary > li > a {
    color: rgba(255, 255, 255, 0.82);
}
