/**
 * StraightAds Translation – Sprachumschalter
 * Bewusst mit hoher Spezifität und eigenen Custom Properties, damit Theme-
 * und Builder-Styles (Divi, Elementor) nicht dazwischenfunken.
 */

.sat-switcher {
	--sat-bg: #ffffff;
	--sat-bg-hover: #f4f5f7;
	--sat-fg: #1b1d21;
	--sat-fg-hover: var(--sat-fg);
	--sat-fg-muted: #6b7280;
	--sat-border: rgba(17, 20, 24, 0.12);
	--sat-shadow: 0 12px 32px -12px rgba(16, 24, 40, 0.28), 0 2px 6px -2px rgba(16, 24, 40, 0.12);
	--sat-radius: 10px;
	--sat-accent: #2f6bff;
	--sat-gap: 8px;
	--sat-pad-y: 8px;
	--sat-pad-x: 12px;
	--sat-font: inherit;

	position: relative;
	display: inline-block;
	font-family: var(--sat-font);
	font-size: 15px;
	line-height: 1.3;
	text-align: left;
	vertical-align: middle;
	box-sizing: border-box;
}

.sat-switcher *,
.sat-switcher *::before,
.sat-switcher *::after {
	box-sizing: border-box;
}

.sat-switcher.sat-align-center {
	display: block;
	text-align: center;
}

.sat-switcher.sat-align-right {
	display: block;
	text-align: right;
}

.sat-switcher.sat-align-center > *,
.sat-switcher.sat-align-right > * {
	display: inline-flex;
}

/* Dunkles Design ---------------------------------------------------------- */

.sat-switcher.sat-theme-dark {
	--sat-bg: #16181d;
	--sat-bg-hover: #22252c;
	--sat-fg: #f3f4f6;
	--sat-fg-muted: #9ca3af;
	--sat-border: rgba(255, 255, 255, 0.14);
	--sat-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
	.sat-switcher.sat-theme-auto {
		--sat-bg: #16181d;
		--sat-bg-hover: #22252c;
		--sat-fg: #f3f4f6;
		--sat-fg-muted: #9ca3af;
		--sat-border: rgba(255, 255, 255, 0.14);
		--sat-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
	}
}

/* Titel ------------------------------------------------------------------- */

.sat-switcher .sat-switcher__title {
	display: inline-block;
	margin-right: 8px;
	color: var(--sat-fg-muted);
	font-size: 0.9em;
}

/* Flaggen ----------------------------------------------------------------- */

.sat-switcher .sat-flag {
	display: block;
	width: 22px;
	height: 15px;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	flex: 0 0 auto;
}

.sat-switcher .sat-flag--badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 16px;
	background: var(--sat-bg-hover);
	color: var(--sat-fg-muted);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1;
}

.sat-switcher .sat-switcher__flag {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* Toggle-Button ----------------------------------------------------------- */

.sat-switcher .sat-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--sat-gap);
	margin: 0;
	padding: var(--sat-pad-y) var(--sat-pad-x);
	min-height: 40px;
	background: var(--sat-bg);
	border: 1px solid var(--sat-border);
	border-radius: var(--sat-radius);
	color: var(--sat-fg);
	font: inherit;
	font-size: 1em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
	-webkit-appearance: none;
	appearance: none;
}

.sat-switcher .sat-switcher__toggle:hover {
	background: var(--sat-bg-hover);
	border-color: rgba(17, 20, 24, 0.2);
	color: var(--sat-fg-hover);
}

.sat-switcher.sat-theme-dark .sat-switcher__toggle:hover {
	border-color: rgba(255, 255, 255, 0.24);
}

.sat-switcher .sat-switcher__toggle:focus-visible,
.sat-switcher .sat-switcher__item:focus-visible,
.sat-switcher .sat-switcher__select:focus-visible {
	outline: 2px solid var(--sat-accent);
	outline-offset: 2px;
}

.sat-switcher .sat-switcher__text {
	white-space: nowrap;
	font-weight: 500;
}

.sat-switcher .sat-switcher__chevron {
	width: 16px;
	height: 16px;
	margin-left: 2px;
	color: var(--sat-fg-muted);
	transition: transform 0.18s ease;
	flex: 0 0 auto;
}

.sat-switcher.is-open .sat-switcher__chevron {
	transform: rotate(180deg);
}

/* Panel ------------------------------------------------------------------- */

.sat-switcher .sat-switcher__panel {
	position: absolute;
	z-index: 99999;
	top: calc(100% + 6px);
	left: 0;
	min-width: 100%;
	width: max-content;
	max-width: 260px;
	padding: 6px;
	background: var(--sat-bg);
	border: 1px solid var(--sat-border);
	border-radius: var(--sat-radius);
	box-shadow: var(--sat-shadow);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
	pointer-events: none;
}

.sat-switcher .sat-switcher__panel[hidden] {
	display: none;
}

.sat-switcher.is-open .sat-switcher__panel {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.sat-switcher.sat-align-right .sat-switcher__panel {
	left: auto;
	right: 0;
}

/* Einträge ---------------------------------------------------------------- */

.sat-switcher .sat-switcher__item {
	display: flex;
	align-items: center;
	gap: var(--sat-gap);
	padding: 8px 10px;
	border-radius: calc(var(--sat-radius) - 4px);
	color: var(--sat-fg);
	font-size: 0.95em;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.14s ease;
}

.sat-switcher .sat-switcher__item:hover,
.sat-switcher .sat-switcher__item:focus {
	background: var(--sat-bg-hover);
	color: var(--sat-fg-hover);
	text-decoration: none;
}

.sat-switcher .sat-switcher__item.is-current {
	font-weight: 600;
}

.sat-switcher .sat-switcher__item.is-current::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-left: auto;
	border-radius: 50%;
	background: var(--sat-accent);
	flex: 0 0 auto;
}

/* Inline / Liste ---------------------------------------------------------- */

.sat-switcher .sat-switcher__list {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 4px;
}

.sat-switcher .sat-switcher__list::before,
.sat-switcher .sat-switcher__list::after {
	content: none;
}

.sat-switcher .sat-switcher__listitem {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sat-switcher .sat-switcher__listitem::marker {
	content: "";
}

.sat-switcher--inline .sat-switcher__list {
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
}

.sat-switcher--inline .sat-switcher__item {
	padding: calc(var(--sat-pad-y) - 2px) calc(var(--sat-pad-x) - 2px);
	border: 1px solid transparent;
}

.sat-switcher--inline .sat-switcher__item.is-current {
	background: var(--sat-bg-hover);
	border-color: var(--sat-border);
}

.sat-switcher--inline .sat-switcher__item.is-current::after {
	content: none;
}

.sat-switcher--list {
	display: block;
}

.sat-switcher--list .sat-switcher__list {
	flex-direction: column;
	align-items: stretch;
	gap: 2px;
}

/* Native Auswahl ---------------------------------------------------------- */

.sat-switcher .sat-switcher__select {
	min-height: 40px;
	padding: 8px 34px 8px 12px;
	background-color: var(--sat-bg);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 16px 16px;
	border: 1px solid var(--sat-border);
	border-radius: var(--sat-radius);
	color: var(--sat-fg);
	font: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sat-switcher .sat-switcher__srlabel {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Menü-Integration -------------------------------------------------------- */

.menu-item-sat-switcher > .sat-switcher {
	display: inline-flex;
	align-items: center;
}

li.menu-item-sat-switcher {
	display: flex;
	align-items: center;
}

@media (max-width: 782px) {
	.sat-switcher .sat-switcher__panel {
		max-width: min(260px, calc(100vw - 32px));
	}
}
