.fpt-ls {
	display: flex;
	align-items: center;
	gap: 2px;
	line-height: 1;
}

/* Two languages: a compact segmented toggle with a sliding thumb. */
.fpt-ls.fpt-ls-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0;
	box-sizing: border-box;
	width: 96px;
	height: 36px;
	padding: 3px;
	background: #14141b;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.05);
	vertical-align: middle;
}

.fpt-ls.fpt-ls-toggle .fpt-ls-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: calc(50% - 3px);
	height: calc(100% - 6px);
	background: rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	transform: translateX(calc(var(--fpt-ls-index, 0) * 100%));
	transition: transform 0.18s ease;
	pointer-events: none;
}

.fpt-ls.fpt-ls-toggle .fpt-ls-item {
	position: relative;
	z-index: 1;
	flex: 0 0 50%;
	justify-content: center;
	width: 50%;
	height: 100%;
	padding: 0;
	background: transparent !important;
	border-radius: 999px;
	opacity: 0.55;
	cursor: pointer;
}

.fpt-ls.fpt-ls-toggle span.fpt-ls-item {
	cursor: default;
}

.fpt-ls.fpt-ls-toggle .fpt-ls-item:hover,
.fpt-ls.fpt-ls-toggle .fpt-ls-item:focus-visible {
	background: transparent;
	opacity: 0.9;
}

.fpt-ls.fpt-ls-toggle .fpt-ls-item.is-active {
	opacity: 1;
}

.fpt-ls.fpt-ls-toggle .fpt-ls-flag {
	width: 24px;
	height: 16px;
}

.fpt-ls.fpt-ls-toggle.is-switching .fpt-ls-item {
	pointer-events: none;
}

.navbar-nav .menu-item.fpt-language-switcher {
	display: flex;
	align-items: center;
}

.fpt-ls-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 9px;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
	opacity: 0.82;
	transition: background-color 0.15s ease, opacity 0.15s ease;
	white-space: nowrap;
}

.fpt-ls-item:hover,
.fpt-ls-item:focus {
	color: inherit;
	text-decoration: none;
	opacity: 1;
	background: rgba(255, 255, 255, 0.08);
}

.fpt-ls-item.is-active {
	opacity: 1;
	background: rgba(255, 255, 255, 0.14);
	font-weight: 600;
}

.fpt-ls-flag {
	width: 18px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
	flex: 0 0 auto;
}

.fpt-ls-name {
	font-size: 13px;
	letter-spacing: 0.01em;
}

.fpt-ls-code {
	min-width: 22px;
	text-align: center;
	font-size: 11px;
	font-weight: 700;
}

.fpt-ls-dropdown {
	position: relative;
}

.fpt-ls-dropdown .fpt-ls-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 9px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.fpt-ls-dropdown .fpt-ls-toggle:hover,
.fpt-ls-dropdown.is-open .fpt-ls-toggle {
	background: rgba(255, 255, 255, 0.1);
}

.fpt-ls-caret {
	font-size: 10px;
	opacity: 0.7;
}

.fpt-ls-menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 180px;
	padding: 6px;
	background: #1b1b24;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
	z-index: 9999;
}

.fpt-ls-dropdown.is-open .fpt-ls-menu,
.fpt-ls-dropdown:hover .fpt-ls-menu,
.fpt-ls-dropdown:focus-within .fpt-ls-menu {
	display: block;
}

.fpt-ls-menu .fpt-ls-item {
	width: 100%;
	justify-content: flex-start;
}

.fpt-ls-menu .fpt-ls-item.is-active {
	background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
	.fpt-ls-item,
	.fpt-ls-dropdown .fpt-ls-toggle {
		padding: 8px 7px;
	}

	.fpt-ls-name {
		font-size: 12px;
	}

	/* The language item is centered in the mobile menu. */
	.navbar-nav .menu-item.fpt-language-switcher {
		width: 100%;
		justify-content: center;
		margin: 8px 0;
	}

	.navbar-nav .menu-item.fpt-language-switcher .fpt-ls.fpt-ls-toggle {
		margin: 0 auto;
	}

	.fpt-ls.fpt-ls-toggle {
		width: 104px;
		height: 40px;
	}

	.fpt-ls.fpt-ls-toggle .fpt-ls-item {
		padding: 0;
	}

	.fpt-ls-dropdown .fpt-ls-menu {
		left: 0;
		right: auto;
		max-width: calc(100vw - 30px);
	}
}
