/* Menu mobile */

@media (max-width: 991px) {
    body {
        &:has(.menu.open) {
            overflow: hidden;
            /* max-height: 100vh;

            main.dis_none,
            footer.dis_none {
                display: none !important;
            } */
        }
    }

    .header {
        &:not(.home) {
            background: var(--white) !important;
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(5px);

            .logo_alt {
                display: block !important;
            }

            .logo {
                display: none !important;
            }
        }

        .header__main {
            &:not(:has(.menu.open)) {
                padding: 10px 15px !important;

                .menu-cta {
                    display: none !important;
                }
            }

            &:has(.menu.open) {
                .header__logo {
                    align-self: start;
                    position: fixed;
                    top: 20px;
                    left: 25px;

                    .logo_alt {
                        display: none !important;
                    }

                    .logo {
                        display: block !important;
                    }

                    img {
                        z-index: 2;
                        position: relative;
                    }

                    &:after {
                        content: '';
                        opacity: 1;
                        background: var(--dark-blue);
                        width: 110vw;
                        height: 100px;
                        position: absolute;
                        top: -35px;
                        left: -35px;
                        z-index: 1;
                        transform: translateX(0);
                        pointer-events: none;
                    }
                }

                .menu_mobile {
                    position: fixed !important;
                    right: 0;
                    top: 22px;
                    z-index: 9999999999;
                    width: 50px;
                    height: 50px;
                    pointer-events: all;

                    .menu__toggle {
                        opacity: 0;
                    }

                    &:before,
                    &:after {
                        content: '';
                        position: absolute;
                        top: 25px;
                        left: 0;
                        display: inline-block;
                        width: 35px;
                        height: 3px;
                        background: var(--light-blue);
                        z-index: 99999999999999999999999999999999;
                        border-radius: var(--border-radius);
                        pointer-events: all;
                    }

                    &:before {
                        transform: rotate(45deg);
                    }

                    &:after {
                        transform: rotate(-45deg);
                    }
                }
            }

            .menu {
                flex-direction: column;
                left: 0;
                padding-bottom: 24px;
                position: fixed;
                overflow: auto;
                transition: transform 0.3s ease;
                width: 100%;
                z-index: 9;
                top: 0;
                transform: translateX(100%);

                &.open {
                    display: flex;
                    width: 100vw;
                    height: 100vh;
                    padding-bottom: 0px;
                    transform: translateX(0px);

                    &:has(>.menu__main>li.sub-menu-open) {
                        background: var(--dark-blue);

                        .menu__main {
                            justify-content: flex-start;
                        }
                    }
                }

                .menu__main {
                    background: var(--dark-blue);
                    margin: 0;
                    padding: 150px 12px 60px 12px;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    min-height: 100vh;
                    overflow-x: hidden;
                    overflow-y: scroll;

                    li {
                        list-style: none;
                        position: relative;
                        z-index: 1;

                        &:before,
                        &:marker {
                            display: none;
                        }

                        &>a {
                            img {
                                display: none;
                            }
                        }
                    }

                    &>.menu-item {
                        transition: var(--transition);

                        &:not(:last-child) {
                            margin-bottom: 20px;
                        }

                        &.menu-item-has-children {
                            scroll-margin-top: 120px;

                            &>a {
                                display: flex;
                                justify-content: space-between;
                                align-items: center;

                                &:after {
                                    content: '';
                                    background-image: url(../img/triangle.svg);
                                    width: 12px;
                                    height: 12px;
                                    display: inline-block;
                                    background-size: cover;
                                    background-repeat: no-repeat;
                                    transform: rotate(90deg);
                                    transition: var(--transition);
                                }

                                span {
                                    margin-right: 20px;
                                }
                            }

                            &.sub-menu-open {
                                border: 0px;
                                margin-bottom: 0 !important;

                                &>.sub-menu {
                                    max-height: unset;
                                    opacity: 1;
                                    transform: translateY(0px);
                                    padding: 20px 0 20px 0;
                                    margin: 15px 0;
                                    border-bottom: 1px solid var(--light-blue);
                                    position: relative;
                                    overflow: visible;

                                    &:after {
                                        content: '';
                                        background: var(--light-blue);
                                        width: 130vw;
                                        height: 101%;
                                        position: absolute;
                                        top: 0;
                                        left: -60px;
                                        z-index: 0;
                                    }

                                    &>li {
                                        &:not(:last-child) {
                                            border-bottom: 1px solid var(--dark-blue);
                                            padding-bottom: 15px;
                                            margin-bottom: 15px;
                                        }

                                        &.none_responsive {
                                            &>a {
                                                display: none;
                                            }
                                        }

                                        &>a {
                                            display: flex;
                                            flex-direction: column;

                                            span {
                                                color: var(--white);

                                                &:not(.desc) {
                                                    font-weight: var(--bold);
                                                    padding-bottom: 10px;
                                                }
                                            }
                                        }
                                    }
                                }

                                &>a {
                                    &:after {
                                        transform: rotate(-90deg);
                                    }
                                }
                            }
                        }

                        &>a {
                            color: var(--white);
                            font-size: 24px;
                            font-weight: var(--bold);

                            span {
                                color: var(--white);
                            }
                        }

                        &>.sub-menu {
                            max-height: 0;
                            opacity: 0;
                            transition: transform 0.3s ease, opacity 0.3s ease;
                            transform: translateY(30px);
                            overflow: hidden;

                            &>.menu-item {

                                &.img_left,
                                &.img_right {
                                    display: none;
                                }

                                &>.sub-menu {
                                    padding: 0;

                                    &>.menu-item {
                                        &:first-child {
                                            padding-top: 10px;
                                        }

                                        &:not(:last-child) {
                                            padding-bottom: 10px;
                                        }

                                        &>a {
                                            span {
                                                color: var(--white);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .menu__toggle {
                display: block;
                cursor: pointer;
                width: 50px;
                height: 50px;
            }
        }
    }
}

/* Menu */

.header {
    position: fixed;
    transition: var(--transition);
    z-index: 1000;
    width: 100%;

    &.home,
    &.single-reference,
    &.single-api {
        &.scrolling {
            .menu__main {
                .menu-item {
                    &>a {
                        &:after {
                            @media (min-width: 992px) {
                                filter: brightness(0) saturate(100%) invert(6%) sepia(59%) saturate(4889%) hue-rotate(202deg) brightness(94%) contrast(106%) !important;
                            }
                        }
                    }
                }
            }
        }
    }

    &:not(.home, .single-reference, .single-api) {
        .menu__main {
            .menu-item {
                &>a {
                    &:after {
                        @media (min-width: 992px) {
                            filter: brightness(0) saturate(100%) invert(6%) sepia(59%) saturate(4889%) hue-rotate(202deg) brightness(94%) contrast(106%) !important;
                        }
                    }
                }
            }
        }
    }

    &.single {
        &:not(.single-post) {
            &:not(.scrolling) {
                .header__main {
                    .menu__main {

                        &>a,
                        &>a>span {
                            color: var(--white) !important;
                        }
                    }
                }
            }
        }
    }

    &.home,
    &.single-reference,
    &.single-api {
        &:not(.scrolling) {
            .header__logo {
                .logo_alt {
                    display: none;
                }
            }
        }

        &.scrolling {
            .header__logo {
                .logo {
                    display: none;
                }
            }
        }
    }

    &:not(.home, .single-reference, .single-api) {
        .header__logo {
            .logo {
                display: none;
            }
        }
    }

    &.scrolling {
        background: var(--white) !important;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(5px);

        @media (min-width: 992px) {
            .header__main {
                padding: 8px 0 !important;
            }
        }

        .menu {
            border: 0px !important;
            background: transparent !important;
            backdrop-filter: none !important;

            .menu__main {
                &>.menu-item {
                    &>.sub-menu {
                        top: 67px !important;
                        border-radius: 0 0 16px 16px !important;
                    }
                }

                .menu-item {

                    &>a,
                    &>span {
                        &:not(:hover) {
                            color: var(--dark-blue) !important;
                        }
                    }
                }
            }
        }
    }

    @media (min-width: 992px) {

        &:not(.home, .single-reference, .single-api) {
            .menu {
                .menu__main {
                    li:not(.img_left, .img_right) {

                        a,
                        a span {
                            &:not(:hover) {
                                color: var(--dark-blue);
                            }
                        }
                    }
                }
            }
        }
    }

    .header__main {
        align-items: center;
        display: flex;
        justify-content: space-between;
        transition: all 0.3s;
        width: 100%;

        @media (min-width: 992px) {
            padding: 24px 0px;
        }

        &.container {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .header__logo {
                align-self: center;
                display: block;
                position: relative;
                min-width: 192px;
                min-height: 48px;
                z-index: 9999;

                &:after {
                    opacity: 0;
                    transition: var(--transition);
                    transform: translateX(100%);
                }

                img {
                    transition: all 0.3s;
                }

                @media (min-width: 992px) {
                    &:hover {
                        img {
                            opacity: 0.7;
                        }
                    }
                }
            }

            .cta {
                &:before {
                    background-image: url('../img/contact_expert.svg') !important;
                }
            }
        }

        @media (min-width: 992px) {
            .menu {
                flex-direction: row;
                overflow: visible;
                gap: 24px;
                margin-top: 0;
                padding: 0 16px;
                height: 48px;
                display: flex;
                position: static;
                background: rgba(255, 255, 255, 0.08);
                border-radius: var(--border-radius-cta);
                backdrop-filter: blur(4px);
                border: 1px solid rgba(255, 255, 255, 0.16);

                &.open i {
                    transform: rotate(180deg);
                }

                &.open .sub-menu {
                    border-color: var(--light-blue);
                    max-height: 500px;
                }

                .menu__main {
                    position: static;
                    display: flex;
                    margin: 0;
                    padding: 0;
                    align-items: center;
                    order: -1;
                    overflow: visible;

                    li {
                        list-style: none;

                        &.current-menu-item,
                        &.current-page-parent {

                            &>a,
                            &>a>span {
                                color: var(--light-blue) !important;
                            }
                        }
                    }

                    &>li {
                        &:before {
                            display: none;
                        }
                    }

                    &>.menu-item {
                        overflow: hidden;
                        height: fit-content;
                        padding: 30px 0;
                        width: auto;
                        position: unset;

                        &:hover {
                            overflow: visible;

                            .sub-menu {
                                opacity: 1;
                                max-height: unset;
                                visibility: visible;
                            }

                            &>a,
                            &>span {
                                color: var(--light-blue);

                                &:after {
                                    transform: rotate(180deg);
                                }
                            }
                        }

                        &>a,
                        &>span {
                            padding: 16px;
                            align-items: center;
                            transition: all 0.3s;
                            color: #fff;
                            font-family: var(--main-font);
                            font-size: 16px;
                            line-height: 16px;
                            font-weight: var(--bold);
                        }

                        &.menu-item-has-children {
                            &.pourquoi {
                                .sub-menu {
                                    &>li {
                                        &.img_left {
                                            grid-row: span 3;
                                        }
                                    }
                                }
                            }

                            &.objectifs {
                                &>.sub-menu {
                                    &:has(>.img_left) {
                                        @media (min-width: 992px) {
                                            grid-template-columns: 170px repeat(2, minmax(auto, 220px));
                                        }

                                        @media (min-width: 1200px) {
                                            grid-template-columns: 240px repeat(2, minmax(auto, 280px));
                                        }
                                    }

                                    &>li {
                                        &.secteurs {
                                            max-width: 150px;
                                            grid-column: 4;
                                            grid-row: 1 / span 2;
                                            border-left: 1px solid var(--dark-grey);
                                            padding-left: 25px;

                                            &>.sub-menu {
                                                display: flex;
                                                flex-direction: column;
                                                gap: 5px;

                                                &>li {
                                                    padding: 0 0 5px 0;
                                                    margin-bottom: 0;
                                                    width: 100%;

                                                    &:hover {
                                                        &>a {
                                                            color: var(--light-blue) !important;

                                                            span {
                                                                color: var(--light-blue) !important;
                                                            }
                                                        }
                                                    }

                                                    &>a {
                                                        color: var(--dark-blue);
                                                        max-height: 20px;
                                                        display: flex;
                                                        gap: 10px;
                                                        align-items: center;

                                                        img {
                                                            width: 25px;
                                                            filter: brightness(0) saturate(100%) invert(97%) sepia(4%) saturate(351%) hue-rotate(159deg) brightness(90%) contrast(96%);
                                                        }

                                                        &>span {
                                                            color: var(--dark-blue);
                                                        }
                                                    }
                                                }
                                            }
                                        }

                                        &.img_left {
                                            grid-row: span 3;

                                            @media (min-width: 992px) {
                                                width: 220px;
                                            }

                                            @media (min-width: 1200px) {
                                                width: 290px;
                                            }
                                        }
                                    }
                                }
                            }

                            &>a {
                                display: flex;
                                justify-content: space-between;
                                align-items: center;
                                position: relative;

                                &:after {
                                    content: '';
                                    background-image: url(../img/chevron_down.svg);
                                    width: 12px;
                                    height: 12px;
                                    display: inline-block;
                                    background-size: cover;
                                    background-repeat: no-repeat;
                                    transition: var(--transition);
                                    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(268deg) brightness(103%) contrast(101%);
                                    margin-left: 5px;
                                }
                            }
                        }

                        /**********************A supprimer **********************/

                        &>.sub-menu {
                            visibility: hidden;
                            max-height: 0;
                            opacity: 0;
                            margin: 0;
                            padding: 0;
                            position: absolute;
                            overflow: hidden;
                            background-color: var(--white);
                            top: 100%;
                            display: grid;
                            padding: 32px 48px;
                            grid-template-columns: repeat(2, minmax(auto, 328px));
                            width: max-content;
                            border-radius: var(--border-radius);
                            box-shadow: 0px 30px 30px 0px rgba(0, 0, 0, 0.16);
                            left: 46%;
                            transform: translateX(-50%);

                            @media (min-width: 992px) {
                                gap: 47px 30px;
                            }

                            @media (min-width: 1200px) {
                                gap: 30px;
                            }

                            &:has(>.img_left) {
                                @media (min-width: 992px) {
                                    grid-template-columns: 230px repeat(2, minmax(auto, 250px));
                                }

                                @media (min-width: 1200px) {
                                    grid-template-columns: 270px repeat(2, minmax(auto, 328px));
                                }
                            }

                            &:has(>.img_right) {
                                @media (min-width: 992px) {
                                    grid-template-columns: repeat(2, minmax(auto, 250px)) 230px;
                                }

                                @media (min-width: 1200px) {
                                    grid-template-columns: repeat(2, minmax(auto, 328px)) 270px;
                                }
                            }

                            &.four_col {
                                grid-template-columns: repeat(4, minmax(auto, 190px));

                                &:has(>.img_left, >.img_right) {
                                    @media (min-width: 992px) {
                                        grid-template-columns: 230px repeat(3, minmax(auto, 160px));
                                    }

                                    @media (min-width: 1200px) {
                                        grid-template-columns: 200px repeat(4, minmax(auto, 190px));
                                    }

                                    @media (min-width: 1400px) {
                                        grid-template-columns: 270px repeat(4, minmax(auto, 190px));
                                    }
                                }
                            }

                            &>.menu-item {
                                min-height: 50px;

                                &:not(:has(>.sub-menu)) {
                                    &:hover {
                                        a {
                                            color: var(--light-blue) !important;

                                            span {
                                                color: var(--light-blue) !important;
                                            }
                                        }
                                    }
                                }

                                &>a {
                                    display: flex;
                                    flex-direction: column;
                                    gap: 12px;
                                    transition: var(--transition);

                                    &:has(+ .sub-menu) {
                                        span {
                                            &:not(.desc) {
                                                border-bottom: 1px solid var(--dark-grey);
                                                padding-bottom: 12px;
                                            }
                                        }
                                    }

                                    span {
                                        color: var(--dark-blue);
                                        transition: var(--transition);

                                        &:not(.desc) {
                                            font-weight: var(--bold);

                                            &:has(+ .desc) {
                                                border-bottom: 1px solid var(--dark-grey);
                                                padding-bottom: 12px;
                                            }
                                        }
                                    }

                                    img {
                                        width: 20px;
                                        height: 20px;
                                        object-fit: contain;
                                    }
                                }

                                &:has(>.sub-menu) {
                                    &>.sub-menu {
                                        padding: 12px 0 0 0;

                                        &>li {
                                            display: flex;
                                            align-items: center;
                                            transition: var(--transition);

                                            &:not(:last-child) {
                                                margin-bottom: 16px;
                                            }

                                            &>a {
                                                color: var(--dark-blue);
                                                transition: var(--transition);

                                                span {
                                                    color: var(--dark-blue);
                                                    transition: var(--transition);
                                                    height: 11px;
                                                }
                                            }

                                            &:hover {
                                                a {
                                                    color: var(--light-blue);

                                                    span {
                                                        color: var(--light-blue);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }

                                &.img_left {
                                    left: -50px;
                                    grid-row: span 2;
                                }

                                &.img_right {
                                    grid-row: 1 / 3;
                                    grid-column: 3;
                                }

                                &.img_left,
                                &.img_right {
                                    height: calc(100% + 68px);
                                    position: relative;
                                    top: -34px;
                                    width: 280px;
                                    background-repeat: no-repeat;
                                    background-size: cover;
                                    display: flex;
                                    align-items: end;
                                    padding: 40px;
                                    border: 0px;
                                    z-index: 1;
                                    background-position: center;
                                    pointer-events: none;

                                    @media (min-width: 1200px) {
                                        width: 250px;
                                    }

                                    @media (min-width: 1400px) {
                                        width: 320px;
                                    }

                                    &:after {
                                        content: '';
                                        background: linear-gradient(0deg, rgba(0, 20, 60, 1) 0%, rgba(0, 20, 60, 0) 100%);
                                        position: absolute;
                                        top: 0;
                                        left: 0;
                                        width: 100%;
                                        height: 100%;
                                        z-index: 0;
                                    }

                                    &>a {
                                        font-family: var(--title-font);
                                        color: var(--white);
                                        font-size: 36px;
                                        line-height: 44px;
                                        font-style: normal;
                                        z-index: 2;

                                        &>span {
                                            color: var(--white);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .menu_mobile,
            .menu__toggle {
                display: none;
            }
        }
    }
}

@media (min-width: 992px) {
    @keyframes fadeInFromTop {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

    .menu .menu__main>.menu-item:hover>.sub-menu {
        animation: fadeInFromTop 0.3s ease-out;
    }
}