/* ========================================================================== */
/* CUSTOM MEGA MENU - SINGLE DOM                                              */
/* ========================================================================== */

.cmm,
.cmm * {
    box-sizing: border-box;
}

.cmm {
    position: relative;
    z-index: 50;
}

.cmm ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
}

.cmm a {
    text-decoration: none;
}

/* ========================================================================== */
/* DESKTOP                                                                    */
/* ========================================================================== */

@media (min-width: 992px) {

    .cmm-root {
        display: flex;
        align-items: center;
        justify-content: space-between;
        column-gap: 1rem;
        row-gap: 0.2rem;
    }

    .cmm-root-item {
        position: static;
    }

    .cmm-item-row {
        position: relative;
    }

    .cmm-root-link {
        display: block;
        padding: 0.9rem 1rem;
        color: #fff;
        text-transform: uppercase;
    }

    .cmm-root-link:hover,
    .cmm-root-link:focus {
        color: #c8c8c8;
    }

    .cmm-submenu-toggle,
    .cmm-submenu-header {
        display: none !important;
    }

    .cmm-root-item > .cmm-mega {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 60;
        background: #fff;
        border-radius: 0 0 30px 30px;
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(10px);
        transition: opacity 0.22s ease, transform 0.28s cubic-bezier(.22, .61, .36, 1), visibility 0s linear 0.22s;
    }

    .cmm-root-item > .cmm-item-row:hover + .cmm-mega,
    .cmm-root-item > .cmm-item-row:focus-within + .cmm-mega,
    .cmm-root-item > .cmm-mega:hover {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition:
            opacity 0.25s ease 0.18s,
            transform 0.32s cubic-bezier(.22, .61, .36, 1) 0.18s,
            visibility 0s linear 0.18s;
    }

    .cmm-mega-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        width: 100%;
        max-width: 1320px;
        margin: 0 auto;
        padding: 2rem;
    }

    .cmm-mega-inner.has-featured {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .cmm-columns {
        min-width: 0;
    }

    .cmm-mega .cmm-level-1 {
        display: grid;
        grid-template-columns: repeat(var(--cmm-columns, 4), minmax(0, 1fr));
        column-gap: 0.8rem;
        row-gap: 0rem;
        align-content: start;
    }

    .cmm-mega .cmm-level-1 > .cmm-item {
        min-width: 0;
    }

    .cmm-mega .cmm-level-1 > .cmm-item > .cmm-item-row > .cmm-link {
        display: block;
        margin-bottom: 0.55rem;
        font-weight: 600;
        line-height: 1.2;
    }

    /*Masquer Niveau 2 du mega menu*/
    /* .cmm .cmm-submenu[data-depth="2"], 
    .cmm .cmm-submenu[data-depth="3"], 
    .cmm .cmm-submenu[data-depth="4"] {
        display: none !important;
    } */
    /*Masquer Niveau 2 du mega menu*/

    .cmm-item.cmm-root-item:not(.has-children) {
        display: flex;
        align-items: center;
    }

    #cmm-submenu-category-1053{
        display: none !important;
    }

    .cmm-item.cmm-root-item .cmm-link.cmm-root-link:last-child {
        color: #000000;
        padding: 4px 13px;
        background: #ffffff;
        border-radius: 20px;
    }

    .cmm-mega .cmm-level-1 > .cmm-item > .cmm-submenu,
    .cmm-mega .cmm-level-2 .cmm-submenu,
    .cmm-mega .cmm-level-3 .cmm-submenu,
    .cmm-mega .cmm-level-4 .cmm-submenu {
        position: static;
        display: block;
        width: auto;
        height: auto;
        overflow: visible;
        opacity: 1;
        visibility: inherit;
        pointer-events: inherit;
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .cmm-mega .cmm-submenu-scroll {
        overflow: visible;
    }

    .cmm-mega .cmm-level-2,
    .cmm-mega .cmm-level-3,
    .cmm-mega .cmm-level-4 {
        display: grid;
        gap: 0.5rem;
    }

    .cmm-mega .cmm-level-2 .cmm-link,
    .cmm-mega .cmm-level-3 .cmm-link,
    .cmm-mega .cmm-level-4 .cmm-link {
        display: block;
        line-height: 1.2;
    }

    .cmm-featured {
        min-width: 0;
        border-left: 1px solid #e7e7e7;
        padding-left: 1.5rem;
    }

    .cmm-featured-kicker {
        margin-bottom: 0.65rem;
        font-size: 1.1rem;
        font-weight: 200;
        letter-spacing: 0;
        text-transform: uppercase;
    }

    .cmm-featured-link {
        display: grid;
        gap: 0.65rem;
    }

    .cmm-featured-img {
        background-color: #f2f2f2;
        border-radius: 10px;
        padding: 15px;
    }
    .cmm-featured img {
        display: block;
        mix-blend-mode: multiply;
        border-radius: 10px;
        width: 100%;
        height: auto;
    }

    .cmm-featured-name {
        line-height: 1.2;
        font-weight: 400;
        font-size: 15px;
        display: block;
    }

    .cmm-featured-price {
        font-weight: 700;
    }
}

/* ========================================================================== */
/* MOBILE                                                                     */
/* ========================================================================== */

html.cmm-submenu-open,
html.cmm-submenu-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

@media (max-width: 991.98px) {

    #mobile_top_menu_wrapper .modal-body  {
        padding-top: 0;
    }

    #mobile_top_menu_wrapper .logo {
    max-width: 200px;
    height: auto;
    height: 34px;
    }

    #_mobile_top_menu .cmm,
    #_desktop_top_menu .cmm {
        width: 100%;
        min-height: 100%;
        background: #000000;
    }

    .cmm-root,
    .cmm-level {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: #000000;
    }

    .cmm-item {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .cmm-item-row {
        display: flex;
        align-items: stretch;
        width: 100%;
        border-bottom: 1px solid #3e3e3e;
        background: #000000;
    }

    .cmm-link {
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        padding: 12px 15px;
        color: #ffffff;
        font-size: 15px;
        line-height: 1.25;
        text-align: left;
    }

    .cmm-root-link {
        color: #ffffff;
        text-transform: none;
    }

    .cmm-link:hover,
    .cmm-link:focus {
        color: #e4e4e4;
        text-decoration: none;
    }
    .cmm-level-0 li.cmm-item .cmm-root-link .cmm-link-label {
        font-size: 18px;
    }
    .cmm-link-label {
        min-width: 0;
    }

    .cmm-submenu-toggle {
        flex: 0 0 54px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 54px;
        min-height: 54px;
        padding: 0;
        border: 0;
        /* border-left: 1px solid #f2f2f2; */
        background: #000000;
        color: #ffffff;
        font-size: 21px;
        cursor: pointer;
    }

    .cmm-submenu-toggle:hover,
    .cmm-submenu-toggle:focus {
        background: #000000;
    }

    .cmm-submenu {
        position: fixed !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 100% !important;
        z-index: 100000;
        display: block !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
        background: #000000 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: hidden;
        pointer-events: none;
        transform: none !important;
        transition: left 0.28s ease-in-out, visibility 0s linear 0.28s !important;
    }

    .cmm-submenu.is-open {
        left: 0 !important;
        visibility: visible;
        pointer-events: auto;
        transition: left 0.28s ease-in-out, visibility 0s linear 0s !important;
    }

    .cmm-submenu-header {
        position: relative;
        z-index: 5;
        display: flex;
        align-items: center;
        width: 100%;
        height: 58px;
        min-height: 58px;
        padding: 0 15px;
        background: #ebebeb;
        color: #000000;
        border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    }

    .cmm-submenu-back {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #000000;
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
    }

    .cmm-submenu-back i {
        font-size: 14px;
    }

    .cmm-submenu-title {
        min-width: 0;
        flex: 1 1 auto;
        margin-left: 14px;
        padding-right: 10px;
        overflow: hidden;
        color: #000000;
        font-size: 18px;
        font-weight: 600;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cmm-submenu-title:hover,
    .cmm-submenu-title:focus {
        color: #000000;
        text-decoration: none;
    }

    .cmm-submenu-scroll {
        width: 100%;
        height: calc(100vh - 58px);
        height: calc(100dvh - 58px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #000000;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .cmm-mega-inner,
    .cmm-mega-inner.has-featured,
    .cmm-columns {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .cmm-mega .cmm-level-1,
    .cmm-level .cmm-level {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .cmm-featured {
        margin: 20px 15px 10px;
        padding: 18px 0 0;
        /* border-top: 1px solid #e7e7e7; */
        border-left: 0;
    }

    .cmm-featured-kicker {
        margin-bottom: 10px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: white;
        font-size: 1rem;
        font-weight: 700;
    }

    .cmm-featured-link {
        display: flex;
        background-color: white;
        border-radius: 10px;
        column-gap: 10px;
        align-items: center;
        row-gap: 6px;
    }

    .cmm-featured img {
        grid-row: 1 / span 2;
        display: block;
        width: 90px;
        border-radius: 10px;
        height: auto;
    }

    .cmm-featured-name {
        align-self: end;
        font-weight: 400;
        line-height: 1.2;
        display: block;
    }

    .cmm-featured-price {
        align-self: start;
        font-weight: 600;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmm-mega,
    .cmm-submenu {
        transition: none !important;
    }
}
