.lm-switcher {
	--lm-text: #3e3333;
	position: relative;
	display: inline-block;
	font-size: 14px;
	line-height: 1;
	z-index: 9999;
	color: var(--lm-text);
}

.lm-switcher__inner {
	position: relative;
}

.lm-switcher__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 1px solid #e0d8d8;
	border-radius: 0;
	background: #fff;
	color: var(--lm-text) !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: border-color 0.2s ease;
}

.lm-switcher__trigger:hover,
.lm-switcher__inner:focus-within .lm-switcher__trigger {
	border-color: #c8bcbc;
	color: var(--lm-text) !important;
	background: #fff;
}

.lm-switcher__flag,
.lm-switcher__flag-emoji {
	display: block;
	width: 20px;
	height: 15px;
	flex-shrink: 0;
	line-height: 15px;
	font-size: 15px;
	text-align: center;
	overflow: hidden;
}

.lm-switcher__code {
	color: var(--lm-text) !important;
	font-weight: 500;
	letter-spacing: 0;
}

.lm-switcher__chevron {
	flex-shrink: 0;
	color: var(--lm-text);
	opacity: 0.7;
	transition: transform 0.25s ease;
}

.lm-switcher__inner:hover .lm-switcher__chevron,
.lm-switcher__inner:focus-within .lm-switcher__chevron {
	transform: rotate(180deg);
}

.lm-switcher__menu {
	position: absolute;
	top: 100%;
	right: 0;
	left: auto;
	min-width: 100px;
	margin: 0;
	padding: 0;
	list-style: none;
	border-radius: 0;
	background: #fff;
	border: 1px solid #e0d8d8;
	box-shadow: 0 4px 16px rgba(62, 51, 51, 0.12);
	transform: translateY(4px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.lm-switcher__inner:hover .lm-switcher__menu,
.lm-switcher__inner:focus-within .lm-switcher__menu,
.lm-switcher__inner.is-open .lm-switcher__menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.lm-switcher__item {
	margin: 0;
	list-style: none;
}

.lm-switcher__link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 0;
	color: var(--lm-text) !important;
	text-decoration: none !important;
	background: #fff;
	transition: background 0.15s ease;
}

.lm-switcher__link:hover {
	background: #f5f0f0;
	color: var(--lm-text) !important;
	text-decoration: none !important;
}

.lm-switcher__item.is-active .lm-switcher__link {
	background: #f0eaea;
	font-weight: 600;
	color: var(--lm-text) !important;
}

.lm-switcher__label {
	color: var(--lm-text) !important;
	white-space: nowrap;
}

/* В пункте меню (мобилка) */
.menu-item-lm-switcher {
	list-style: none !important;
}

.menu-item-lm-switcher > a {
	display: none !important;
}

.menu-item-lm-switcher > .lm-switcher--menu {
	display: block;
	width: 100%;
	margin: 10px 0;
}

.menu-item-lm-switcher .lm-switcher__menu {
	left: 0;
	right: auto;
}

/* WoodMart ломает списки в меню — принудительно прячем выпадашку */
.wd-nav .menu-item-lm-switcher .lm-switcher__menu,
.mobile-pages-menu .menu-item-lm-switcher .lm-switcher__menu {
	display: block !important;
	position: absolute !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
}

.wd-nav .menu-item-lm-switcher .lm-switcher__inner:hover .lm-switcher__menu,
.wd-nav .menu-item-lm-switcher .lm-switcher__inner:focus-within .lm-switcher__menu,
.wd-nav .menu-item-lm-switcher .lm-switcher__inner.is-open .lm-switcher__menu,
.mobile-pages-menu .menu-item-lm-switcher .lm-switcher__inner:hover .lm-switcher__menu,
.mobile-pages-menu .menu-item-lm-switcher .lm-switcher__inner:focus-within .lm-switcher__menu,
.mobile-pages-menu .menu-item-lm-switcher .lm-switcher__inner.is-open .lm-switcher__menu {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

/* На ПК переключатель только в шапке, не в мобильном меню */
@media (min-width: 1024px) {
	.mobile-pages-menu .menu-item-lm-switcher {
		display: none !important;
	}
}

/* Legacy inline switcher */
.lm-language-switcher {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	font-size: 14px;
	line-height: 1.4;
	color: #3e3333;
}

.lm-language-switcher .lm-lang-item {
	color: #3e3333;
	text-decoration: none;
	opacity: 0.75;
	transition: opacity 0.2s ease;
}

.lm-language-switcher a.lm-lang-item:hover {
	opacity: 1;
	text-decoration: underline;
}

.lm-language-switcher .lm-lang-active {
	font-weight: 600;
	opacity: 1;
}
