/* ==========================================================================
   Barfide — Language Switcher (Nav Menu)
   ========================================================================== */

/* ---- <li> wrapper ---- */
.barfide-lang-switcher-nav-item {
	position: relative;
	list-style: none;
}


/* ---- Trigger (<a> hérite naturellement des styles Elementor du menu) ---- */
.barfide-lang-switcher-nav-item .barfide-ls-trigger {
	--barfide-ls-gap: 8px;

	display: inline-flex;
	align-items: center;
	gap: var( --barfide-ls-gap );
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
}

/* Supprime le trait de soulignement Elementor au survol */
.barfide-lang-switcher-nav-item .barfide-ls-trigger::before,
.barfide-lang-switcher-nav-item .barfide-ls-trigger::after,
.barfide-lang-switcher-nav-item .barfide-ls-trigger:hover::before,
.barfide-lang-switcher-nav-item .barfide-ls-trigger:hover::after {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	opacity: 0 !important;
	content: none !important;
}

.barfide-lang-switcher-nav-item .barfide-ls-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 2px;
}

/* Submenu indicator — same CSS chevron as the theme's menu items with children,
   so the switcher needs no icon font. An inherited .sub-arrow coming from another
   menu (Elementor used to inject its own markup there) keeps its intrinsic size:
   the chevron rules only apply to our own empty span. */
.barfide-lang-switcher-nav-item .barfide-ls-trigger .barfide-ls-chevron {
	display: block;
	width: 0;
	height: 0;
	/* The trigger gap already gives 8 px; the reference puts the glyph 10 px
	   after the label, hence the 2 px top-up. */
	margin-left: 2px;
	/* Aligns the glyph on the label's baseline, as the icon font did. */
	margin-top: 1.5px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5.5px solid currentColor;
	transform-origin: 50% 35%;
	transition: transform 0.22s ease;
}

/* Le chevron suit l'etat reel du panneau, qu'il soit ouvert au clic ou au
   survol : le laisser pointer vers le bas devant une liste deployee serait une
   indication fausse. */
.barfide-lang-switcher-nav-item.is-open .barfide-ls-trigger .barfide-ls-chevron,
.barfide-lang-switcher-nav-item:hover .barfide-ls-trigger .barfide-ls-chevron,
.barfide-lang-switcher-nav-item:focus-within .barfide-ls-trigger .barfide-ls-chevron {
	transform: rotate( 180deg );
}

/* Globe icon */
.barfide-ls-globe {
	display: flex;
	align-items: center;
}

.barfide-ls-globe-svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* ---- Dropdown list ----
   Le panneau s'aligne sur le sous-menu « Produits » : meme fond, meme filet,
   meme retrait, angles vifs et sans ombre portee. La geometrie (largeur,
   position, retraits) vient de `.site-nav__list ul` dans main.css, qui l'emporte
   en specificite ; ne restent ici que l'etat ferme et les reglages propres au
   composant. Sur la version d'origine les deux panneaux ne se ressemblaient
   pas : le selecteur etait une piece rapportee avec son arrondi et son ombre. */
.barfide-ls-dropdown {
	list-style: none;
	margin: 0;
	position: absolute;
	left: 0;
	border-radius: 0;
	box-shadow: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		visibility 0.2s ease;
	z-index: 20;
	/*
	 * Pas de `pointer-events: none` ici : `visibility: hidden` rend deja le
	 * panneau ferme intraversable. Le poser en plus le rendait transparent a la
	 * souris une fois ouvert au survol : le pointeur passait au travers, le <li>
	 * n'etait donc plus survole, et le panneau se refermait des qu'on allait
	 * vers lui. Le sous-menu « Produits » n'en a jamais eu besoin.
	 */
}

/* Elementor's `.elementor-nav-menu ul { display: none }` outranks the base
   `.barfide-ls-dropdown` rule and keeps the panel collapsed. Re-assert the
   display here (two classes = higher specificity); the open/close state is
   driven by opacity/visibility/pointer-events below. */
.barfide-lang-switcher-nav-item .barfide-ls-dropdown {
	display: block;
}

/* Ouverture au clic, que le script pose pour le tactile et le clavier. Le
   survol, lui, passe par `.site-nav__list li:hover > ul` dans main.css, comme
   pour « Produits ». */
.barfide-lang-switcher-nav-item.is-open .barfide-ls-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ---- Dropdown items ----
   Retraits, corps et graisse viennent de `.site-nav__list ul a` : on ne pose
   ici que le drapeau et sa gouttiere. Le survol passe au teal comme dans le
   sous-menu « Produits », sans fond gris. */
.barfide-ls-item a {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none !important;
	white-space: nowrap;
	transition: color 0.15s ease;
}

/* La langue courante se signale par la couleur, comme l'entree courante du
   menu principal : le sous-menu « Produits » n'use d'aucun fond. */
.barfide-ls-item.is-active a {
	color: var(--teal-500);
}

.barfide-ls-item img {
	flex-shrink: 0;
	display: block;
	object-fit: cover;
	border-radius: 2px;
}
