/* NM Translate – modern floating language switcher */
.nmt_wrapper {
	--nmt-accent: #4f46e5;
	--nmt-accent-2: #06b6d4;
	--nmt-ink: #0f172a;
	--nmt-muted: #64748b;
	--nmt-surface: #ffffff;
	--nmt-line: #e8eaf0;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.nmt_wrapper *, .nmt_wrapper *::before, .nmt_wrapper *::after { box-sizing: border-box; }

.nmt_wrapper.nmt-pos-bottom-left  { position: fixed; bottom: 22px; left: 22px;  z-index: 99990; }
.nmt_wrapper.nmt-pos-bottom-right { position: fixed; bottom: 22px; right: 22px; z-index: 99990; }
.nmt_wrapper.nmt-pos-top-left     { position: fixed; top: 22px;    left: 22px;  z-index: 99990; }
.nmt_wrapper.nmt-pos-top-right    { position: fixed; top: 22px;    right: 22px; z-index: 99990; }
.nmt_wrapper.nmt-inline           { position: relative; display: inline-block; }

.nmt-switcher { position: relative; font-size: 14px; line-height: 1; }

/* Trigger pill */
.nmt-current {
	display: inline-flex; align-items: center; gap: 9px;
	background: var(--nmt-surface); color: var(--nmt-ink);
	border: 1px solid var(--nmt-line); border-radius: 999px;
	padding: 9px 14px; cursor: pointer; font-size: 14px; font-weight: 600;
	box-shadow: 0 4px 14px rgba(15,23,42,.12), 0 1px 2px rgba(15,23,42,.06);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
	-webkit-backdrop-filter: saturate(180%) blur(6px); backdrop-filter: saturate(180%) blur(6px);
}
.nmt-current:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,23,42,.18); border-color: #d7d9e3; }
.nmt-current:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,.35); }
.nmt-globe { color: var(--nmt-accent); flex: none; }
.nmt-caret { color: var(--nmt-muted); transition: transform .2s ease; }
.nmt-switcher.is-open .nmt-caret { transform: rotate(180deg); }

.nmt-flag { width: 22px; height: 15px; object-fit: cover; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: none; }
.nmt-name { white-space: nowrap; }

/* Dropdown panel */
.nmt-panel {
	position: absolute; min-width: 232px; width: max-content; max-width: 300px;
	background: var(--nmt-surface); border: 1px solid var(--nmt-line); border-radius: 16px;
	box-shadow: 0 18px 50px rgba(15,23,42,.22), 0 2px 8px rgba(15,23,42,.08);
	padding: 8px; opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98);
	transform-origin: top center; transition: opacity .18s ease, transform .18s ease, visibility .18s;
	z-index: 99991;
}
.nmt-switcher.is-open .nmt-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.nmt-open-up   .nmt-panel { bottom: calc(100% + 10px); transform-origin: bottom center; transform: translateY(-8px) scale(.98); }
.nmt-open-up   .nmt-switcher.is-open .nmt-panel { transform: translateY(0) scale(1); }
.nmt-open-down .nmt-panel { top: calc(100% + 10px); }

.nmt-pos-bottom-left .nmt-panel,  .nmt-pos-top-left .nmt-panel  { left: 0; }
.nmt-pos-bottom-right .nmt-panel, .nmt-pos-top-right .nmt-panel { right: 0; }
.nmt-inline .nmt-panel { left: 0; }

/* Search */
.nmt-search { padding: 4px 4px 8px; }
.nmt-search-input {
	width: 100%; border: 1px solid var(--nmt-line); border-radius: 10px; padding: 9px 12px;
	font-size: 13.5px; color: var(--nmt-ink); background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s;
}
.nmt-search-input:focus { outline: none; border-color: var(--nmt-accent); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.14); }

/* List */
.nmt-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.nmt-list::-webkit-scrollbar { width: 8px; }
.nmt-list::-webkit-scrollbar-thumb { background: #dcdfe8; border-radius: 8px; }

.nmt-item a {
	display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
	text-decoration: none; color: var(--nmt-ink); font-weight: 500; transition: background .12s ease;
}
.nmt-item a:hover { background: #f1f3f9; }
.nmt-item .nmt-name { flex: 1; }
.nmt-item.is-current a { background: linear-gradient(120deg, rgba(79,70,229,.10), rgba(6,182,212,.10)); color: var(--nmt-accent); font-weight: 700; }
.nmt-check { color: var(--nmt-accent); flex: none; }
.nmt-item.nmt-hide { display: none; }

.nmt-empty { padding: 14px 12px; color: var(--nmt-muted); font-size: 13px; text-align: center; }

/* Keep the widget LTR even on RTL pages so flags/text align predictably */
.nmt_wrapper[dir="ltr"] { direction: ltr; text-align: left; }

/* -------------------------------------------------------------------------
 * Theme-hardening. Site themes often force their own button/link/img styles
 * (borders, transparent backgrounds, square corners, uppercase). These high-
 * specificity !important rules keep the switcher looking right on any theme.
 * ---------------------------------------------------------------------- */
.nmt_wrapper .nmt-switcher .nmt-current {
	background: #ffffff !important;
	opacity: 1 !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	border: 1px solid rgba(15,23,42,.10) !important;
	border-radius: 999px !important;
	color: var(--nmt-ink) !important;
	padding: 9px 14px !important;
	box-shadow: 0 6px 20px rgba(15,23,42,.22), 0 0 0 1px rgba(255,255,255,.6) !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	width: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
}
.nmt_wrapper .nmt-panel { background: var(--nmt-surface) !important; border-radius: 16px !important; }
.nmt_wrapper .nmt-list { margin: 0 !important; padding: 0 !important; }
.nmt_wrapper .nmt-item { margin: 0 !important; list-style: none !important; }
.nmt_wrapper .nmt-item::before,
.nmt_wrapper .nmt-item::marker { content: none !important; }
.nmt_wrapper .nmt-item a {
	color: var(--nmt-ink) !important;
	text-decoration: none !important;
	border: 0 !important;
	background-image: none !important;
	box-shadow: none !important;
	text-transform: none !important;
	min-height: 0 !important;
}
.nmt_wrapper .nmt-item.is-current a { color: var(--nmt-accent) !important; }
.nmt_wrapper .nmt-flag {
	max-width: none !important;
	border-radius: 3px !important;
	box-shadow: 0 0 0 1px rgba(0,0,0,.08) !important;
	filter: none !important;
	vertical-align: middle !important;
}
.nmt_wrapper .nmt-search-input {
	background: #f8fafc !important;
	color: var(--nmt-ink) !important;
	border: 1px solid var(--nmt-line) !important;
	border-radius: 10px !important;
	width: 100% !important;
	text-transform: none !important;
}

/* Force the trigger onto a single row (themes can turn img/svg into block
 * elements, which wraps the pill into two lines — seen on mobile). */
.nmt_wrapper .nmt-switcher .nmt-current {
	display: inline-flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	gap: 9px !important;
	white-space: nowrap !important;
	max-width: none !important;
}
.nmt_wrapper .nmt-current > * { flex: 0 0 auto !important; margin: 0 !important; float: none !important; border: 0 !important; }
.nmt_wrapper .nmt-current .nmt-globe { width: 18px !important; height: 18px !important; display: inline-block !important; }
.nmt_wrapper .nmt-current .nmt-caret { width: 12px !important; height: 12px !important; display: inline-block !important; }
.nmt_wrapper .nmt-current .nmt-flag { width: 22px !important; height: 15px !important; display: inline-block !important; }
.nmt_wrapper .nmt-current .nmt-name { display: inline-block !important; }

/* Mobile: slightly tighter offsets and a compact pill. */
@media (max-width: 600px) {
	.nmt_wrapper.nmt-pos-bottom-left  { bottom: 14px !important; left: 14px !important; }
	.nmt_wrapper.nmt-pos-bottom-right { bottom: 14px !important; right: 14px !important; }
	.nmt_wrapper.nmt-pos-top-left     { top: 14px !important; left: 14px !important; }
	.nmt_wrapper.nmt-pos-top-right    { top: 14px !important; right: 14px !important; }
	.nmt_wrapper .nmt-switcher .nmt-current { padding: 8px 12px !important; font-size: 13px !important; }
	.nmt_wrapper .nmt-panel { max-width: calc(100vw - 28px) !important; }
}
