/*
 * Sélecteur de langue DLG Translator
 * DESKTOP (> 1024px) : discret dans le header, aligné à droite
 * MOBILE  (≤ 1024px) : petit bouton fixe en bas à droite, dropdown vers le HAUT
 */

#dlg-lang-switcher {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	height: var(--e-header-height, 72px);
	padding-right: 20px;
	font-family: inherit;
}

#dlg-lang-toggle {
	display: flex;
	align-items: center;
	gap: 4px;
	background: transparent;
	border: none;
	cursor: pointer;
	min-height: 44px;
	min-width: 44px;
	padding: 0 6px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	opacity: 0.85;
	transition: opacity 0.2s;
	white-space: nowrap;
}
#dlg-lang-toggle:hover { opacity: 1; }

.dlg-flag {
	width: 21px;
	height: 14px;
	flex-shrink: 0;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255,255,255,0.25);
	display: inline-block;
}
#dlg-lang-toggle .dlg-flag { width: 22px; height: 15px; }
#dlg-lang-toggle .dlg-arrow { width: 7px; height: 7px; flex-shrink: 0; opacity: 0.55; transition: transform 0.2s; }
#dlg-lang-switcher.open #dlg-lang-toggle .dlg-arrow { transform: rotate(180deg); }

#dlg-lang-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 2px);
	right: 0;
	background: rgba(8,8,8,0.95);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	overflow: hidden;
	min-width: 128px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.5);
	z-index: 1;
}
#dlg-lang-switcher.open #dlg-lang-dropdown { display: block; }

#dlg-lang-dropdown a {
	display: flex;
	align-items: center;
	gap: 9px;
	min-height: 44px;
	padding: 0 14px;
	text-decoration: none;
	color: rgba(255,255,255,0.65);
	font-size: 13px;
	transition: background 0.15s, color 0.15s;
}
#dlg-lang-dropdown a:hover  { background: rgba(255,255,255,0.08); color: #fff; }
#dlg-lang-dropdown a.active { color: #fff; font-weight: 700; }
#dlg-lang-dropdown a.active .dlg-flag { box-shadow: 0 0 0 1px rgba(255,255,255,0.6); }

@media (max-width: 1024px) {
	#dlg-lang-switcher {
		top: auto;
		bottom: 80px;
		right: 14px;
		height: auto;
		padding-right: 0;
	}
	#dlg-lang-toggle {
		background: rgba(0,0,0,0.80);
		border: 1px solid rgba(255,255,255,0.2);
		border-radius: 20px;
		padding: 0 12px;
		min-height: 40px;
		min-width: unset;
		font-size: 12px;
		font-weight: 700;
		gap: 5px;
		opacity: 1;
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
		box-shadow: 0 2px 10px rgba(0,0,0,0.4);
	}
	#dlg-lang-dropdown {
		top: auto;
		bottom: calc(100% + 6px);
		right: 0;
	}
}
