/* ==========================================================================
   Language switcher
   Desktop: "🌐 ET ⌄" item in the dark main menu bar (next to the cart) + dropdown card.
   Mobile:  language list at the bottom of the slide-out menu panel.
   ========================================================================== */

/* --- desktop dropdown ---------------------------------------------------- */
.bm-lang--dropdown { position: relative; display: flex; align-items: center; margin: 0 0 0 26px; }

.bm-lang .bm-lang-toggle,
.bm-lang .bm-lang-toggle:hover,
.bm-lang .bm-lang-toggle:focus,
.bm-lang .bm-lang-toggle:active {
	/* reset the theme's global button styles (red fill, white text, 8px drop) */
	display: inline-flex; align-items: center; gap: 7px;
	height: 38px; margin: 0; padding: 0 12px !important; box-sizing: border-box;
	background: transparent !important; color: rgba(255, 255, 255, .86) !important;
	border: 1px solid rgba(255, 255, 255, .22) !important; border-radius: 999px;
	box-shadow: none !important; transform: none !important;
	font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: .03em; text-transform: none;
	cursor: pointer; transition: border-color .15s, color .15s !important;
}
.bm-lang .bm-lang-toggle:hover,
.bm-lang.open .bm-lang-toggle { border-color: #dc523b !important; color: #fff !important; }
.bm-lang .bm-lang-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bm-lang-globe { width: 16px; height: 16px; color: #dc523b; flex: none; display: block; }
.bm-lang-current { display: block; line-height: 1; }
.bm-lang-caret { width: 10px; height: 10px; flex: none; display: block; opacity: .8; transition: transform .15s; }
.bm-lang.open .bm-lang-caret { transform: rotate(180deg); }

.bm-lang-menu {
	position: absolute; top: calc(100% + 12px); right: -8px; z-index: 1000;
	width: 220px; padding: 8px; box-sizing: border-box;
	background: #fff; border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 1px 3px rgba(0, 0, 0, .1);
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.bm-lang-menu::before { /* bubble arrow */
	content: ""; position: absolute; top: -6px; right: 30px; width: 12px; height: 12px;
	background: #fff; transform: rotate(45deg); border-radius: 2px;
}
.bm-lang-menu::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* hover bridge */
.bm-lang.open .bm-lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease; }
@media (hover: hover) and (pointer: fine) {
	.bm-lang--dropdown:hover .bm-lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease; }
	.bm-lang--dropdown:hover .bm-lang-caret { transform: rotate(180deg); }
	.bm-lang--dropdown:hover .bm-lang-toggle { border-color: #dc523b !important; color: #fff !important; }
}

.bm-lang-head { margin: 4px 10px 6px; font-size: 12px; font-weight: 600; color: #767676; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
.bm-lang-menu a,
.bm-lang-menu a:visited {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 10px; border-radius: 8px;
	color: #1c1f21 !important; font-size: 15px; font-weight: 500; line-height: 22px; text-decoration: none; text-transform: none;
}
.bm-lang-menu a:hover, .bm-lang-menu a:focus-visible { background: #f4f4f4; outline: none; }
.bm-lang-menu a[aria-checked="true"] { background: #fdf0ed; font-weight: 700; }
.bm-lang-menu img, .bm-lang-chips img { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: none; }
.bm-lang-name { flex: 1; }
.bm-lang-check { width: 13px; height: 13px; color: #c34834; visibility: hidden; flex: none; }
.bm-lang-menu a[aria-checked="true"] .bm-lang-check { visibility: visible; }
.bm-lang-menu a[lang="ru"], .bm-lang-chips a[lang="ru"] { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

/* --- mobile list (inside the slide-out menu panel) ----------------------- */
.bm-lang-list { display: none; }

@media only screen and (max-width: 1000px) {
	.bm-lang--dropdown { display: none; }
	.bm-lang-list { display: block; padding: 22px 15px 30px; }
	.bm-lang-list-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #8b9095; }
	.bm-lang-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.bm-lang-chips a,
	.bm-lang-chips a:visited {
		display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; box-sizing: border-box;
		border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px;
		color: #fff !important; font-size: 15px; font-weight: 500; text-decoration: none; text-transform: none;
	}
	.bm-lang-chips a[aria-checked="true"] { border-color: #dc523b; background: rgba(220, 82, 59, .14); font-weight: 700; }
}

/* Google Translate's own UI stays hidden; we only use its engine. */
#bm_gt_element, .skiptranslate iframe, #goog-gt-tt, .goog-te-banner-frame, .goog-te-balloon-frame, .goog-te-spinner-pos { display: none !important; }
body { top: 0 !important; }
font[style] { background: transparent !important; box-shadow: none !important; }

@media (prefers-reduced-motion: reduce) {
	.bm-lang-menu, .bm-lang-caret { transition: none !important; }
}

/* Inside #site-navigation the theme's nav link rules (display:block etc.) load later – out-rank them. */
#site-navigation .bm-lang-menu a,
#site-navigation .bm-lang-menu a:visited {
	display: flex !important; align-items: center; gap: 10px; width: auto; padding: 8px 10px !important; margin: 0;
	line-height: 22px !important; font-size: 15px !important; color: #1c1f21 !important; text-transform: none !important;
}
#site-navigation .bm-lang-menu a:hover { background: #f4f4f4; }
#site-navigation .bm-lang-menu a[aria-checked="true"] { background: #fdf0ed; }
#site-navigation .bm-lang-menu img,
#site-navigation .bm-lang-chips img { display: block; position: static; margin: 0 !important; width: 22px !important; height: 16px !important; filter: none !important; opacity: 1 !important; }
#site-navigation .bm-lang-menu .bm-lang-name { flex: 1 1 auto; }
#site-navigation .bm-lang-menu .bm-lang-check { margin-left: auto; }
@media only screen and (max-width: 1000px) {
	#site-navigation .bm-lang-chips a,
	#site-navigation .bm-lang-chips a:visited {
		display: flex !important; align-items: center; gap: 10px; padding: 0 12px !important; margin: 0;
		min-height: 46px; line-height: 1.2 !important; font-size: 15px !important; color: #fff !important; text-transform: none !important;
	}
}

/* Optical centring in the toggle (measured at 4×): Kanit's tall line box puts the letters ~3px high. */
.bm-lang .bm-lang-current { position: relative; top: 3px; }
@supports (text-box: trim-both cap alphabetic) {
	.bm-lang .bm-lang-current { text-box: trim-both cap alphabetic; top: -1px; }
}
.bm-lang .bm-lang-caret { position: relative; top: -1px; }
.bm-lang .bm-lang-globe { position: relative; top: -.5px; }
