/* ============================================================
   PHONY — Menu mobile (drawer plein écran sous le header)
============================================================ */

@media (min-width: 1201px) {
    .mnav,
    .menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .menu-toggle {
        display: flex !important;
    }

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

    .site-chrome .header {
        position: relative;
        top: auto;
        min-height: 56px;
        padding-top: 10px;
        padding-bottom: 10px;
        overflow: visible;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .site-chrome .logo {
        overflow: visible !important;
        transform: none !important;
    }

    .site-chrome .logo-img {
        height: 44px !important;
        max-width: calc(100vw - 72px) !important;
    }

    /* Chrome site (bandeau + header) toujours visible au-dessus du menu */
    .site-chrome {
        position: sticky;
        top: 0;
        z-index: 2100;
        background: oklch(97% 0.01 260 / 0.98);
    }

    html.menu-open .site-chrome {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
    }

    html.menu-open,
    html.menu-open body {
        overflow: hidden !important;
        touch-action: none;
    }
}

/* --- Overlay --- */
.mnav {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    pointer-events: none;
}

.mnav.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mnav__backdrop {
    position: absolute;
    inset: 0;
    background: oklch(20% 0.01 260 / 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.mnav.is-open .mnav__backdrop {
    opacity: 1;
}

/* --- Panel --- */
.mnav__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--site-top, 120px);
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 32px oklch(20% 0.01 260 / 0.12);
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.mnav.is-open .mnav__panel {
    transform: translateY(0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .mnav__panel,
    .mnav__backdrop {
        transition: none;
    }
}

/* --- Liste scrollable --- */
.mnav__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px 0 8px;
}

.mnav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mnav__item {
    border-bottom: 1px solid oklch(95% 0.01 260);
}

.mnav__item:last-child {
    border-bottom: none;
}

.mnav__link,
.mnav__toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 10px 0;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-900, oklch(20% 0.01 260));
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background 0.15s ease;
}

.mnav__link:active,
.mnav__toggle:active {
    background: oklch(97% 0.02 260);
}

.mnav__link.is-active,
.mnav__toggle.is-active {
    color: var(--primary-blue, oklch(45% 0.19 260));
    font-weight: 600;
}

.mnav__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: oklch(96% 0.04 260);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue, oklch(45% 0.19 260));
    font-size: 15px;
}

.mnav__link.is-active .mnav__icon,
.mnav__toggle.is-active .mnav__icon {
    background: oklch(91% 0.08 260);
}

.mnav__label {
    flex: 1;
    min-width: 0;
}

.mnav__chevron {
    flex-shrink: 0;
    font-size: 12px;
    color: oklch(60% 0.01 260);
    transition: transform 0.2s ease;
}

.mnav__sub.is-open .mnav__chevron {
    transform: rotate(180deg);
}

/* Sous-menu Formation */
.mnav__sub-panel {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 54px;
    border-left: 3px solid oklch(91% 0.08 260);
    margin-left: 20px;
}

.mnav__sub-panel[hidden] {
    display: none;
}

.mnav__sublink {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700, oklch(45% 0.01 260));
    text-decoration: none;
}

.mnav__sublink.is-active {
    color: var(--primary-blue, oklch(45% 0.19 260));
    font-weight: 600;
}

.mnav__sublink .mnav__icon {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

/* --- Footer CTA --- */
.mnav__footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid oklch(93% 0.01 260);
    background: #fff;
    box-shadow: 0 -8px 24px oklch(20% 0.01 260 / 0.06);
}

.mnav__call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    background: var(--primary-blue, oklch(45% 0.19 260));
    color: #fff;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px oklch(45% 0.19 260 / 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}

.mnav__call:active {
    transform: scale(0.98);
    background: oklch(38% 0.20 260);
}

.mnav__call svg {
    flex-shrink: 0;
}

/* Hamburger au-dessus du menu */
.menu-toggle {
    position: relative;
    z-index: 2101;
}

html.menu-open .scroll-top {
    opacity: 0 !important;
    pointer-events: none !important;
}
