/**
 * Sélecteur de devise — Biotifull Multi-Currency.
 *
 * Aucune dépendance externe. Typographie et couleurs héritées du thème :
 * on ne pose que la structure, l'espacement et les états.
 */

.bmc-switcher {
	position: relative;
	display: inline-block;
	font: inherit;
	color: inherit;
	line-height: 1.2;
	--bmc-hairline: color-mix(in srgb, currentColor 22%, transparent);
	--bmc-surface: var(--theme-palette-color-8, #fff);
}

.bmc-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0;
	padding: 0.4em 0.7em;
	font: inherit;
	color: inherit;
	background: none;
	border: 1px solid var(--bmc-hairline, rgba(0, 0, 0, 0.18));
	border-radius: 2px;
	cursor: pointer;
	transition: border-color 140ms ease;
}

.bmc-switcher__toggle:hover,
.bmc-switcher__toggle:focus-visible {
	border-color: currentColor;
}

.bmc-switcher__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bmc-switcher__caret {
	width: 0.45em;
	height: 0.45em;
	margin-left: 0.1em;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: translateY(-0.12em) rotate(45deg);
	transition: transform 140ms ease;
}

.bmc-switcher__toggle[aria-expanded="true"] .bmc-switcher__caret {
	transform: translateY(0.06em) rotate(-135deg);
}

.bmc-switcher__flag {
	font-size: 1.05em;
	line-height: 1;
}

.bmc-switcher__code {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.bmc-switcher__list {
	position: absolute;
	z-index: 999;
	right: 0;
	min-width: 100%;
	margin: 0.35em 0 0;
	padding: 0.25em 0;
	list-style: none;
	background: var(--bmc-surface, #fff);
	border: 1px solid var(--bmc-hairline, rgba(0, 0, 0, 0.18));
	border-radius: 2px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	max-height: 18em;
	overflow-y: auto;
}

.bmc-switcher__list[hidden] {
	display: none;
}

.bmc-switcher__option {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 0.9em 0.4em 0.7em;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	border-left: 2px solid transparent;
	transition: border-color 140ms ease;
}

.bmc-switcher__option:hover,
.bmc-switcher__option:focus-visible {
	border-left-color: var(--bmc-hairline, rgba(0, 0, 0, 0.18));
	text-decoration: none;
}

.bmc-switcher__option.is-active {
	border-left-color: currentColor;
	font-weight: 600;
}

.bmc-switcher--floating {
	position: fixed;
	z-index: var(--bmc-z, 9998);
	background: var(--bmc-surface, #fff);
	border-radius: 2px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

/* Ancres. Les décalages sont injectés en variables CSS depuis les réglages. */
.bmc-switcher--bottom-right,
.bmc-switcher--bottom-left {
	bottom: var(--bmc-offset-y, 20px);
}

.bmc-switcher--top-right,
.bmc-switcher--top-left {
	top: var(--bmc-offset-y, 20px);
}

.bmc-switcher--middle-right,
.bmc-switcher--middle-left {
	top: 50%;
	transform: translateY(-50%);
}

.bmc-switcher--bottom-right,
.bmc-switcher--top-right,
.bmc-switcher--middle-right {
	right: var(--bmc-offset-x, 20px);
}

.bmc-switcher--bottom-left,
.bmc-switcher--top-left,
.bmc-switcher--middle-left {
	left: var(--bmc-offset-x, 20px);
}

/* Le menu s'ouvre vers le haut ou vers le bas selon l'ancre, et s'aligne
   du bon côté pour ne jamais sortir de la fenêtre. */
.bmc-switcher--bottom-right .bmc-switcher__list,
.bmc-switcher--bottom-left .bmc-switcher__list,
.bmc-switcher--middle-right .bmc-switcher__list,
.bmc-switcher--middle-left .bmc-switcher__list {
	bottom: calc(100% + 0.35em);
	top: auto;
}

.bmc-switcher--bottom-left .bmc-switcher__list,
.bmc-switcher--top-left .bmc-switcher__list,
.bmc-switcher--middle-left .bmc-switcher__list {
	right: auto;
	left: 0;
}

@media (max-width: 782px) {
	.bmc-switcher--desktop-only {
		display: none;
	}

	.bmc-switcher--floating {
		--bmc-offset-x: 12px;
		--bmc-offset-y: 12px;
	}
}

.bmc-switcher.is-busy {
	opacity: 0.55;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.bmc-switcher *,
	.bmc-switcher {
		transition: none !important;
	}
}
