/* NC Mega Menu — Responsive CSS v2.7.4 */

/* ------------------------------------------------------------------ */
/* Overlay                                                             */
/* ------------------------------------------------------------------ */
.ncmm-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.ncmm-nav.is-open .ncmm-overlay {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Sidebar — toujours fixed, cachée hors écran par défaut             */
/* ------------------------------------------------------------------ */
.ncmm-nav__list {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    background: #fff;
    z-index: 9999;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 72px 0 60px !important;
    margin: 0 !important;
    list-style: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 2px;
}
.ncmm-nav__list.is-open {
    transform: translateX(0) !important;
}

/* Animation d'apparition des sous-menus */
@keyframes ncmm-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------ */
/* Mobile uniquement                                                   */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {

    .ncmm-burger { display: flex; }

    .ncmm-nav__list {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
    }

    /* Items */
    .ncmm-nav__item {
        display: block;
        border-bottom: 1px solid #f0f0f0;
        list-style: none;
        position: static !important;
    }
    .ncmm-nav__item:last-child { border-bottom: none; }

    /* Lien principal */
    .ncmm-nav__link {
        display: flex; align-items: center; justify-content: space-between;
        padding: 15px 20px; font-size: 15px; font-weight: 500;
        color: #111827; text-decoration: none; border-radius: 0;
        width: 100%; box-sizing: border-box; background: none; white-space: normal;
    }

    /* ---- Dropdown ---- */
    .ncmm-dropdown {
        display: none;
        position: static !important; background: #f9fafb;
        border: none; border-top: 1px solid #f0f0f0;
        border-radius: 0; box-shadow: none;
        padding: 0; margin: 0; list-style: none;
    }
    .ncmm-nav__item.is-open > .ncmm-dropdown {
        display: block;
        animation: ncmm-fadein 0.2s ease;
    }
    .ncmm-dropdown__item { list-style: none; border-bottom: 1px solid #f0f0f0; }
    .ncmm-dropdown__item:last-child { border-bottom: none; }
    .ncmm-dropdown__item > a {
        display: block; padding: 13px 20px 13px 32px;
        font-size: 14px; color: #374151; text-decoration: none;
    }
    .ncmm-dropdown__wrap { list-style: none; padding: 0; margin: 0; }
    .ncmm-dropdown__sub {
        display: block; position: static;
        background: transparent; border: none; box-shadow: none;
        padding: 0; list-style: none;
    }
    .ncmm-dropdown__sub li { list-style: none; }
    .ncmm-dropdown__sub a {
        display: block; padding: 10px 20px 10px 44px;
        font-size: 13px; color: #6b7280; text-decoration: none;
    }

    /* ---- Mega ---- */
    .ncmm-mega {
        display: none;
        position: static !important;
        background: #f9fafb;
        border: none; border-top: 1px solid #f0f0f0;
        border-radius: 0; box-shadow: none;
    }
    .ncmm-nav__item.is-open > .ncmm-mega {
        display: block;
        animation: ncmm-fadein 0.2s ease;
    }
    .ncmm-mega__wrap { display: block; }
    .ncmm-mega__inner { display: block; padding: 0; }

    .ncmm-mega__col {
        padding: 0; border-right: none;
        border-bottom: 1px solid #ebebeb;
    }
    .ncmm-mega__col:last-child { border-bottom: none; }

    /* Titre colonne — accordéon */
    .ncmm-mega__col-title {
        display: flex; align-items: center; justify-content: space-between;
        padding: 15px 20px 15px 24px;
        font-size: 14px; font-weight: 600;
        color: #111827; text-decoration: none; text-transform: none; letter-spacing: 0;
        margin: 0; cursor: pointer; pointer-events: all;
    }
    .ncmm-mega__col-title::after {
        content: '';
        display: inline-block; width: 10px; height: 6px; flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        transition: transform 0.25s;
    }
    .ncmm-mega__col.is-open > .ncmm-mega__col-title::after { transform: rotate(180deg); }

    /* Contenu colonne */
    .ncmm-mega__col-content {
        display: none;
    }
    .ncmm-mega__col.is-open > .ncmm-mega__col-content {
        display: block;
        animation: ncmm-fadein 0.2s ease;
    }

    .ncmm-mega__group { margin: 0; }

    /* Titre groupe — accordéon */
    .ncmm-mega__group-title {
        display: flex; align-items: center; justify-content: space-between;
        padding: 13px 20px 13px 36px;
        font-size: 13px; font-weight: 600; color: #374151;
        text-decoration: none; border-top: 1px solid #f0f0f0;
        cursor: pointer; pointer-events: all;
    }
    .ncmm-mega__group-title::after {
        content: '';
        display: inline-block; width: 10px; height: 6px; flex-shrink: 0;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        transition: transform 0.25s;
    }
    .ncmm-mega__group.is-open > .ncmm-mega__group-title::after { transform: rotate(180deg); }

    /* Liens */
    .ncmm-mega__links {
        display: none;
        list-style: none; padding: 0; margin: 0;
    }
    .ncmm-mega__group.is-open > .ncmm-mega__links {
        display: block;
        animation: ncmm-fadein 0.2s ease;
    }
    .ncmm-mega__links li { list-style: none; border-top: 1px solid #f5f5f5; }
    .ncmm-mega__links a {
        display: block; padding: 11px 20px 11px 48px;
        font-size: 14px; color: #6b7280; text-decoration: none;
    }
    .ncmm-mega__links a::before { display: none; }
    .ncmm-mega__links a:hover { color: #111827; background: #f3f4f6; }

    /* Masquer sur mobile */
    .ncmm-hide-mobile { display: none !important; }
}

/* ------------------------------------------------------------------ */
/* Desktop — reset complet                                            */
/* ------------------------------------------------------------------ */
@media (min-width: 769px) {
    .ncmm-burger { display: none !important; }
    .ncmm-overlay { display: none !important; opacity: 0 !important; pointer-events: none !important; }
    .ncmm-nav__list {
        position: static !important;
        top: auto !important; right: auto !important; bottom: auto !important;
        width: auto !important; max-width: none !important; height: auto !important;
        overflow: visible !important; overflow-x: visible !important; overflow-y: visible !important;
        transform: none !important; transition: none !important;
        padding: 0 !important; margin: 0 !important;
        box-shadow: none !important; background: transparent !important;
        display: flex !important; flex-direction: row !important;
        align-items: center !important; gap: 2px !important;
    }
}
