/* RM Lang Switcher — habillage du widget flottant GTranslate dans le header Retrometroid.
   Direction : pastille fine sur fond sombre, menu blanc arrondi, drapeaux ronds, Inter. */

/* Annule le zoom 0.7 appliqué au wrapper */
.gtranslate_wrapper { zoom: 1 !important; }

/* Pas de z-index permanent : sinon la pastille passe devant le tiroir panier, le menu mobile, etc.
   Le header n'est remonté au premier plan que pendant l'ouverture du menu (voir JS). */
#gt_float_wrapper { position: relative; z-index: auto; }
#gt_float_wrapper .gt_float_switcher .gt-selected { z-index: auto; }

/* ---------- Pastille (langue courante) ---------- */
#gt_float_wrapper .gt_float_switcher {
	position: relative;
	display: inline-block;
	overflow: visible;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
	font-size: 13px;
	line-height: 1;
	color: #fff;
	-webkit-font-smoothing: antialiased;
	transition: none;
}
#gt_float_wrapper .gt_float_switcher .gt-selected {
	background: transparent;
	text-transform: uppercase;
	overflow: visible;
	border-radius: 999px;
}
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 12px 0 9px;
	border: .5px solid rgba(255, 255, 255, .24);
	border-radius: 999px;
	color: #fff;
	font-weight: 600;
	font-size: 12px;
	letter-spacing: .06em;
	transition: background .2s ease, border-color .2s ease;
}
#gt_float_wrapper .gt_float_switcher .gt-selected:hover .gt-current-lang { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
#gt_float_wrapper .gt_float_switcher .gt-selected:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang span.gt-lang-code { position: static; top: auto; }

/* Chevron dessiné en CSS (remplace l'image de GTranslate) */
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang span.gt_float_switcher-arrow {
	width: 6px;
	height: 6px;
	margin: -3px 0 0 1px;
	background: none;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: .8;
	transition: transform .2s ease, margin .2s ease;
}
#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang span.gt_float_switcher-arrow.gt_arrow_rotate {
	transform: rotate(225deg);
	margin-top: 3px;
}

/* Drapeaux ronds */
#gt_float_wrapper .gt_float_switcher img {
	width: 18px !important;
	height: 18px !important;
	margin: 0 !important;
	border-radius: 50% !important;
	object-fit: cover;
	display: block;
	box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12);
	flex: 0 0 auto;
}

/* ---------- Menu déroulant (par-dessus la page, plus dans le flux) ---------- */
#gt_float_wrapper .gt_float_switcher .gt_options {
	position: absolute !important;
	top: calc(100% + 10px);
	right: 0;
	left: auto;
	z-index: 10001;
	width: 210px;
	max-height: none;
	overflow: visible;
	padding: 6px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .08);
	opacity: 0;
	transform: translateY(-6px) scale(.98);
	transform-origin: top right;
	transition: opacity .16s ease, transform .2s cubic-bezier(.32, .72, 0, 1);
	cursor: default;
}
#gt_float_wrapper .gt_float_switcher .gt_options.gt-open { opacity: 1; transform: none; }

#gt_float_wrapper .gt_float_switcher .gt_options a {
	display: flex !important;
	align-items: center;
	gap: 12px;
	height: 40px;
	padding: 0 10px;
	border-radius: 10px;
	color: #121212;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s ease;
}
#gt_float_wrapper .gt_float_switcher .gt_options a img { width: 20px !important; height: 20px !important; }
#gt_float_wrapper .gt_float_switcher .gt_options a:hover,
#gt_float_wrapper .gt_float_switcher .gt_options a:focus-visible { background: #F5F5F7; color: #121212; outline: none; }

/* Langue active : affichée avec une coche */
#gt_float_wrapper .gt_float_switcher .gt_options a.gt-current { font-weight: 600; }
#gt_float_wrapper .gt_float_switcher .gt_options a.gt-current::after {
	content: "";
	width: 9px;
	height: 5px;
	margin: -3px 2px 0 auto;
	border-left: 1.75px solid #121212;
	border-bottom: 1.75px solid #121212;
	transform: rotate(-45deg);
}

/* Header clair (détecté automatiquement) : pastille sombre */
#gt_float_wrapper.rm-gt--light .gt_float_switcher { color: #121212; }
#gt_float_wrapper.rm-gt--light .gt_float_switcher .gt-selected .gt-current-lang { color: #121212; border-color: rgba(0, 0, 0, .14); }
#gt_float_wrapper.rm-gt--light .gt_float_switcher .gt-selected:hover .gt-current-lang { background: rgba(0, 0, 0, .04); border-color: rgba(0, 0, 0, .28); }
#gt_float_wrapper.rm-gt--light .gt_float_switcher .gt-selected:focus-visible { outline-color: #121212; }

/* Pas assez de place à gauche : le menu s'aligne sur le bord gauche de la pastille */
#gt_float_wrapper.rm-gt--align-left .gt_float_switcher .gt_options { right: auto; left: 0; transform-origin: top left; }

/* Widget flottant hors header (coin d'écran) : le menu s'ouvre vers le haut, pastille claire */
#gt_float_wrapper.rm-gt--floating .gt_float_switcher .gt-selected .gt-current-lang {
	background: #fff;
	color: #121212;
	border-color: rgba(0, 0, 0, .12);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
#gt_float_wrapper.rm-gt--floating .gt_float_switcher .gt_options {
	top: auto;
	bottom: calc(100% + 10px);
	transform-origin: bottom right;
}

/* ---------- Téléphone ---------- */
@media (max-width: 767px) {
	#gt_float_wrapper .gt_float_switcher .gt-selected { position: relative; }
	/* Zone tactile de 44 px sans agrandir la pastille */
	#gt_float_wrapper .gt_float_switcher .gt-selected::after { content: ""; position: absolute; inset: -5px -4px; }
	#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang { height: 34px; padding: 0 9px 0 6px; gap: 6px; }

	/* Le header mobile ne doit jamais passer sur deux lignes :
	   le groupe [langue · panier · menu] reste sur une ligne et prend la place dont il a besoin,
	   le conteneur du logo cède l'espace en trop. */
	.elementor-location-header .e-con:has(> .elementor-widget-shortcode .gtranslate_wrapper) {
		flex-wrap: nowrap !important;
		flex: 1 1 auto !important;
		width: auto !important;
		min-width: 0;
	}
	.elementor-location-header .e-con:has(> .e-con > .elementor-widget-shortcode .gtranslate_wrapper) > .e-con:not(:has(.gtranslate_wrapper)) {
		flex: 0 1 auto !important;
		width: auto !important;
		min-width: 0;
	}
	#gt_float_wrapper .gt_float_switcher .gt_options {
		width: 240px;
		max-width: calc(100vw - 24px);
		top: calc(100% + 12px);
		padding: 6px;
		border-radius: 16px;
	}
	#gt_float_wrapper .gt_float_switcher .gt_options a { height: 46px; font-size: 15px; padding: 0 12px; }
	#gt_float_wrapper .gt_float_switcher .gt_options a img { width: 22px !important; height: 22px !important; }
}

/* Très petits écrans : drapeau seul */
@media (max-width: 359px) {
	#gt_float_wrapper .gt_float_switcher .gt-selected .gt-current-lang span.gt-lang-code { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	#gt_float_wrapper .gt_float_switcher * { transition: none !important; }
}
