/* AvtoBus Pro Multilingual: modern language switcher. Uses the theme's colour tokens. */
.abpml-switcher {
	position: relative;
	display: inline-flex;
}

/* Flag (circular, works at any size) */
.abpml-flag {
	display: inline-flex;
	flex: none;
	width: 22px;
	height: 22px;
	overflow: hidden;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18), 0 1px 3px rgba(15, 23, 42, 0.25);
	transition: transform 0.3s var(--abp-ease, ease);
}

.abpml-flag__svg {
	display: block;
	width: 100%;
	height: 100%;
}

.abpml-flag--lg {
	width: 34px;
	height: 34px;
}

/* Trigger button */
.abpml-switcher .abpml-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 12px 0 10px;
	background: color-mix(in srgb, var(--abp-nav-color, currentColor) 6%, transparent);
	border: 1.5px solid color-mix(in srgb, var(--abp-nav-color, currentColor) 28%, transparent);
	border-radius: 999px;
	color: var(--abp-nav-color, inherit);
	font: 700 0.8125rem/1 var(--abp-font-body, inherit);
	letter-spacing: 0.06em;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s var(--abp-ease, ease);
}

.abpml-switcher .abpml-switcher__btn:hover {
	background: color-mix(in srgb, var(--abp-nav-color, currentColor) 14%, transparent);
	border-color: var(--abp-accent, currentColor);
	transform: translateY(-1px);
}

.abpml-switcher .abpml-switcher__btn:hover .abpml-flag {
	transform: rotate(-8deg) scale(1.08);
}

.abpml-switcher .abpml-switcher__btn:active {
	transform: scale(0.97);
}

.abpml-switcher.is-open .abpml-switcher__btn {
	border-color: var(--abp-accent, currentColor);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--abp-accent, currentColor) 22%, transparent);
}

.abpml-switcher .abpml-switcher__btn:focus-visible,
.abpml-option:focus-visible {
	outline: 2px solid var(--abp-accent, currentColor);
	outline-offset: 2px;
}

.abpml-switcher__chev {
	width: 14px;
	height: 14px;
	flex: none;
	transition: transform 0.3s var(--abp-ease, ease);
}

.abpml-switcher.is-open .abpml-switcher__chev {
	transform: rotate(180deg);
}

/* Panel */
.abpml-panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	z-index: 1001;
	width: 260px;
	padding: 10px;
	color: var(--abp-heading, #0f172a);
	background: color-mix(in srgb, var(--abp-surface, #fff) 92%, transparent);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	border: 1px solid var(--abp-border, #e2e8f0);
	border-radius: 18px;
	box-shadow: var(--abp-shadow-lg, 0 30px 60px -20px rgba(15, 23, 42, 0.35));
	transform-origin: calc(100% - 28px) -8px;
	transform: translateY(-6px) scale(0.94);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.32s var(--abp-ease, ease), visibility 0.32s;
}

.abpml-panel.is-open {
	transform: none;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.abpml-panel__title {
	margin: 0;
	padding: 6px 12px 10px;
	color: var(--abp-muted, #64748b);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.abpml-panel__list {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.abpml-panel__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.abpml-panel.is-open .abpml-panel__list li {
	animation: abpml-in 0.4s var(--abp-ease, ease) both;
	animation-delay: calc(var(--i, 0) * 55ms + 60ms);
}

@keyframes abpml-in {
	from {
		opacity: 0;
		transform: translateX(10px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.abpml-option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px 9px 10px;
	color: inherit;
	border-radius: 12px;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.25s var(--abp-ease, ease);
}

.abpml-option:hover,
.abpml-option:focus-visible {
	background: var(--abp-bg-alt, #f1f5f9);
	transform: translateX(3px);
}

.abpml-option:hover .abpml-flag {
	transform: scale(1.1) rotate(-6deg);
}

.abpml-option.is-current {
	background: color-mix(in srgb, var(--abp-accent, #dc2626) 10%, transparent);
}

.abpml-option__names {
	display: grid;
	flex: 1;
	min-width: 0;
	gap: 2px;
}

.abpml-option__names strong {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
}

.abpml-option__names small {
	color: var(--abp-muted, #64748b);
	font-size: 0.75rem;
	line-height: 1.2;
}

.abpml-switcher__check {
	width: 18px;
	height: 18px;
	flex: none;
	color: var(--abp-accent-text, var(--abp-accent, #dc2626));
	opacity: 0;
	transform: scale(0.4);
	transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.abpml-option.is-current .abpml-switcher__check {
	opacity: 1;
	transform: none;
}

/* Page fades slightly while the new language loads */
html.abpml-leaving main {
	opacity: 0.45;
	transition: opacity 0.3s ease;
}

/* Mobile: a bottom sheet with a dimmed backdrop */
.abpml-scrim {
	display: none;
}

@media (max-width: 560px) {
	.abpml-switcher .abpml-switcher__btn {
		padding: 0 10px 0 8px;
		gap: 6px;
	}

	.abpml-switcher__chev {
		display: none;
	}

	.abpml-scrim {
		position: fixed;
		inset: 0;
		z-index: 1100;
		display: block;
		background: rgba(2, 6, 23, 0.55);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s;
	}

	.abpml-scrim.is-open {
		opacity: 1;
		visibility: visible;
	}

	.abpml-panel {
		position: fixed;
		top: auto;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		left: 12px;
		z-index: 1101;
		width: auto;
		padding: 12px;
		border-radius: 22px;
		transform-origin: 50% 100%;
		transform: translateY(40px);
	}

	.abpml-panel.is-open {
		transform: none;
	}

	.abpml-option {
		padding: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.abpml-switcher .abpml-switcher__btn,
	.abpml-panel,
	.abpml-scrim,
	.abpml-option,
	.abpml-flag,
	.abpml-switcher__chev,
	.abpml-switcher__check {
		transition: none;
	}

	.abpml-panel.is-open .abpml-panel__list li {
		animation: none;
	}

	.abpml-switcher .abpml-switcher__btn:hover,
	.abpml-option:hover {
		transform: none;
	}
}
