/**
 * PV Consent – Frontend-Banner
 * Stil: dunkle Leiste (bar-bottom), Ghost-Buttons als reiner Text mit Hover-Effekt.
 */

:root {
	--pvc-primary: #007344;
	--pvc-primary-text: #ffffff;
	--pvc-bg: #1a1a1a;
	--pvc-text: #ffffff;
	--pvc-radius: 14px;
	--pvc-muted: #9ca3af;
	--pvc-border: #2e2e2e;
	--pvc-shadow: 0 -4px 24px rgba(0, 0, 0, .35);
}

.pvc-root { box-sizing: border-box; }
.pvc-root *,
.pvc-root *::before,
.pvc-root *::after { box-sizing: border-box; }

/* Overlay mit Blur hinter dem Banner */
.pvc-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, .45);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 2147483000;
	animation: pvc-fade .25s ease;
}

/* ------ Banner-Grundcontainer ------ */
.pvc-banner {
	position: fixed;
	z-index: 2147483001;
	background: var(--pvc-bg);
	color: var(--pvc-text);
	box-shadow: var(--pvc-shadow);
	border-top: 1px solid var(--pvc-border);
	padding: 20px clamp(20px, 5vw, 48px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	animation: pvc-slide .28s cubic-bezier(.2, .9, .3, 1.1);

	/* zentrierter Balken am unteren Rand */
	left: 50%; bottom: 0;
	transform: translateX(-50%);
	width: 100%;
	max-width: 900px;
	border-radius: var(--pvc-radius) var(--pvc-radius) 0 0;
	max-height: 85vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.pvc-banner__scroll {
	flex: 1;
	overflow-y: auto;
	padding-bottom: 4px;
}
.pvc-banner__footer {
	flex-shrink: 0;
	padding-top: 12px;
	border-top: 1px solid var(--pvc-border);
}

/* Box-Positionen (Fallback, falls per Einstellung gewählt) */
.pvc-pos-box-right .pvc-banner {
	left: auto; right: 16px; bottom: 16px;
	width: min(420px, calc(100vw - 32px));
	border-radius: var(--pvc-radius);
	border: 1px solid var(--pvc-border);
}
.pvc-pos-box-left .pvc-banner {
	right: auto; left: 16px; bottom: 16px;
	width: min(420px, calc(100vw - 32px));
	border-radius: var(--pvc-radius);
	border: 1px solid var(--pvc-border);
}

.pvc-banner__title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: #ffffff !important;
	text-transform: none !important;
}

.pvc-banner__body p { margin: 0 0 8px; color: var(--pvc-text); opacity: .85; }

.pvc-links { display: flex; gap: 16px; font-size: 13px; }
.pvc-links a {
	color: #ffffff !important;
	text-decoration: underline;
	font-weight: 500;
}
.pvc-links a:hover { color: rgba(255,255,255,.75) !important; }

/* ------ Aktionsleiste ------ */
.pvc-banner__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}
/* Mehr erfahren auf Desktop nach rechts */
#pvc-root .pvc-btn--settings { margin-left: auto; }

/* ------ Buttons (alle mit #pvc-root Präfix für maximale Spezifität) ------ */
#pvc-root .pvc-btn {
	appearance: none;
	cursor: pointer;
	border: none !important;
	outline: none;
	background: transparent;
	background-color: transparent;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1;
	padding: 10px 18px;
	border-radius: 999px;
	transition: background .15s ease, color .15s ease;
	white-space: nowrap;
	box-shadow: none !important;
	text-decoration: none !important;
}
#pvc-root .pvc-btn:active { opacity: .85; }

/* Text-Button (Ablehnen / Mehr erfahren): nur Text, bei Hover grauer Pill */
#pvc-root .pvc-btn--text,
#pvc-root .pvc-btn--text:link,
#pvc-root .pvc-btn--text:visited {
	color: rgba(255, 255, 255, .85) !important;
	background: transparent !important;
	background-color: transparent !important;
}
#pvc-root .pvc-btn--text:hover,
#pvc-root .pvc-btn--text:focus {
	background: rgba(255, 255, 255, .15) !important;
	background-color: rgba(255, 255, 255, .15) !important;
	color: #ffffff !important;
}

/* Primär-Button (Zustimmen) */
#pvc-root .pvc-btn--primary,
#pvc-root .pvc-btn--primary:link,
#pvc-root .pvc-btn--primary:visited {
	background: var(--pvc-primary) !important;
	background-color: var(--pvc-primary) !important;
	color: var(--pvc-primary-text) !important;
}
#pvc-root .pvc-btn--primary:hover { filter: brightness(1.1); }

/* Auswahl-speichern-Button (erscheint nach Klick auf „Mehr erfahren") */
.pvc-settings-actions {
	margin-top: 14px;
	display: flex;
	justify-content: flex-end;
}
#pvc-root .pvc-btn--save,
#pvc-root .pvc-btn--save:link,
#pvc-root .pvc-btn--save:visited {
	color: rgba(255, 255, 255, .85) !important;
	background: transparent !important;
	background-color: transparent !important;
}
#pvc-root .pvc-btn--save:hover,
#pvc-root .pvc-btn--save:focus {
	background: rgba(255, 255, 255, .15) !important;
	background-color: rgba(255, 255, 255, .15) !important;
	color: #ffffff !important;
}

/* ------ Detail-Einstellungen ------ */
.pvc-settings {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--pvc-border);
}
.pvc-settings__title { margin: 0 0 12px; font-size: 17px; font-weight: 700; color: #ffffff !important; text-transform: none !important; }

.pvc-cat {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--pvc-border);
	cursor: pointer;
}
.pvc-cat:last-child { border-bottom: 0; }
.pvc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pvc-cat__label { font-weight: 700; color: var(--pvc-text); }
.pvc-cat__desc { display: block; margin-top: 4px; font-size: 13px; color: var(--pvc-muted); }

/* Toggle-Switch */
.pvc-switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.pvc-switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.pvc-switch__slider {
	width: 44px; height: 26px;
	background: #444;
	border-radius: 999px;
	position: relative;
	transition: background .18s ease;
}
.pvc-switch__slider::after {
	content: "";
	position: absolute; top: 3px; left: 3px;
	width: 20px; height: 20px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	transition: transform .18s ease;
}
.pvc-switch input:checked + .pvc-switch__slider { background: var(--pvc-primary); }
.pvc-switch input:checked + .pvc-switch__slider::after { transform: translateX(18px); }
.pvc-switch input:disabled + .pvc-switch__slider { opacity: .5; cursor: not-allowed; }

.pvc-legal-note { margin: 12px 0 0; font-size: 12px; color: var(--pvc-muted); }

/* ------ Widerruf-Badge ------ */
.pvc-badge {
	position: fixed;
	right: 6px; bottom: 6px;
	z-index: 2147482000;
	width: auto; height: auto;
	padding: 0;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity .15s ease;
}
.pvc-badge:hover { opacity: .75; }

/* ------ Placeholder für geblockte iFrames ------ */
.pvc-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 28px;
	background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
	border: 1px dashed #444;
	border-radius: 12px;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #e5e7eb;
}
.pvc-placeholder__inner { max-width: 480px; }
.pvc-placeholder__icon { font-size: 34px; opacity: .5; }
.pvc-placeholder__text { margin: 10px 0 16px; font-size: 14px; line-height: 1.5; }
.pvc-placeholder__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pvc-placeholder__link { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--pvc-muted); }
.pvc-placeholder .pvc-btn { flex: 0 0 auto; min-width: 0; }

/* ------ Animationen ------ */
@keyframes pvc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pvc-slide {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes pvc-pop {
	from { opacity: 0; transform: translateY(14px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
	/* Zustimmen: volle Breite, eigene Zeile */
	#pvc-root .pvc-btn--primary {
		width: 100%;
	}
	/* Ablehnen + Mehr erfahren: zentriert in der zweiten Zeile */
	.pvc-banner__actions {
		justify-content: center;
	}
	/* Mehr erfahren: kein auto-margin, bleibt neben Ablehnen */
	#pvc-root .pvc-btn--settings {
		margin-left: 0;
		margin-top: 15px;
	}
	/* Ablehnen ebenfalls Abstand nach oben */
	#pvc-root .pvc-btn[data-pvc-action="reject"] {
		margin-top: 15px;
	}
	/* Mehr Abstand zwischen Buttons und Hinweistext, mittig */
	.pvc-legal-note {
		margin-top: 20px;
		text-align: center;
	}
	/* Auswahl speichern mittig */
	.pvc-settings-actions {
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pvc-banner, .pvc-overlay, .pvc-badge { animation: none; transition: none; }
}
