/**
 * Simple Manual Translate — публични стилове.
 */

.smt-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.smt-missing-translation {
	margin: 1.25rem 0;
	padding: 1rem 1.25rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.03);
	line-height: 1.55;
	font-size: 1rem;
}

/* ── Language switcher (shortcode и floating) ─────────────────────────────── */

.smt-language-switcher:not(.smt-floating-switcher) {
	margin: 0.75rem 0 1rem;
	line-height: 1.35;
}

.smt-language-switcher__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.5rem;
}

.smt-language-switcher__item {
	margin: 0;
	padding: 0;
}

.smt-lang-link {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 2.5rem;
	min-width: max-content;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: rgba(255, 255, 255, 0.75);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	color: inherit;
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.smt-lang-link:hover,
.smt-lang-link:focus-visible {
	outline: none;
	border-color: rgba(0, 0, 0, 0.22);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
	text-decoration: none;
	color: inherit;
}

.smt-lang-link.is-active {
	font-weight: 600;
	border-color: rgba(37, 99, 235, 0.45);
	background: rgba(239, 246, 255, 0.95);
	box-shadow: 0 1px 6px rgba(37, 99, 235, 0.12);
}

.smt-lang-flag {
	flex-shrink: 0;
	line-height: 1;
	font-size: 1.125rem;
}

.smt-lang-flag--fallback {
	font-size: 0.6875rem;
	font-weight: 700;
	min-width: 1.625rem;
	text-align: center;
	letter-spacing: 0.02em;
}

.smt-lang-code {
	flex-shrink: 0;
	line-height: 1.2;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.smt-lang-text {
	white-space: nowrap;
	word-break: keep-all;
}

/* По-малки таблетни бутони в компактни режими */
.smt-lang-link.smt-lang-link--mode-flags_only,
.smt-lang-link.smt-lang-link--mode-code_only {
	min-width: 2.75rem;
	padding-inline: 0.45rem;
}

.smt-lang-link.smt-lang-link--mode-flags_only {
	padding-inline: 0.55rem;
}

/* ── Floating switcher ───────────────────────────────────────────────────── */

.smt-floating-switcher {
	position: fixed;
	z-index: 99990;
	margin: 0;
	max-width: min(calc(100vw - max(28px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px))), 360px);
	padding: 0.5rem;
	border-radius: 999px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	background: rgba(255, 255, 255, 0.78);
	box-shadow:
		0 4px 22px rgba(15, 23, 42, 0.1),
		0 1px 0 rgba(255, 255, 255, 0.72) inset;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.smt-floating-switcher .smt-language-switcher__list {
	gap: 0.35rem;
	flex-wrap: nowrap;
	justify-content: center;
}

.smt-floating-switcher .smt-lang-link {
	min-height: 2.625rem;
	background: rgba(255, 255, 255, 0.6);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.smt-floating-switcher .smt-lang-link:active {
	opacity: 0.92;
}

.smt-language-switcher--dropdown {
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.smt-lang-dropdown {
	position: relative;
}

.smt-lang-dropdown__current {
	cursor: pointer;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.14);
}

.smt-lang-dropdown__current::-webkit-details-marker {
	display: none;
}

.smt-lang-caret {
	font-size: 0.8rem;
	line-height: 1;
	opacity: 0.72;
}

.smt-lang-dropdown__menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.45rem);
	min-width: 100%;
	padding: 0.35rem;
	border-radius: 999px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.smt-top-right .smt-lang-dropdown__menu,
.smt-top-left .smt-lang-dropdown__menu {
	top: calc(100% + 0.45rem);
	bottom: auto;
}

.smt-bottom-left .smt-lang-dropdown__menu,
.smt-top-left .smt-lang-dropdown__menu {
	left: 0;
	right: auto;
}

.smt-floating-switcher.smt-bottom-right {
	right: max(12px, env(safe-area-inset-right, 0px) + 4px);
	bottom: max(12px, env(safe-area-inset-bottom, 0px) + 4px);
}

.smt-floating-switcher.smt-bottom-left {
	left: max(12px, env(safe-area-inset-left, 0px) + 4px);
	bottom: max(12px, env(safe-area-inset-bottom, 0px) + 4px);
}

.smt-floating-switcher.smt-top-right {
	right: max(12px, env(safe-area-inset-right, 0px) + 4px);
	top: max(12px, env(safe-area-inset-top, 0px) + 4px);
}

.smt-floating-switcher.smt-top-left {
	left: max(12px, env(safe-area-inset-left, 0px) + 4px);
	top: max(12px, env(safe-area-inset-top, 0px) + 4px);
}

@media (max-width: 520px) {
	.smt-language-switcher:not(.smt-floating-switcher) .smt-language-switcher__list {
		gap: 0.3rem;
		justify-content: flex-start;
	}

	.smt-language-switcher:not(.smt-floating-switcher) .smt-lang-link {
		min-height: 2.75rem;
		padding-inline: 0.8rem;
		font-size: 0.9rem;
	}

	.smt-floating-switcher {
		max-width: calc(100vw - max(20px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px) + 8px));
		padding-inline: 0.4rem;
	}

	.smt-floating-switcher .smt-language-switcher__list {
		flex-wrap: wrap;
		row-gap: 0.35rem;
		justify-content: center;
	}

	.smt-floating-switcher .smt-lang-link {
		min-height: 2.75rem;
	}
}
