/* =========================================================
   Sélecteur de langues Polylang
   (barre du haut, à la place du bloc infos)
   ========================================================= */

.top-bar-right ul.mb-lang-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.top-bar-right .mb-lang-switcher li.lang-item {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    padding: 8px 0 8px 14px !important;
}

/* Neutralise le séparateur "|" ajouté par le thème après chaque li */
.top-bar-right .mb-lang-switcher li.lang-item:after {
    content: none !important;
    display: none !important;
}

/* Notre séparateur "|" entre les langues */
.top-bar-right .mb-lang-switcher li.lang-item + li.lang-item:before {
    content: '|';
    padding-right: 14px;
    opacity: 0.5;
}

/* Drapeau et nom côte à côte, sur une seule ligne */
.top-bar-right .mb-lang-switcher li.lang-item a {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity ease-in-out 0.3s;
}

.top-bar-right .mb-lang-switcher li.lang-item a:hover {
    opacity: 1;
    color: #fff !important;
}

/* Langue courante : mise en évidence */
.top-bar-right .mb-lang-switcher li.lang-item.current-lang a {
    font-weight: 700;
    opacity: 1;
}

/* Drapeaux */
.top-bar-right .mb-lang-switcher li.lang-item img.flag {
    display: inline-block !important;
    width: 20px !important;
    height: auto !important;
    max-width: none;
    margin: 0 8px 0 0 !important;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    vertical-align: middle;
}

/* Mobile : centré, espacement réduit */
@media (max-width: 767px) {

    .top-bar-right ul.mb-lang-switcher {
        justify-content: center;
    }

    .top-bar-right .mb-lang-switcher li.lang-item {
        padding-left: 10px !important;
    }

    .top-bar-right .mb-lang-switcher li.lang-item + li.lang-item:before {
        padding-right: 10px;
    }

}
