/**
 * Unlimited Consent — Styles.
 *
 * Design bewusst neutral; das Branding pro Kunde läuft über die
 * --uc-*-Custom-Properties (Customizer → „Zusätzliches CSS" oder die
 * Overrides in den Plugin-Einstellungen). Form und Typografie sollen
 * dem Primär-CTA der jeweiligen Seite folgen — Radius, Font und Farben
 * dafür überschreiben.
 *
 * Einheiten: ausschließlich px, plus eine feste Basis-Schriftgröße auf
 * dem Banner-Root. Grund: Themes mit dem 62,5-%-Trick (html{font-size:10px})
 * schrumpfen jeden rem-Wert auf 62,5 % — Fließtext landete bei 8,75 px.
 * em wäre elternabhängig und würde bei verschachtelten Elementen
 * aufmultiplizieren. px rendert bei JEDER Root-Fontsize identisch.
 * Regel für Änderungen: kein rem, kein em, keine %-Längen.
 *
 * Button-Regeln (KB-Standard): „Alles akzeptieren" gefüllt,
 * „Nur notwendige" als vollwertiger Outline-Button — gleiche Größe,
 * gleiches Padding, gleiche Typografie, Rahmen 2px in Akzentfarbe,
 * voller Textkontrast, sichtbarer Hover.
 */

#unlimited-consent,
.uc-declaration {
	--uc-accent: #1f2937;
	--uc-accent-contrast: #ffffff;
	--uc-bg: #ffffff;
	--uc-text: #1f2937;
	--uc-muted: #4b5563;
	--uc-border: #d1d5db;
	--uc-radius: 8px;
	--uc-font: inherit;
	--uc-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
	--uc-gap: 16px;
	--uc-max-width: 448px;
	--uc-z: 99999;
	--uc-outline-hover: rgba(0, 0, 0, 0.06);

	font-family: var(--uc-font);
}

/* ----------------------------------------------------------------------
 * Banner-Container: fixed, Abstand als padding auf dem Container —
 * nie als margin auf der Karte (KB-Falle: Prozent-Margins beziehen
 * sich auf die Breite und schieben die Karte aus dem Viewport).
 *
 * font-size ist bewusst fix: das Banner erbt keine Theme-Schriftgröße
 * und bleibt damit unabhängig von html{font-size:…}.
 * -------------------------------------------------------------------- */

#unlimited-consent {
	position: fixed;
	inset: auto 0 0 0;
	z-index: var(--uc-z);
	display: flex;
	justify-content: flex-end;
	padding: var(--uc-gap);
	font-size: 16px;
	pointer-events: none;
	box-sizing: border-box;
}

/* Banner-Position (Einstellung „Banner-Position"): unten rechts ist
 * Standard, unten links weicht fest positionierten Chat-Widgets aus. */

#unlimited-consent.uc--pos-right {
	justify-content: flex-end;
}

#unlimited-consent.uc--pos-left {
	justify-content: flex-start;
}

#unlimited-consent[hidden],
#unlimited-consent [hidden] {
	display: none !important;
}

#unlimited-consent *,
#unlimited-consent *::before,
#unlimited-consent *::after {
	box-sizing: border-box;
}

.uc__card {
	pointer-events: auto;
	width: var(--uc-max-width);
	max-width: 100%;
	max-height: calc(100vh - 2 * var(--uc-gap));
	overflow-y: auto;
	margin: 0;
	padding: 20px;
	background: var(--uc-bg);
	color: var(--uc-text);
	border-radius: var(--uc-radius);
	box-shadow: var(--uc-shadow);
}

.uc__card:focus {
	outline: none;
}

/* Kopf: Titel + Cookie-Icon (erbt die Titelfarbe via currentColor). */

.uc__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
}

.uc__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.uc__icon {
	flex: none;
	width: 22px;
	height: 22px;
}

.uc__text,
.uc__links {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--uc-muted);
}

.uc__links a {
	color: var(--uc-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ----------------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------------- */

.uc__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
}

.uc__btn {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 16px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	border: 2px solid transparent;
	/* Eigenes Token für Pillen-Buttons (z. B. 999px), ohne dass Karte und
	   Statuskasten mitrunden — Fallback ist der normale Radius. */
	border-radius: var(--uc-radius-btn, var(--uc-radius));
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.uc__btn:focus-visible {
	outline: 2px solid var(--uc-accent);
	outline-offset: 2px;
}

.uc__btn--primary {
	background: var(--uc-accent);
	border-color: var(--uc-accent);
	color: var(--uc-accent-contrast);
}

.uc__btn--primary:hover {
	filter: brightness(0.88);
}

/* Vollwertiger Outline-Button: Rahmen in Akzentfarbe, Text in voller
 * Textfarbe, kein Ausgrauen, sichtbarer Hover. */

.uc__btn--outline {
	background: transparent;
	border-color: var(--uc-accent);
	color: var(--uc-text);
}

.uc__btn--outline:hover {
	background: var(--uc-outline-hover);
}

.uc__btn--ghost {
	background: transparent;
	border-color: transparent;
	color: var(--uc-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.uc__btn--ghost:hover {
	background: var(--uc-outline-hover);
	text-decoration: none;
}

/* ----------------------------------------------------------------------
 * Anpassen-Ansicht: Kategorien mit Toggles und Cookie-Details
 * -------------------------------------------------------------------- */

.uc__cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uc__cat {
	padding: 12px 0;
	border-top: 1px solid var(--uc-border);
}

.uc__cat:first-child {
	border-top: 0;
	padding-top: 0;
}

.uc__switch {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
}

.uc__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.uc__slider {
	flex: none;
	position: relative;
	width: 36px;
	height: 20px;
	border-radius: 999px;
	background: var(--uc-border);
	transition: background-color 0.15s ease;
}

.uc__slider::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.uc__switch input:checked + .uc__slider {
	background: var(--uc-accent);
}

.uc__switch input:checked + .uc__slider::after {
	transform: translateX(16px);
}

.uc__switch input:disabled ~ .uc__cat-name {
	cursor: default;
}

.uc__switch input:disabled + .uc__slider {
	opacity: 0.55;
	cursor: not-allowed;
}

.uc__switch input:focus-visible + .uc__slider {
	outline: 2px solid var(--uc-accent);
	outline-offset: 2px;
}

.uc__cat-desc {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--uc-muted);
}

.uc__details {
	margin-top: 8px;
	font-size: 13px;
}

.uc__details summary {
	cursor: pointer;
	color: var(--uc-muted);
}

/* ----------------------------------------------------------------------
 * Tabellen (Banner-Details und Cookie-Seite)
 * -------------------------------------------------------------------- */

.uc-table {
	width: 100%;
	margin: 8px 0 0;
	border-collapse: collapse;
	font-size: 13px;
}

.uc-table th,
.uc-table td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--uc-border);
	text-align: left;
	vertical-align: top;
}

.uc-table th {
	font-weight: 600;
}

/* ----------------------------------------------------------------------
 * Cookie-Seite: Statuskasten und Deklaration
 *
 * Auch hier px: der Statuskasten steht im Theme-Inhalt und darf nicht
 * mitschrumpfen, wenn das Theme die Root-Fontsize verstellt.
 * -------------------------------------------------------------------- */

.uc-status {
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var(--uc-border);
	border-radius: var(--uc-radius);
	background: var(--uc-bg);
}

.uc-status__heading {
	margin: 0 0 8px;
	font-size: 18px;
}

.uc-status__text {
	margin: 0;
}

.uc-status .uc__btn {
	display: inline-block;
	width: auto;
	margin-top: 12px;
	padding: 10px 20px;
}

.uc-declaration__section {
	margin: 24px 0;
}

.uc-declaration .uc-table {
	font-size: 15px;
}

/* ----------------------------------------------------------------------
 * Reduzierte Bewegung
 * -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	#unlimited-consent *,
	#unlimited-consent *::before,
	#unlimited-consent *::after {
		transition: none !important;
	}
}
