.lf-header{
    padding: 40px;
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
    align-items: start;
    gap: 40px;
    position: relative;
    z-index: 100;
}

.lf-header-logo{
    flex: 3;
}

/* Bouton burger + croix : masqués sur desktop */
.lf-burger,
.lf-burger-close{
    display: none;
}

.lf-header-logo img{
    width: 115px;
    display: block;
}

.lf-header-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    position: relative;

    flex: 2;
}

.lf-header-nav ul {
    list-style: none;
}

.lf-lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: -45%;
}

.lf-lang-link {
    font-family: var(--font-family);
    font-size: var(--lf-overlay-text-font-size);
    font-weight: var(--lf-menu-item-font-weight);
    letter-spacing: var(--lf-menu-item-letter-spacing);
    color: var(--lf-menu-item-color);
    text-transform: uppercase;
    text-decoration: none;
}

.lf-lang-link:hover{
    color: #000;
}

.lf-lang-link.is-active {
    color: #000;
}

.lf-lang-sep {
    color: var(--lf-menu-item-color);
}

.lf-header-nav ul#primary-menu{
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0;
    width: 100%;
}

.lf-header-nav #primary-menu li{
    /* padding-left: 30px; */
    text-transform: uppercase;
    transition: transform 0.5s ease;
}

.lf-header-nav #primary-menu li a{
    display: flex;
    align-items: center;
    position: relative;
    transition: margin-left 0.5s ease, padding-left 0.5s ease;
}

.lf-header-nav #primary-menu li a::after{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 10px;
    height: 10px;
    background: url(../img/all/square.svg) center / contain no-repeat;
    transform:
        translateX(0)
        translateY(-50%);
    opacity: 0;
    transition:
        opacity 0.5s ease;
}

.lf-header-nav #primary-menu li a:hover{
    color: #000;
}

.lf-header-nav #primary-menu li a:hover::after{
    opacity: 1;
}

/* Décalage des liens au survol — desktop uniquement (menu horizontal).
   Sur mobile (menu en colonne) aucun item ne bouge : seul le carré
   s'anime (voir la media query mobile plus bas). */
@media (min-width: 769px){
    .lf-header-nav #primary-menu li a:hover{
        margin-left: -17px;
        padding-left: 17px;
    }

    /* Décaler les items à gauche de l'item survolé */
    .lf-header-nav #primary-menu:has(li:nth-child(2) a:hover) li:nth-child(1),
    .lf-header-nav #primary-menu:has(li:nth-child(3) a:hover) li:nth-child(1),
    .lf-header-nav #primary-menu:has(li:nth-child(3) a:hover) li:nth-child(2),
    .lf-header-nav #primary-menu:has(li:nth-child(4) a:hover) li:nth-child(1),
    .lf-header-nav #primary-menu:has(li:nth-child(4) a:hover) li:nth-child(2),
    .lf-header-nav #primary-menu:has(li:nth-child(4) a:hover) li:nth-child(3) {
        transform: translateX(-17px);
    }
}



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

@media (max-width: 768px){

    .lf-header{
        padding: 20px;
        align-items: flex-start;
    }

    .lf-header-logo{
        flex: 0 0 auto;
        position: relative;
        z-index: 1000;
    }

    /* Bouton burger visible et aligné à droite */
    .lf-burger{
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
        width: 28px;
        height: 28px;
        padding: 0;
        margin: 0;
        background: none;
        border: 0;
        cursor: pointer;
        z-index: 110;
    }

    .lf-burger-bar{
        display: block;
        width: 100%;
        height: 2px;
        background: var(--lf-menu-item-color, #4d4d4d);
    }

    /* Le menu devient un overlay plein écran */
    .lf-header-nav{
        position: fixed;
        inset: 0;
        z-index: 120;

        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        gap: 24px;

        padding: 80px 20px;
        background: #fff;

        /* Transition douce d'apparition / disparition */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }

    body.lf-menu-open .lf-header-nav{
        opacity: 1;
        visibility: visible;
    }

    /* Bloquer le scroll de la page quand le menu est ouvert */
    body.lf-menu-open{
        overflow: hidden;
    }

    /* La croix : même position et taille que le bouton burger */
    .lf-burger-close{
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 130;

        width: 48px;
        height: 48px;
        padding: 0;
        margin: 0;
        background: none;
        border: 0;
        cursor: pointer;

        color: var(--lf-menu-item-color, #4d4d4d);
    }

    .lf-burger-close svg{
        display: block;
        width: 48px;
        height: 48px;
    }

    /* Items du menu empilés et alignés à droite */
    .lf-header-nav ul#primary-menu{
        flex-direction: column;
        align-items: flex-end;
        gap: 24px;
        width: auto;
    }

    /* Carré au survol : il glisse seul vers la gauche du texte,
       sans déplacer le lien ni les autres items */
    .lf-header-nav #primary-menu li a::after{
        left: auto;
        right: 100%;
        margin-right: 8px;
        transform: translateX(8px) translateY(-50%);
        transition: opacity 0.4s ease, transform 0.4s ease;
        width: 12px;
        height: 12px;
    }

    .lf-header-nav #primary-menu li a:hover::after{
        transform: translateX(0) translateY(-50%);
    }

    .lf-lang-switcher{
        position: static;
        top: auto;
        justify-content: flex-end;
    }

}