.MenuPrincipal {
    position: relative;
    padding: 0;
    margin: 0;
    list-style-type: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    @media (max-width: 992px) {
        padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--s);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
    }

    /* niveau 1 */

    > li {
        position: relative;
        margin-right: var(--wp--preset--spacing--l);
        @media (max-width: 1440px){
            margin-right: var(--wp--preset--spacing--m);
        }
        @media (max-width: 1200px) {
            margin-right: var(--wp--preset--spacing--s);
        }
        @media (max-width: 992px) {
            margin-right: var(--wp--preset--spacing--s);
        }
        @media (max-width: 992px) {
            margin-right: 0;
            width: 100%;
        }

        &:first-child {
            a {
                padding-top: 0;
            }
        }

        &:last-child {
            margin-right: 0;
            margin-left: auto;
            a{
                @media (min-width: 993px) {
                    background: var(--wp--preset--color--primary);
                    padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m);
                    border-radius: var(--wp--custom--radius--s);
                    border:1px solid currentcolor;
                    color: var(--wp--preset--color--white);
                    font-weight: 700;
                }
                @media (min-width: 993px) and (max-width: 1200px) {
                    padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--s);
                }
                &:hover, &:focus{
                    @media (min-width: 993px) {
                        background: var(--wp--preset--color--white);
                        color: var(--wp--preset--color--primary);
                        border-color: currentColor;
                    }
                }
                &::before{
                    display: none;
                }
            }
        }

        .sub-menu-toggle {
            display: none;
            @media (max-width: 992px) {
                position: absolute;
                top: 13px;
                right: 0;
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;
                border: 0;
                color: var(--wp--preset--color--white);
                font-size: var(--wp--preset--font-size--l);
                line-height: 0;
                background: var(--wp--preset--color--primary);
                width: var(--wp--preset--spacing--m);
                height: var(--wp--preset--spacing--m);
                border-radius: var(--wp--custom--radius--s);
            }
        }

        &.menu-item-has-children {
            @media (max-width: 992px) {
                display: block;
                position: relative;
            }

            > a {
                @media (max-width: 992px) {
                    display: flex;
                    flex-direction: row;
                    align-items: flex-start;
                    justify-content: flex-start;
                }

                &::after {
                    content: "";
                    display: inline-flex;
                    width: 17px;
                    height: 17px;
                    background-color: currentColor;
                    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
                    mask-repeat: no-repeat;
                    mask-position: center;
                    mask-size: contain;
                    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
                    -webkit-mask-repeat: no-repeat;
                    -webkit-mask-position: center;
                    -webkit-mask-size: contain;
                    margin-left: var(--wp--preset--spacing--xxs);
                    transition: transform 0.25s ease-out;

                    @media (min-width: 993px) {
                        vertical-align: middle;
                        margin-top: -2px; /* Ajustement fin pour le centrage optique si nécessaire */
                    }

                    @media (max-width: 992px) {
                        display: inline-block;
                        margin-left: auto;
                        width: 20px;
                        height: 20px;
                        align-self: center;
                    }
                }
            }

            @media (min-width: 993px) {
                &:hover {
                    > a::after {
                        transform: rotate(180deg);
                    }
                }
            }

            &.active {
                > a::after {
                    transform: rotate(180deg);
                }
            }
        }

        > a {
            padding-bottom: var(--wp--preset--spacing--m);
            color: var(--wp--preset--color--white);
            @media (max-width: 1200px) {
                font-size: 14px;
            }
            @media (max-width: 992px) {
                display: block;
                width: 100%;
                font-size: var(--wp--preset--font-size--xl);
                padding: var(--wp--preset--spacing--s) 0;
                color: var(--wp--preset--color--white);
                font-weight: 400;
                letter-spacing: 0.05em;
                border-bottom: 0.1rem solid var(--wp--preset--color--gray-tertiary);
                text-transform: none;
            }
            @media (max-width: 300px) {
                font-size: var(--wp--preset--font-size--m);
            }
        }

        .sub-menu {
            @media (min-width: 993px) {
                position: absolute;
                display: flex;
                opacity: 0;
                visibility: hidden;
                flex-direction: column;
                align-items: flex-start;
                justify-content: flex-start;
                top: var(--wp--preset--spacing--l);
                left: 0;
                border-radius: var(--wp--custom--radius--s);
                background: var(--wp--preset--color--quinary);
                box-shadow: 3px 8px 15px - 4px rgba(0, 0, 0, 0.2);
                padding: var(--wp--preset--spacing--m);
                min-width: 250px;
                z-index: 60;
                transition: visibility 0.35s, opacity 0.35s cubic-bezier(0.12, 0.09, 0.18, 0.93), transform 0.35s cubic-bezier(0.12, 0.09, 0.18, 0.93);
            }
            @media (max-width: 992px) {
                display: block;
                padding-left: 0;
                transition: height 0.35s cubic-bezier(0.370, 0.330, 0.185, 0.900);
                overflow: hidden;
                height: 0;
            }

            &:hover, &:focus {
                @media (min-width: 993px) {
                    opacity: 1;
                    visibility: visible;
                    /*transform: translateY(10px);*/
                }
            }


            /* niveau 2*/

            > li {
                margin-bottom: var(--wp--preset--spacing--s);
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;
                width: 100%;
                @media (max-width: 992px) {
                    display: block;
                }

                &:first-child {
                    @media (max-width: 992px) {
                        padding-top: var(--wp--preset--spacing--s);
                    }
                }

                &:last-child {
                    @media (max-width: 992px) {
                        padding-bottom: var(--wp--preset--spacing--m);
                    }
                }

                &::before {
                    @media (max-width: 992px) {
                        content: "●";
                        margin-right: var(--wp--preset--spacing--xs);
                        color: var(--wp--preset--color--white);
                    }
                }

                a {
                    color: var(--wp--preset--color--white);
                    text-transform: none;
                    width: 100%;
                    font-size: var(--wp--preset--font-size--s);
                    padding-bottom: var(--wp--preset--spacing--xxs);
                    border-bottom: 1px solid var(--wp--preset--color--gray-quaternary);
                    letter-spacing: 1px;
                    font-weight: 100;
                    transition: color 0.25s ease-in-out;

                    &::before {
                        display: none;
                    }

                    @media (max-width: 992px) {
                        padding-bottom: 0;
                        font-size: var(--wp--preset--font-size--m);
                        padding-left: 0;
                        border-bottom: none;
                    }

                    &:hover, &:focus {
                        color: var(--wp--preset--color--secondary);
                    }
                }

                &:last-child {
                    margin-bottom: 0;

                    a {
                        padding-bottom: 0;
                        border-bottom: none;
                    }
                }
            }
        }
    }

    a {
        position: relative;
        color: var(--wp--preset--color--black);
        text-decoration: none;
        font-size: var(--wp--preset--font-size--s);
        font-weight: 500;

        &::before {
            content: "";
            position: absolute;
            display: block;
            top: 23px;
            left: 0;
            width: 100%;
            transform: scaleX(0);
            height: 2px;
            background: var(--wp--preset--color--secondary);
            transform-origin: right;
            transition: transform 0.50s cubic-bezier(0.370, 0.330, 0.185, 0.900);
            @media (max-width: 992px) {
                display: none;
            }
        }

        &:hover, &:focus {
            color: var(--wp--preset--color--white);
            @media (max-width: 992px) {
                color: var(--wp--preset--color--white);
            }

            &::before {
                transform: scaleX(1);
                transform-origin: left;
            }

            & + ul {
                opacity: 1;
                visibility: visible;
            }
        }
    }

    /* Persistance du trait sous le menu de premier niveau quand le sous-menu est visible (Desktop) */
    > li.menu-item-has-children:hover > a::before {
        @media (min-width: 993px) {
            transform: scaleX(1);
            transform-origin: left;
        }
    }

    .menu-item-home {
        @media (max-width: 992px) {
            display: none;

        }
    }
}