/**
 * Selettore lingua header (Fullstack ML): select nativo e variante enhanced.
 */
.fullstack-ml-lang-switcher {
	flex-shrink: 0;
	position: relative;
}

.fullstack-ml-lang-switcher__select {
	max-width: 100%;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--fullstack-header-fg, inherit);
	background-color: var(--fullstack-header-bg, transparent);
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 0.35rem;
	padding: 0.35rem 1.75rem 0.35rem 0.5rem;
	cursor: pointer;
	line-height: 1.3;
}

.fullstack-ml-lang-switcher--ui-native .fullstack-ml-lang-switcher__select {
	min-height: 2.25rem;
}

.fullstack-ml-lang-switcher--ui-native .fullstack-ml-lang-switcher__custom {
	display: none !important;
}

/* Enhanced: prima dell’init resta visibile solo il select */
.fullstack-ml-lang-switcher--ui-enhanced:not(.is-initialized) .fullstack-ml-lang-switcher__custom {
	display: none;
}

.fullstack-ml-lang-switcher--ui-enhanced.is-initialized .fullstack-ml-lang-switcher__select {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fullstack-ml-lang-switcher__custom {
	position: relative;
}

.fullstack-ml-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	max-width: 100%;
	font-size: 0.8125rem;
	font-weight: 500;
	font-family: inherit;
	color: var(--fullstack-header-fg, inherit);
	background-color: var(--fullstack-header-bg, transparent);
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 0.35rem;
	padding: 0.4rem 0.55rem;
	cursor: pointer;
	line-height: 1.3;
}

.fullstack-ml-lang-switcher__toggle:hover,
.fullstack-ml-lang-switcher__toggle:focus-visible {
	opacity: 1;
	outline: 2px solid color-mix(in srgb, currentColor 45%, transparent);
	outline-offset: 2px;
}

.fullstack-ml-lang-switcher__caret {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.75;
	margin-top: 2px;
}

.fullstack-ml-lang-switcher__custom.is-open .fullstack-ml-lang-switcher__caret {
	transform: rotate(180deg);
}

.fullstack-ml-lang-switcher__dropdown {
	position: absolute;
	z-index: 200;
	top: calc(100% + 4px);
	right: 0;
	min-width: 100%;
	margin: 0;
	padding: 0.25rem 0;
	list-style: none;
	background-color: var(--fullstack-header-bg, var(--fsml-lang-dd-bg, #fff));
	color: var(--fullstack-header-fg, var(--fsml-lang-dd-fg, #1a1a1a));
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 0.35rem;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.fullstack-ml-lang-switcher__dropdown-item {
	margin: 0;
	padding: 0;
}

.fullstack-ml-lang-switcher__dropdown-link {
	display: block;
	padding: 0.45rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	text-decoration: none;
	color: inherit;
	white-space: nowrap;
}

.fullstack-ml-lang-switcher__dropdown-link:hover,
.fullstack-ml-lang-switcher__dropdown-link:focus-visible {
	background: color-mix(in srgb, currentColor 10%, transparent);
	outline: none;
}

.fullstack-ml-lang-switcher__dropdown-link.is-current {
	font-weight: 600;
	cursor: default;
	pointer-events: none;
	opacity: 0.85;
}

/* Modalità display: bandiere leggermente più grandi */
.fullstack-ml-lang-switcher--display-flag .fullstack-ml-lang-switcher__toggle-text,
.fullstack-ml-lang-switcher--display-flag .fullstack-ml-lang-switcher__dropdown-link {
	font-size: 1.1rem;
	line-height: 1.2;
}

.fullstack-ml-lang-switcher--display-flag_code .fullstack-ml-lang-switcher__toggle-text,
.fullstack-ml-lang-switcher--display-flag_code .fullstack-ml-lang-switcher__dropdown-link {
	font-size: 0.9375rem;
}
