/* ============================================================
   Tekyroo Language Switcher — Frontend CSS  v1.3
   ============================================================ */

/* ── CSS variables (overridden by inline PHP) ─────────────── */
.tekyroo-switcher {
	--tkr-accent:      #6366f1;
	--tkr-bg:          #ffffff;
	--tkr-text:        #334155;
	--tkr-border:      #e2e8f0;
	--tkr-radius:      10px;
	--tkr-list-width:  180px;
	--tkr-shadow:      0 4px 20px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
	--tkr-transition:  .15s cubic-bezier(.4,0,.2,1);
}

/* ── Base container ───────────────────────────────────────── */
.tekyroo-switcher {
	position: relative;
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	z-index: 9990;
	vertical-align: middle;
	max-width: 100%;
}
.tekyroo-switcher *,
.tekyroo-switcher *::before,
.tekyroo-switcher *::after { box-sizing: border-box; }

/* ── Current-language button ──────────────────────────────── */
.tekyroo-current {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px;
	background: var(--tkr-bg);
	border: 1px solid var(--tkr-border);
	border-radius: var(--tkr-radius);
	cursor: pointer;
	min-height: 38px;
	color: var(--tkr-text);
	font-size: inherit;
	font-family: inherit;
	white-space: nowrap;
	transition: border-color var(--tkr-transition), box-shadow var(--tkr-transition), background var(--tkr-transition);
	outline: none;
	user-select: none;
}
.tekyroo-current:hover {
	border-color: var(--tkr-accent);
	box-shadow: 0 0 0 3px rgba(99,102,241,.15);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tkr-accent) 15%, transparent);
}
.tekyroo-current:focus-visible {
	border-color: var(--tkr-accent);
	box-shadow: 0 0 0 3px rgba(99,102,241,.25);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tkr-accent) 25%, transparent);
}
.tekyroo-dropdown.is-open .tekyroo-current {
	border-color: var(--tkr-accent);
	box-shadow: 0 0 0 3px rgba(99,102,241,.15);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tkr-accent) 15%, transparent);
}

/* ── Flag (CSS flag-icons or emoji fallback) ──────────────── */
.tekyroo-flag {
	font-size: 1.15em;
	line-height: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.2em;
}
/* CSS flag-icons sizing inside switcher (legacy .fi fallback) */
.tekyroo-flag.fi {
	width: 1.33em;
	height: 1em;
	font-size: 1em;
	border-radius: 2px;
	background-size: cover;
	background-position: center;
}
/* Image flags (primary) — bulletproof against CSS-optimization plugins */
.tekyroo-flag-img {
	width: 1.4em;
	height: 1.05em;
	border-radius: 2px;
	object-fit: cover;
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
/* Emoji flags: force color emoji rendering on all platforms */
.tekyroo-flag-emoji {
	font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji",
	             "Twemoji Mozilla", "EmojiOne Color", sans-serif;
	min-width: 1.4em;
}

/* ── Chevron ──────────────────────────────────────────────── */
.tekyroo-chevron {
	flex-shrink: 0;
	transition: transform var(--tkr-transition);
	color: #94a3b8;
	margin-left: 2px;
}
.tekyroo-dropdown.is-open .tekyroo-chevron {
	transform: rotate(180deg);
	color: var(--tkr-accent);
}

/* ── Hover-open mode ─────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
	.tekyroo-hover-open:hover .tekyroo-list {
		display: block !important;
	}
	.tekyroo-hover-open:hover .tekyroo-chevron {
		transform: rotate(180deg);
		color: var(--tkr-accent);
	}
}

/* ── Dropdown list ────────────────────────────────────────── */
.tekyroo-list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: max(var(--tkr-list-width), 100%);
	margin: 0;
	padding: 5px;
	list-style: none;
	background: var(--tkr-bg);
	border: 1px solid var(--tkr-border);
	border-radius: calc(var(--tkr-radius) + 2px);
	box-shadow: var(--tkr-shadow);
	max-height: 280px;
	overflow-y: auto;
	overflow-x: hidden;
	z-index: 9991;
	white-space: nowrap;
	/* Animate open */
	transform-origin: top left;
	animation: tkrDropIn .14s cubic-bezier(.4,0,.2,1) both;
}
/* Flip up when near bottom of viewport — toggled by JS */
.tekyroo-list.tkr-flip-up {
	top: auto;
	bottom: calc(100% + 6px);
	transform-origin: bottom left;
	animation: tkrDropInUp .14s cubic-bezier(.4,0,.2,1) both;
}
/* Right-align when overflowing right edge */
.tekyroo-list.tkr-align-right {
	left: auto;
	right: 0;
	transform-origin: top right;
}
.tekyroo-list.tkr-flip-up.tkr-align-right {
	transform-origin: bottom right;
}
.tekyroo-list[hidden] { display: none !important; }
.tekyroo-list li { margin: 0; padding: 0; list-style: none; }

@keyframes tkrDropIn {
	from { opacity: 0; transform: translateY(-6px) scale(.97); }
	to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes tkrDropInUp {
	from { opacity: 0; transform: translateY(6px)  scale(.97); }
	to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── Switcher loading state (during language switch navigation) ── */
.tekyroo-current.is-loading {
	opacity: .65;
	pointer-events: none;
	cursor: wait;
}
.tekyroo-current.is-loading .tekyroo-chevron { display: none; }
.tekyroo-current.is-loading::after {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid var(--tkr-border);
	border-top-color: var(--tkr-accent);
	border-radius: 50%;
	animation: tkrSpin .6s linear infinite;
	margin-left: 6px;
	flex-shrink: 0;
}
@keyframes tkrSpin { to { transform: rotate(360deg); } }

/* ── In-progress language item (translation running) ─────── */
.tekyroo-lang-option[data-translating="1"] {
	opacity: .55;
	cursor: default;
	pointer-events: none;
}
.tekyroo-lang-option[data-translating="1"] .tekyroo-opt-name::after {
	content: ' ⏳';
	font-size: .75em;
	opacity: .7;
}

/* ── Option items ─────────────────────────────────────────── */
.tekyroo-lang-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	cursor: pointer;
	min-height: 38px;
	border-radius: calc(var(--tkr-radius) - 2px);
	font-size: 13.5px;
	color: var(--tkr-text);
	text-decoration: none;
	transition: background var(--tkr-transition), color var(--tkr-transition);
	width: 100%;
}
.tekyroo-lang-option:hover {
	background: #f1f5f9;
	color: #1e293b;
	text-decoration: none;
}
.tekyroo-lang-option:focus-visible {
	outline: none;
	background: #f1f5f9;
}
.tekyroo-lang-option.tekyroo-lang-active {
	background: rgba(99,102,241,.08);
	background: color-mix(in srgb, var(--tkr-accent) 8%, transparent);
	color: var(--tkr-accent);
	font-weight: 600;
}
.tekyroo-lang-option.tekyroo-lang-active:hover {
	background: rgba(99,102,241,.14);
	background: color-mix(in srgb, var(--tkr-accent) 14%, transparent);
}

/* Option name fills remaining space so checkmark goes far right */
.tekyroo-opt-name { flex: 1; }

/* Checkmark icon */
.tekyroo-check {
	flex-shrink: 0;
	color: var(--tkr-accent);
	opacity: .85;
	margin-left: auto;
}

/* ── Flags row style ──────────────────────────────────────── */
.tekyroo-flags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.tekyroo-flag-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--tkr-radius);
	text-decoration: none;
	color: var(--tkr-text);
	min-height: 38px;
	min-width: 48px;      /* never collapses to a tiny dot */
	font-size: 14px;
	border: 1px solid transparent;
	background: transparent;
	white-space: nowrap;  /* prevent text wrapping inside the item */
	transition: background var(--tkr-transition), border-color var(--tkr-transition), transform var(--tkr-transition);
}
.tekyroo-flag-item:hover {
	background: #f1f5f9;
	border-color: var(--tkr-border);
	text-decoration: none;
}
.tekyroo-flag-item.tekyroo-active {
	background: var(--tkr-accent);
	color: #fff;
	border-color: var(--tkr-accent);
}
.tekyroo-flag-item:focus-visible {
	outline: 2px solid var(--tkr-accent);
	outline-offset: 2px;
}

/* ── Vertical list style ──────────────────────────────────── */
.tekyroo-list-style .tekyroo-lang-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.tekyroo-list-style .tekyroo-lang-list li { margin: 0; }
.tekyroo-list-style .tekyroo-lang-list a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	text-decoration: none;
	color: var(--tkr-text);
	min-height: 38px;
	border-radius: 6px;
	font-size: 14px;
	transition: background var(--tkr-transition);
}
.tekyroo-list-style .tekyroo-lang-list a:hover { background: #f1f5f9; text-decoration: none; }
.tekyroo-list-style .tekyroo-active a {
	background: color-mix(in srgb, var(--tkr-accent) 8%, transparent);
	color: var(--tkr-accent);
	font-weight: 600;
}
.tekyroo-list-style .tekyroo-lang-list a:focus-visible {
	outline: 2px solid var(--tkr-accent);
	outline-offset: 2px;
}

/* ── Pills style ──────────────────────────────────────────── */
.tekyroo-pills .tekyroo-flag-item {
	border-color: var(--tkr-border);
	background: var(--tkr-bg);
}
.tekyroo-pills .tekyroo-flag-item.tekyroo-active {
	background: var(--tkr-accent);
	border-color: var(--tkr-accent);
	color: #fff;
}

/* ── Native select style ──────────────────────────────────── */
.tekyroo-select-style {
	position: relative;   /* anchor for the flag img + custom arrow */
	display: inline-flex;
	align-items: center;
}
/* Absolute-positioned real flag image inside the select wrapper.
   Because <option> can't render HTML, we render the flag outside the
   <select> and use padding-left on the select to reveal it. */
.tekyroo-select-style .tkr-select-flag {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 2;
	flex-shrink: 0;
}
/* Custom chevron arrow (only visible when appearance:none is active) */
.tekyroo-select-style .tkr-select-arrow {
	position: absolute;
	right: 9px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	color: var(--tkr-text, #334155);
	opacity: .55;
	display: none; /* hidden by default; shown when appearance:none is applied */
}
.tekyroo-select-style .tekyroo-native-select {
	min-height: 38px;
	padding: 7px 32px 7px 12px;
	border: 1px solid var(--tkr-border);
	border-radius: var(--tkr-radius);
	background: var(--tkr-bg);
	color: var(--tkr-text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	appearance: auto;
	transition: border-color var(--tkr-transition), box-shadow var(--tkr-transition);
}
/* When a flag image is rendered beside the select, add left padding */
.tekyroo-select-style .tekyroo-native-select.has-flag {
	padding-left: 38px;
}
.tekyroo-select-style .tekyroo-native-select:hover {
	border-color: var(--tkr-accent);
}
.tekyroo-select-style .tekyroo-native-select:focus {
	outline: none;
	border-color: var(--tkr-accent);
	box-shadow: 0 0 0 3px rgba(99,102,241,.20);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tkr-accent) 20%, transparent);
}

/* ── Floating button (fixed position) ────────────────────── */
.tekyroo-floating-wrap {
	position: fixed;
	/* bottom/right defaults — overridden by PHP inline style from settings */
	bottom: 24px;
	right: 24px;
	top: auto;
	left: auto;
	z-index: 100001; /* above WP admin bar (99999) */
	filter: drop-shadow(0 4px 12px rgba(0,0,0,.18));
}
/* Give the floating dropdown extra lift */
.tekyroo-floating-wrap .tekyroo-list {
	z-index: 100002;
}
/* Compact button style when floating */
.tekyroo-floating-wrap .tekyroo-current {
	border-radius: 999px;
	padding: 9px 16px;
	box-shadow: 0 4px 14px rgba(0,0,0,.15);
	font-weight: 500;
}

/* ── Menu integration ─────────────────────────────────────── */
.tekyroo-menu-item {
	display: inline-flex !important;
	align-items: center !important;
	list-style: none !important;
	flex-shrink: 0 !important;
	float: none !important;
	padding: 0 !important;
	margin: 0 !important;
	background: none !important;
	border: none !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
}
/* Kill any theme ::before/::after decorators on the menu item itself */
.tekyroo-menu-item::before,
.tekyroo-menu-item::after { display: none !important; content: none !important; }

.tekyroo-menu-item .tekyroo-switcher {
	display: inline-block !important;
	vertical-align: middle !important;
	margin: 0 !important;
	float: none !important;
	width: auto !important;
	max-width: none !important;
}
/* Ensure theme's "li > a" rules don't collapse the button */
.tekyroo-menu-item .tekyroo-current {
	display: inline-flex !important;
	width: auto !important;
	min-width: max-content;
	padding: 7px 12px !important;
	box-sizing: border-box !important;
	text-indent: 0 !important;
	text-align: left !important;
	line-height: 1.4 !important;
	letter-spacing: normal !important;
	font-size: inherit;
}
/* Nav active-indicator lines that themes inject */
.tekyroo-menu-item .tekyroo-current::before,
.tekyroo-menu-item .tekyroo-current::after { display: none !important; content: none !important; }

/* Flags/pills in nav — never collapse to tiny circles */
.tekyroo-menu-item .tekyroo-flag-item {
	display: inline-flex !important;
	align-items: center !important;
	min-width: max-content !important;
	min-height: 32px !important;
	padding: 5px 10px !important;
	white-space: nowrap !important;
	text-indent: 0 !important;
	line-height: 1.4 !important;
	box-sizing: border-box !important;
}
/* Text spans inside switcher items must never be zero-width */
.tekyroo-menu-item .tekyroo-name,
.tekyroo-menu-item .tekyroo-opt-name {
	display: inline !important;
	visibility: visible !important;
	overflow: visible !important;
	clip: auto !important;
	width: auto !important;
	height: auto !important;
	font-size: .85em !important;
	white-space: nowrap !important;
}

/* is-loading and tkrSpin defined earlier — no duplicate needed */

/* ── Theme: dark ──────────────────────────────────────────── */
.tekyroo-theme-dark {
	--tkr-bg:     #111827;
	--tkr-text:   #f1f5f9;
	--tkr-border: #374151;
}
.tekyroo-theme-dark .tekyroo-lang-option:hover,
.tekyroo-theme-dark .tekyroo-list-style .tekyroo-lang-list a:hover {
	background: #1f2937;
}
.tekyroo-theme-dark .tekyroo-flag-item:hover {
	background: #1f2937;
	border-color: #4b5563;
}
.tekyroo-theme-dark .tekyroo-current:hover,
.tekyroo-theme-dark .tekyroo-dropdown.is-open .tekyroo-current {
	border-color: var(--tkr-accent);
	background: #1f2937;
}

/* ── Theme: brand (accent color button, white dropdown) ───── */
/* Button uses accent bg + white text (set via PHP CSS vars) */
.tekyroo-theme-brand .tekyroo-current:hover,
.tekyroo-theme-brand .tekyroo-dropdown.is-open .tekyroo-current {
	background: rgba(255,255,255,.1);
	border-color: rgba(255,255,255,.4);
	box-shadow: 0 0 0 3px rgba(255,255,255,.15);
}
/* Dropdown list: always white for readability regardless of accent */
.tekyroo-theme-brand .tekyroo-list {
	background: #ffffff;
	border-color: #e2e8f0;
}
.tekyroo-theme-brand .tekyroo-lang-option {
	color: #334155;
}
.tekyroo-theme-brand .tekyroo-lang-option:hover,
.tekyroo-theme-brand .tekyroo-list-style .tekyroo-lang-list a:hover {
	background: #f1f5f9;
	color: #1e293b;
}
.tekyroo-theme-brand .tekyroo-lang-option.tekyroo-lang-active {
	background: rgba(99,102,241,.08);
	background: color-mix(in srgb, var(--tkr-accent) 8%, transparent);
	color: var(--tkr-accent);
}
.tekyroo-theme-brand .tekyroo-lang-option.tekyroo-lang-active:hover {
	background: rgba(99,102,241,.14);
	background: color-mix(in srgb, var(--tkr-accent) 14%, transparent);
}
/* Flags/pills in brand theme */
.tekyroo-theme-brand .tekyroo-flag-item:hover {
	background: rgba(255,255,255,.15);
	border-color: rgba(255,255,255,.3);
}

/* ── Theme: custom — inherits from CSS vars set inline ───── */
/* (No extra overrides needed; CSS vars handle all colors.) */

/* ── Theme: transparent — blends into parent nav/header ─── */
/*
 * Removes all box / border / background from the button so the
 * switcher looks like a native nav-menu item. Ideal for "Navigation
 * Menu" placement where the theme already styles the menu bar.
 * The dropdown list keeps a solid white background for readability.
 */
.tekyroo-theme-transparent .tekyroo-current {
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: inherit;
	transition: background .15s ease;
}
.tekyroo-theme-transparent .tekyroo-current:hover,
.tekyroo-theme-transparent .tekyroo-dropdown.is-open .tekyroo-current {
	background: rgba(0,0,0,.07) !important;
	border-color: transparent !important;
}
.tekyroo-theme-transparent .tekyroo-chevron {
	color: currentColor;
	opacity: .55;
}
.tekyroo-theme-transparent .tekyroo-name {
	color: inherit;
}
/* Flags / pills / list styles */
.tekyroo-theme-transparent .tekyroo-flag-item {
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: inherit;
}
.tekyroo-theme-transparent .tekyroo-flag-item:hover {
	background: rgba(0,0,0,.07) !important;
	border-color: transparent !important;
}
.tekyroo-theme-transparent .tekyroo-flag-item.tekyroo-active {
	background: rgba(0,0,0,.1) !important;
	color: inherit;
}
/* Dropdown list: always solid for readability */
.tekyroo-theme-transparent .tekyroo-list {
	background: #ffffff;
	border-color: #e2e8f0;
	box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.tekyroo-theme-transparent .tekyroo-lang-option { color: #334155; }
.tekyroo-theme-transparent .tekyroo-lang-option:hover { background: #f1f5f9; }
.tekyroo-theme-transparent .tekyroo-lang-option.tekyroo-lang-active {
	background: color-mix(in srgb, var(--tkr-accent) 8%, transparent);
	color: var(--tkr-accent);
}
/* Native select */
/* Transparent select: force appearance:none so the browser/OS cannot override
   the background with its native white-box rendering. We then draw our own
   chevron arrow via the .tkr-select-arrow SVG injected in render_select(). */
.tekyroo-theme-transparent .tekyroo-native-select {
	appearance: none !important;
	-webkit-appearance: none !important;
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: inherit;
	padding-right: 24px; /* space for the custom SVG arrow */
}
.tekyroo-theme-transparent .tekyroo-select-style .tkr-select-arrow {
	display: block; /* show custom arrow when appearance:none is active */
	color: currentColor;
}

/* Same treatment when the select is inside a transparent top bar */
.tekyroo-top-bar--transparent .tekyroo-native-select {
	appearance: none !important;
	-webkit-appearance: none !important;
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: inherit;
	padding-right: 24px;
}
.tekyroo-top-bar--transparent .tekyroo-select-style .tkr-select-arrow {
	display: block;
	color: currentColor;
}
/* After scroll (frosted state) the text becomes dark */
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-native-select {
	color: #334155;
}

/* ── Sizes ────────────────────────────────────────────────── */
.tekyroo-size-small { font-size: 12px; }
.tekyroo-size-small .tekyroo-current,
.tekyroo-size-small .tekyroo-flag-item,
.tekyroo-size-small .tekyroo-lang-option,
.tekyroo-size-small .tekyroo-lang-list a { min-height: 30px; padding: 5px 9px; }

.tekyroo-size-large { font-size: 16px; }
.tekyroo-size-large .tekyroo-current,
.tekyroo-size-large .tekyroo-flag-item,
.tekyroo-size-large .tekyroo-lang-option,
.tekyroo-size-large .tekyroo-lang-list a { min-height: 46px; padding: 10px 16px; }

/* ── Shapes ───────────────────────────────────────────────── */
.tekyroo-shape-square { --tkr-radius: 3px; }
.tekyroo-shape-pill   .tekyroo-current,
.tekyroo-shape-pill   .tekyroo-flag-item,
.tekyroo-shape-pill   .tekyroo-native-select { border-radius: 999px; }

/* ── Shadows ──────────────────────────────────────────────── */
.tekyroo-no-shadow .tekyroo-list    { box-shadow: none; }
.tekyroo-no-shadow .tekyroo-current { box-shadow: none; }

/* ── RTL ──────────────────────────────────────────────────── */
[dir="rtl"] .tekyroo-switcher { direction: rtl; }
[dir="rtl"] .tekyroo-list     { left: auto; right: 0; transform-origin: top right; }
[dir="rtl"] .tekyroo-list.tkr-align-right { left: 0; right: auto; }
/*
 * RTL floating: PHP inline style handles exact coordinates.
 * This rule only applies when PHP hasn't set a position (edge case).
 */
[dir="rtl"] .tekyroo-floating-wrap:not([style]) { right: auto; left: 24px; }

/* ── Mobile-only floating: hide on desktop, show on mobile ── */
.tekyroo-float-mobile-only .tekyroo-floating-wrap {
	display: none;
}
@media (max-width: 1024px) {
	.tekyroo-float-mobile-only .tekyroo-floating-wrap {
		display: block;
	}
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
	.tekyroo-list { min-width: 160px; max-width: calc(100vw - 24px); }
	.tekyroo-floating-wrap { bottom: 16px; right: 16px; }
	[dir="rtl"] .tekyroo-floating-wrap { right: auto; left: 16px; }
}

/* ── Scrollbar inside dropdown ────────────────────────────── */
.tekyroo-list::-webkit-scrollbar { width: 5px; }
.tekyroo-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.tekyroo-list::-webkit-scrollbar-track { background: transparent; }

/* ── Top bar ──────────────────────────────────────────────── */
.tekyroo-top-bar {
	width: 100%;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100003; /* above WP admin bar (99999) and theme sticky headers */
	box-sizing: border-box;
}
/* Push below WP admin bar when logged in */
.admin-bar .tekyroo-top-bar { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .tekyroo-top-bar { top: 46px; }
}
.tekyroo-top-bar__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 5px 20px;   /* vertical padding so switcher has breathing room */
	min-height: 38px;
	max-width: 1400px;
	margin: 0 auto;
	gap: 10px;
}
/* Extra gap below the top-bar wrapper so it doesn't crowd the element immediately below */
.tekyroo-top-bar:not(.tekyroo-top-bar--transparent):not(.tekyroo-top-bar--invisible) {
	padding-bottom: 2px;
}
[dir="rtl"] .tekyroo-top-bar__inner { justify-content: flex-start; }
/* Compact switcher sizing inside the bar */
.tekyroo-top-bar .tekyroo-switcher { font-size: 13px; }
.tekyroo-top-bar .tekyroo-current {
	min-height: 26px !important;
	padding: 3px 10px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
}
.tekyroo-top-bar .tekyroo-flag-item {
	min-height: 26px !important;
	padding: 3px 10px !important;
	font-size: 13px !important;
}
.tekyroo-top-bar .tekyroo-native-select {
	min-height: 26px !important;
	padding: 3px 28px 3px 10px !important;
	font-size: 13px !important;
}
.tekyroo-top-bar .tekyroo-list { top: calc(100% + 3px); }

/* ── Top bar background variants ──────────────────────────── */
/* Light (default) — already defined above */

/* Dark */
.tekyroo-top-bar--dark {
	background: #0f172a;
	border-bottom-color: #1e293b;
}
.tekyroo-top-bar--dark .tekyroo-current {
	color: #f1f5f9;
	border-color: #334155;
	background: transparent;
}
.tekyroo-top-bar--dark .tekyroo-flag-item { color: #cbd5e1; }
.tekyroo-top-bar--dark .tekyroo-flag-item.tekyroo-active { background: rgba(255,255,255,.15); color: #fff; }
.tekyroo-top-bar--dark .tekyroo-flag-item:hover { background: rgba(255,255,255,.08); }
.tekyroo-top-bar--dark .tekyroo-name { color: #e2e8f0; }
.tekyroo-top-bar--dark .tekyroo-list { background: #1e293b; border-color: #334155; }
.tekyroo-top-bar--dark .tekyroo-lang-option { color: #e2e8f0; }
.tekyroo-top-bar--dark .tekyroo-lang-option:hover { background: #334155; }

/* ── Transparent top bar — scroll-aware ───────────────────── */
/*
 * Phase 1 (scroll = 0, over hero): completely invisible.
 *   - Wrapper: transparent background, no border, no shadow.
 *   - Button : no background — only the flag/text floats over the page.
 * Phase 2 (scrolled > 60px): frosted-glass button appears.
 *   - The class `.tkr-bar-scrolled` is added by frontend.js.
 *   - This is the "Apple / Airbnb" scroll-aware pattern.
 */
.tekyroo-top-bar--transparent {
	background: transparent !important;
	border-bottom: none !important;
	box-shadow: none !important;
	/* Smooth transition for background appearance on scroll */
	transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
	/*
	 * CRITICAL: pass ALL clicks through the transparent bar to the content below
	 * (theme nav links, hero CTAs, logo, etc.). Without this the invisible bar
	 * intercepts every click in the top ~44px of the page even though it is fully
	 * transparent — making theme navigation completely unresponsive.
	 * Individual switcher elements re-enable pointer events below.
	 */
	pointer-events: none;
}
.tekyroo-top-bar--transparent .tekyroo-top-bar__inner {
	pointer-events: none; /* inherit none from parent */
}
/* The actual switcher widget must stay interactive */
.tekyroo-top-bar--transparent .tekyroo-switcher {
	pointer-events: auto;
}
/* Phase 2 — once the frosted button is visible, the whole bar is interactive */
.tekyroo-top-bar--transparent.tkr-bar-scrolled {
	pointer-events: auto;
}
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-top-bar__inner {
	pointer-events: auto;
}

/* Phase 1 — at the very top of the page: button is invisible too */
.tekyroo-top-bar--transparent .tekyroo-current {
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: #fff;  /* assume hero has dark/image bg — use white text */
	transition: background .25s ease, border-color .25s ease, color .2s ease;
}
.tekyroo-top-bar--transparent .tekyroo-chevron {
	color: rgba(255,255,255,.8);
}
.tekyroo-top-bar--transparent .tekyroo-flag-item {
	background: transparent !important;
	border-color: transparent !important;
	color: #fff;
	transition: background .2s ease;
}
.tekyroo-top-bar--transparent .tekyroo-flag-item:hover {
	background: rgba(255,255,255,.15) !important;
}
.tekyroo-top-bar--transparent .tekyroo-name {
	color: #fff;
}

/* Phase 2 — user has scrolled: frosted button appears */
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-current {
	background: rgba(255,255,255,.88) !important;
	border-color: rgba(0,0,0,.1) !important;
	color: #334155 !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 1px 8px rgba(0,0,0,.08) !important;
}
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-chevron {
	color: #94a3b8;
}
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-flag-item {
	background: rgba(255,255,255,.88) !important;
	border-color: rgba(0,0,0,.06) !important;
	color: #334155;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.tekyroo-top-bar--transparent.tkr-bar-scrolled .tekyroo-name {
	color: #334155;
}

/* Hero color variant: dark text for light/white hero backgrounds */
.tekyroo-top-bar--transparent.tkr-bar-hero-dark .tekyroo-current {
	color: #1e293b;
}
.tekyroo-top-bar--transparent.tkr-bar-hero-dark .tekyroo-chevron {
	color: rgba(30,41,59,.5);
}
.tekyroo-top-bar--transparent.tkr-bar-hero-dark .tekyroo-flag-item {
	color: #1e293b;
}
.tekyroo-top-bar--transparent.tkr-bar-hero-dark .tekyroo-name {
	color: #1e293b;
}

/* Dropdown list: always readable */
.tekyroo-top-bar--transparent .tekyroo-list {
	background: #fff;
	border-color: #e2e8f0;
	box-shadow: 0 4px 20px rgba(0,0,0,.14);
	backdrop-filter: none;
}
.tekyroo-top-bar--transparent .tekyroo-lang-option { color: #334155; }
.tekyroo-top-bar--transparent .tekyroo-lang-option:hover { background: #f1f5f9; }
.tekyroo-top-bar--transparent .tekyroo-flag-item.tekyroo-active {
	background: var(--tkr-accent, #6366f1) !important;
	color: #fff !important;
}

/* ── Invisible — wrapper has zero visual presence ─────────── */
.tekyroo-top-bar--invisible {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	min-height: 0 !important;
	padding: 0 !important;
}
.tekyroo-top-bar--invisible .tekyroo-top-bar__inner {
	padding: 4px 16px !important;
	min-height: 0 !important;
}
.tekyroo-top-bar--invisible.tekyroo-top-bar--zero-height {
	height: 0 !important;
	overflow: visible !important;
}

/* Invisible — wrapper has zero visual presence; ONLY the switcher widget shows.
   Use this when the theme already handles the bar area styling.
   Paste the selector below into Tekyroo → Settings → UI → Custom CSS,
   or set Top Bar Background = "transparent" and add the extra rule there. */
.tekyroo-top-bar--invisible {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	/* Collapse to just the height of the switcher — removes the empty space */
	min-height: 0 !important;
	padding: 0 !important;
}
.tekyroo-top-bar--invisible .tekyroo-top-bar__inner {
	padding: 4px 16px !important;
	min-height: 0 !important;
}
/* If you want ZERO height (switcher floats over content), use: */
.tekyroo-top-bar--invisible.tekyroo-top-bar--zero-height {
	height: 0 !important;
	overflow: visible !important;
}

/* ── Translation progress badge ──────────────────────────── */
.tkr-lang-progress {
	margin-left: auto;
	font-size: 10px;
	font-weight: 600;
	color: var(--tkr-accent);
	opacity: .7;
	white-space: nowrap;
	flex-shrink: 0;
	letter-spacing: -.2px;
}
.tekyroo-lang-option.tekyroo-lang-active .tkr-lang-progress {
	opacity: 0; /* hide % for active language (it's 100% obviously) */
}

/* ── Copy-URL button ─────────────────────────────────────── */
.tkr-copy-url {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 4px;
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s, background .15s;
	flex-shrink: 0;
	background: none;
	border: none;
	color: #94a3b8;
	padding: 0;
}
.tekyroo-lang-option:hover .tkr-copy-url,
.tekyroo-flag-item:hover .tkr-copy-url {
	opacity: 1;
}
.tkr-copy-url:hover {
	background: #e2e8f0;
	color: var(--tkr-accent);
}
.tkr-copy-url.tkr-copied {
	color: #22c55e;
	opacity: 1;
}
.tkr-copy-url svg { pointer-events: none; }

/* ── Keyboard shortcut hint (shown on focus) ─────────────── */
.tekyroo-kb-hint {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: #1e293b;
	color: #fff;
	font-size: 11px;
	padding: 3px 7px;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s;
	z-index: 9999;
}
.tekyroo-kb-hint::after {
	content: '';
	position: absolute;
	top: 100%;
	right: 12px;
	border: 5px solid transparent;
	border-top-color: #1e293b;
}
.tekyroo-dropdown:focus-within .tekyroo-kb-hint { opacity: 1; }

/* ── Free-tier notice banner ──────────────────────────────── */
.tekyroo-free-notice {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 100000;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	font-size: 13px;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 -2px 12px rgba(0,0,0,.15);
}
.tekyroo-free-notice a {
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
}
.tekyroo-free-notice-close {
	margin-left: auto;
	cursor: pointer;
	opacity: .7;
	background: none;
	border: none;
	color: #fff;
	font-size: 18px;
	line-height: 1;
	padding: 2px 6px;
	flex-shrink: 0;
}
.tekyroo-free-notice-close:hover { opacity: 1; }
