/* AI Site Translations — language switcher (globe). Self-contained, theme-agnostic tokens. */
.aist-switch {
	--aist-bg: #ffffff;
	--aist-fg: #1c1e21;
	--aist-muted: #6b7280;
	--aist-line: #e5e7eb;
	--aist-accent: #2563eb;
	--aist-shadow: 0 10px 30px rgba(15, 23, 42, .18);
	position: relative;
	display: inline-block;
	font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	/* Below the cookie-consent banner (99999) so the banner covers the switcher while it is
	   open, above ordinary page content. Was 2147483000 (covered the banner). */
	z-index: 900;
}
.aist-switch__toggle {
	display: inline-flex; align-items: center; gap: .5em;
	background: var(--aist-bg); color: var(--aist-fg);
	border: 1px solid var(--aist-line); border-radius: 999px;
	padding: .5em .85em; cursor: pointer;
	font: inherit;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
	transition: box-shadow .15s ease, border-color .15s ease;
}
.aist-switch__toggle:hover { border-color: var(--aist-accent); box-shadow: 0 2px 8px rgba(37, 99, 235, .18); }
.aist-switch__toggle:focus-visible,
.aist-switch__item a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--aist-accent) 55%, transparent);
	outline-offset: 2px;
}
.aist-switch__globe { display: inline-flex; color: var(--aist-muted); }
.aist-switch__flag { font-size: 1.05em; line-height: 1; }
.aist-switch__code { font-size: .82em; font-weight: 750; letter-spacing: .08em; }
.aist-switch__current { font-weight: 600; }

.aist-switch__menu {
	position: absolute; min-width: 190px; margin: 0; padding: .35em;
	list-style: none; background: var(--aist-bg); color: var(--aist-fg);
	border: 1px solid var(--aist-line); border-radius: 12px; box-shadow: var(--aist-shadow);
	text-align: start;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.aist-switch.is-open .aist-switch__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.aist-switch__item { margin: 0; }
.aist-switch__item a {
	display: flex; align-items: center; gap: .6em;
	padding: .55em .7em; border-radius: 8px; text-decoration: none; color: inherit;
}
.aist-switch__item a:hover { background: color-mix(in srgb, var(--aist-accent) 10%, transparent); }
.aist-switch__item.is-current a { font-weight: 700; }
.aist-switch__label { flex: 1 1 auto; }
.aist-switch__check { color: var(--aist-accent); font-weight: 700; }

/* Inline placement: menu drops below the button. */
.aist-switch--inline .aist-switch__menu { top: calc(100% + 8px); inset-inline-start: 0; }

/* Floating placement: fixed bottom-right; menu opens upward. */
.aist-switch--floating { position: fixed; inset-inline-end: 18px; bottom: 18px; }
.aist-switch--floating .aist-switch__code { display: none; }
.aist-switch--floating .aist-switch__menu { bottom: calc(100% + 10px); inset-inline-end: 0; }

/* Universal Navigation integration: compact on desktop and placed before the CTA. */
.universal-nav .aist-switch--inline {
	--aist-bg: var(--bg-main, #ffffff);
	--aist-fg: var(--ink, #1c1e21);
	--aist-muted: var(--ink-dim, #6b7280);
	--aist-line: var(--line, #e5e7eb);
	--aist-accent: var(--accent, #2563eb);
	flex: 0 0 auto;
	margin: 0;
}
.universal-nav .aist-switch--inline .aist-switch__flag,
.universal-nav .aist-switch--inline .aist-switch__current {
	display: none;
}
.universal-nav .aist-switch--inline .aist-switch__menu {
	inset-inline: auto 0;
}

@media (max-width: 640px) {
	.aist-switch--floating { inset-inline-end: 12px; bottom: 12px; }
	.aist-switch--floating .aist-switch__current { display: none; } /* compact pill on phones */
}
/* On mobile the AI Base Theme shows a bottom-right „Zadzwoń" call FAB (.aibt-mobile-call, ≤767px).
   Both were bottom-right → they overlapped (user report 2026-07-11). When that FAB is present,
   stack the switcher ABOVE it on the same edge; without the theme FAB the switcher stays low. */
@media (max-width: 767px) {
	/* FAB pill is ~3.1rem tall at bottom:1rem (→ top ≈ 4.1rem); clear it with a comfortable gap. */
	body:has(.aibt-mobile-call) .aist-switch--floating { inset-inline-end: 14px; bottom: 5rem; }

	.universal-nav .aist-switch--inline .aist-switch__flag,
	.universal-nav .aist-switch--inline .aist-switch__current {
		display: inline;
	}
	.universal-nav .aist-switch--inline .aist-switch__code {
		display: none;
	}
	.universal-nav :is(.universal-nav__menu-wrap, .universal-nav__overlay, .universal-nav__drawer) > .aist-switch--inline {
		display: block;
		width: 100%;
	}
	.universal-nav :is(.universal-nav__menu-wrap, .universal-nav__overlay, .universal-nav__drawer) > .aist-switch--inline .aist-switch__toggle {
		justify-content: flex-start;
		width: 100%;
	}
	.universal-nav :is(.universal-nav__menu-wrap, .universal-nav__overlay, .universal-nav__drawer) > .aist-switch--inline .aist-switch__menu {
		position: static;
		display: none;
		width: 100%;
		min-width: 0;
		margin-block-start: .5rem;
		transform: none;
	}
	.universal-nav :is(.universal-nav__menu-wrap, .universal-nav__overlay, .universal-nav__drawer) > .aist-switch--inline.is-open .aist-switch__menu {
		display: block;
		transform: none;
	}
}

@media (prefers-color-scheme: dark) {
	.aist-switch {
		--aist-bg: #1f2530; --aist-fg: #f3f4f6; --aist-muted: #9aa4b2;
		--aist-line: #333c4a; --aist-accent: #6ea8ff;
		--aist-shadow: 0 12px 34px rgba(0, 0, 0, .5);
	}
}
