/* 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; }
