/*!
 * jansmidl-translate widget — v1.1.0 redesign
 *
 * Cíle:
 *   - Subtle, ne CTA-like (překlad je sekundární akce, ne hlavní)
 *   - Brand-agnostic — funguje na webu s jakoukoli barvou theme
 *   - Theme-override safety net (Astra a další pluginy překreslí buttons na magentu;
 *     `html body` + `!important` to neutralizuje)
 *   - Compact, decentní, profi look
 */

/* ── Sticky kontejner ─────────────────────────────────────────────────── */
html .jst-widget--sticky {
	position: fixed !important;
	left: 16px;
	bottom: 16px;
	z-index: 9990;
}

/* ── Toggle (sticky) — pilulka s ikonou + textem ──────────────────────── */
html body button.jst-toggle,
html body .jst-toggle {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	padding: 10px 16px 10px 14px !important;
	min-height: 42px;
	background: #022A51 !important; /* deep navy — neutral, ne hlavní brand */
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	box-shadow: 0 4px 14px rgba(2, 42, 81, 0.22) !important;
	transition: background .15s, transform .15s, box-shadow .15s !important;
	text-transform: none !important;
	letter-spacing: 0.01em !important;
	line-height: 1 !important;
	position: relative;
}
html body .jst-toggle:hover,
html body .jst-toggle:focus {
	background: #2F6BB0 !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 6px 18px rgba(2, 42, 81, 0.30) !important;
	color: #fff !important;
}
html body .jst-toggle svg {
	display: block !important;
	width: 18px;
	height: 18px;
	stroke: currentColor !important;
	flex-shrink: 0;
}
html body .jst-toggle__label {
	display: inline-block !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em !important;
	line-height: 1 !important;
}

/* Sticky toggle ukáže badge s aktuálním jazykem, když je překlad aktivní. */
html body .jst-toggle::after {
	content: attr(data-jst-active-lang);
	position: absolute;
	bottom: -2px;
	right: -2px;
	background: #1B7A4B;
	color: #fff;
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: 0.04em;
	padding: 2px 5px;
	border-radius: 999px;
	line-height: 1.2;
	text-transform: uppercase;
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
	pointer-events: none;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity .15s, transform .15s;
}
html body .jst-toggle[data-jst-active-lang]:not([data-jst-active-lang=""]):after {
	opacity: 1;
	transform: scale(1);
}

/* ── Panel ────────────────────────────────────────────────────────────── */
.jst-panel {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 0;
	min-width: 240px;
	background: #fff;
	border: 1px solid rgba(2, 42, 81, 0.08);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(2, 42, 81, 0.14);
	padding: 14px 12px 12px;
	font-family: inherit;
}
.jst-widget--inline .jst-panel {
	position: static;
	margin-top: 10px;
}
.jst-panel__intro {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(2, 42, 81, 0.55);
	margin: 2px 6px 10px;
}

/* ── Seznam jazyků ────────────────────────────────────────────────────── */
.jst-list {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.jst-list li { margin: 0 !important; padding: 0 !important; }
.jst-list li::before { display: none !important; } /* zruš případné theme bullets */

/* Vlajka jako řádek — flat, ne tlačítko. */
html body button.jst-link,
html body .jst-link {
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	background: transparent !important;
	border: 0 !important;
	padding: 8px 10px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: #022A51 !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	text-align: left !important;
	text-decoration: none !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1.3 !important;
	box-shadow: none !important;
	transition: background .12s;
}
html body .jst-link:hover,
html body .jst-link:focus {
	background: rgba(47, 107, 176, 0.08) !important;
	color: #022A51 !important;
}
html body .jst-link[data-jst-active="true"] {
	background: rgba(27, 122, 75, 0.10) !important;
	font-weight: 700 !important;
}
html body .jst-link[data-jst-active="true"]::after {
	content: "✓";
	margin-left: auto;
	color: #1B7A4B;
	font-weight: 800;
}
.jst-link__flag {
	font-size: 18px !important;
	line-height: 1 !important;
	width: 22px;
	flex-shrink: 0;
}
.jst-link__name {
	flex: 1;
	min-width: 0;
}

/* Reset (Original) — separator + textový link */
.jst-list__reset {
	border-top: 1px solid rgba(2, 42, 81, 0.08);
	margin-top: 6px !important;
	padding-top: 6px !important;
}
html body .jst-list__reset .jst-link {
	color: rgba(2, 42, 81, 0.65) !important;
	font-size: 13px !important;
}
html body .jst-list__reset .jst-link:hover {
	color: #022A51 !important;
}

.jst-panel__note {
	display: block;
	font-size: 11px;
	color: rgba(2, 42, 81, 0.50);
	font-style: italic;
	margin: 8px 6px 2px;
	line-height: 1.4;
}

/* ── Skrýt vlastní Google Translate UI ────────────────────────────────── */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-simple,
#goog-gt-tt,
.goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }
font[style] { background: transparent !important; box-shadow: none !important; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	html .jst-widget--sticky { left: 12px; bottom: 12px; }
	html body .jst-toggle,
	html body button.jst-toggle {
		padding: 8px 14px 8px 12px !important;
		min-height: 38px;
		font-size: 13px !important;
	}
	html body .jst-toggle svg { width: 16px; height: 16px; }
	html body .jst-toggle__label { font-size: 13px !important; }
	.jst-panel { min-width: 220px; }
}
