/* JF Cookie Consent – Frontend */

:root {
	--jf-cc-primary: #c8102e;
	--jf-cc-primary-text: #ffffff;
	--jf-cc-radius: 14px;
	--jf-cc-overlay: 0.6;
	--jf-cc-bg: #ffffff;
	--jf-cc-text: #1b1b1f;
	--jf-cc-muted: #565b66;
	--jf-cc-line: #dcdde1;
	--jf-cc-focus: #1a5fd0;
}

html.jf-cc-lock { overflow: hidden; }

.jf-cc,
.jf-cc *,
.jf-cc *::before,
.jf-cc *::after,
.jf-cc-reopen { box-sizing: border-box; }

.jf-cc[hidden],
.jf-cc [hidden],
.jf-cc-reopen[hidden] { display: none !important; }

/* ---------- Fenster in der Bildschirmmitte ---------- */

.jf-cc {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--jf-cc-text);
	-webkit-text-size-adjust: 100%;
}

.jf-cc__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, var(--jf-cc-overlay));
}

.jf-cc__box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 580px;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	background: var(--jf-cc-bg);
	color: var(--jf-cc-text);
	border-radius: var(--jf-cc-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	outline: none;
	animation: jf-cc-in 0.18s ease-out;
}

.jf-cc__view {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

.jf-cc__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 28px 28px 8px;
}

.jf-cc__title {
	margin: 0 40px 12px 0;
	padding: 0;
	font-size: 1.45rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--jf-cc-text);
	outline: none;
}

.jf-cc__text p,
.jf-cc__cat-desc { margin: 0 0 12px; color: var(--jf-cc-text); font-size: 0.97rem; }

.jf-cc__links { margin: 4px 0 12px; font-size: 0.92rem; color: var(--jf-cc-muted); }
.jf-cc__links a,
.jf-cc__text a { color: var(--jf-cc-text); text-decoration: underline; text-underline-offset: 2px; }

.jf-cc__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--jf-cc-text);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.jf-cc__close:hover { background: rgba(0, 0, 0, 0.07); }

/* ---------- Schaltflächen ---------- */

.jf-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 28px 24px;
	border-top: 1px solid var(--jf-cc-line);
	background: var(--jf-cc-bg);
}

.jf-cc__btn {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 150px;
	min-height: 48px;
	margin: 0;
	padding: 12px 18px;
	border: 2px solid var(--jf-cc-primary);
	border-radius: calc(var(--jf-cc-radius) * 0.6);
	background: var(--jf-cc-primary);
	color: var(--jf-cc-primary-text);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	touch-action: manipulation;
}
.jf-cc__btn:hover { filter: brightness(0.92); }

.jf-cc__btn--ghost {
	background: transparent;
	border-color: var(--jf-cc-text);
	color: var(--jf-cc-text);
}
.jf-cc__btn--ghost:hover { background: rgba(0, 0, 0, 0.06); filter: none; }

/* ---------- Kategorien und Schalter ---------- */

.jf-cc__cat {
	padding: 14px 0 2px;
	border-top: 1px solid var(--jf-cc-line);
}
.jf-cc__cat:first-of-type { margin-top: 6px; }

.jf-cc__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.jf-cc__cat-title { flex: 1 1 auto; font-weight: 600; cursor: pointer; }

.jf-cc__badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 20px;
	background: #eceef2;
	color: var(--jf-cc-muted);
	font-size: 0.78rem;
	font-weight: 600;
	white-space: nowrap;
}

.jf-cc__switch { position: relative; flex: none; width: 52px; height: 30px; }

.jf-cc__switch input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.jf-cc__switch input:disabled { cursor: not-allowed; }

.jf-cc__slider {
	position: absolute;
	inset: 0;
	border-radius: 30px;
	background: #7d828d;
	transition: background 0.2s;
}
.jf-cc__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s;
}
.jf-cc__switch input:checked + .jf-cc__slider { background: var(--jf-cc-primary); }
.jf-cc__switch input:checked + .jf-cc__slider::before { transform: translateX(22px); }
.jf-cc__switch input:disabled + .jf-cc__slider { opacity: 0.55; }

/* ---------- Tastatur-Fokus ---------- */

.jf-cc__btn:focus-visible,
.jf-cc__close:focus-visible,
.jf-cc a:focus-visible,
.jf-cc-reopen:focus-visible,
.jf-cc-embed__btn:focus-visible { outline: 3px solid var(--jf-cc-focus); outline-offset: 2px; }
.jf-cc__switch input:focus-visible + .jf-cc__slider { outline: 3px solid var(--jf-cc-focus); outline-offset: 2px; }

/* ---------- Schaltfläche zum Ändern der Auswahl ---------- */

.jf-cc-reopen {
	position: fixed;
	bottom: max(12px, env(safe-area-inset-bottom));
	z-index: 2147482000;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--jf-cc-line);
	border-radius: 999px;
	background: var(--jf-cc-bg);
	color: var(--jf-cc-text);
	font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	touch-action: manipulation;
}
.jf-cc-reopen--left { left: max(12px, env(safe-area-inset-left)); }
.jf-cc-reopen--right { right: max(12px, env(safe-area-inset-right)); }
.jf-cc-reopen:hover { background: #f3f4f6; }

/* ---------- Platzhalter für gesperrte Einbettungen ---------- */

.jf-cc-embed {
	padding: 20px;
	margin: 0 0 16px;
	border: 1px dashed #7d828d;
	border-radius: 8px;
	background: #f5f5f6;
	color: var(--jf-cc-text);
	text-align: center;
}
.jf-cc-embed p { margin: 0 0 12px; }
.jf-cc-embed__btn {
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var(--jf-cc-primary);
	border-radius: 8px;
	background: var(--jf-cc-primary);
	color: var(--jf-cc-primary-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Handy: Schaltflächen untereinander ---------- */

@media (max-width: 559px) {
	.jf-cc__scroll { padding: 22px 20px 6px; }
	.jf-cc__title { font-size: 1.25rem; }
	.jf-cc__actions { flex-direction: column; gap: 8px; padding: 14px 20px 20px; }
	.jf-cc__btn { flex: 0 0 auto; width: 100%; }
	.jf-cc__btn--accept { order: 1; }
	.jf-cc__btn--reject { order: 2; }
	.jf-cc__btn--save { order: 2; }
	.jf-cc__btn--settings,
	.jf-cc__btn--back { order: 3; }
	.jf-cc-reopen { padding: 10px 14px; font-size: 13px; }
}

/* ---------- Tablet und größer ---------- */

@media (min-width: 768px) {
	.jf-cc__box { max-width: 620px; }
}

/* ---------- Niedrige Bildschirme (Handy quer) ---------- */

@media (max-height: 480px) {
	.jf-cc__scroll { padding-top: 14px; }
	.jf-cc__title { font-size: 1.1rem; margin-bottom: 8px; }
	.jf-cc__actions { padding-top: 10px; padding-bottom: 12px; }
	.jf-cc__btn { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
}

@keyframes jf-cc-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.jf-cc__box { animation: none; }
	.jf-cc__slider,
	.jf-cc__slider::before { transition: none; }
}
