/*
 * Consent-Banner & Settings-Modal (DSGVO).
 * Design-Token aus Theme-Variablen, falls vorhanden — Fallback inline.
 */

:root {
	--hp-consent-bg: #fff;
	--hp-consent-fg: #2a2419;
	--hp-consent-muted: #685a48;
	--hp-consent-accent: #3a2a1a;
	--hp-consent-accent-hover: #1f1308;
	--hp-consent-border: #e6dfd4;
	--hp-consent-shadow: 0 12px 40px rgba(20, 12, 0, 0.18);
	--hp-consent-radius: 10px;
}

.hp-consent[hidden],
.hp-consent-modal[hidden] {
	display: none !important;
}

/* === Bottom-Banner === */
.hp-consent {
	position: fixed;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	width: calc(100% - 32px);
	max-width: 720px;
	background: var(--hp-consent-bg);
	color: var(--hp-consent-fg);
	border: 1px solid var(--hp-consent-border);
	border-radius: var(--hp-consent-radius);
	box-shadow: var(--hp-consent-shadow);
	animation: hp-consent-slide-up 280ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
	.hp-consent {
		animation: none;
	}
}

@keyframes hp-consent-slide-up {
	from { opacity: 0; transform: translate(-50%, 24px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.hp-consent__panel {
	padding: 22px 24px 20px;
}

.hp-consent__title {
	margin: 0 0 8px;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--hp-consent-fg);
	line-height: 1.3;
}

.hp-consent__text {
	margin: 0 0 18px;
	font-size: 0.92rem;
	line-height: 1.55;
	color: var(--hp-consent-muted);
}

.hp-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 14px;
}

.hp-consent__btn {
	flex: 1 1 auto;
	min-width: 140px;
	padding: 11px 18px;
	font-size: 0.92rem;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: 0.01em;
	border: 1.5px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.hp-consent__btn:focus-visible {
	outline: 2px solid var(--hp-consent-accent);
	outline-offset: 2px;
}

.hp-consent__btn--primary {
	background: var(--hp-consent-accent);
	color: #fff;
	border-color: var(--hp-consent-accent);
}

.hp-consent__btn--primary:hover {
	background: var(--hp-consent-accent-hover);
	border-color: var(--hp-consent-accent-hover);
}

/* Sekundär-Button gleich prominent wie Primary (DSGVO Art. 7 — kein Dark Pattern) */
.hp-consent__btn--secondary {
	background: #fff;
	color: var(--hp-consent-accent);
	border-color: var(--hp-consent-accent);
}

.hp-consent__btn--secondary:hover {
	background: var(--hp-consent-accent);
	color: #fff;
}

.hp-consent__btn--ghost {
	background: transparent;
	color: var(--hp-consent-muted);
	border-color: var(--hp-consent-border);
	flex: 0 1 auto;
	min-width: 110px;
}

.hp-consent__btn--ghost:hover {
	background: var(--hp-consent-border);
	color: var(--hp-consent-fg);
}

.hp-consent__footer {
	margin: 0;
	font-size: 0.82rem;
	color: var(--hp-consent-muted);
}

.hp-consent__footer a {
	color: var(--hp-consent-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hp-consent__footer a:hover {
	color: var(--hp-consent-fg);
}

.hp-consent__footer span {
	margin: 0 6px;
}

/* === Settings-Modal === */
.hp-consent-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.hp-consent-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 12, 0, 0.55);
}

.hp-consent-modal__panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	background: var(--hp-consent-bg);
	color: var(--hp-consent-fg);
	border-radius: var(--hp-consent-radius);
	box-shadow: var(--hp-consent-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.hp-consent-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--hp-consent-border);
}

.hp-consent-modal__header h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
}

.hp-consent-modal__close {
	background: transparent;
	border: 0;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--hp-consent-muted);
	cursor: pointer;
	padding: 4px 8px;
}

.hp-consent-modal__close:hover {
	color: var(--hp-consent-fg);
}

.hp-consent-modal__body {
	padding: 18px 22px;
	overflow-y: auto;
	flex: 1;
}

.hp-consent-cat {
	padding: 14px 0;
	border-bottom: 1px solid var(--hp-consent-border);
}

.hp-consent-cat:last-child {
	border-bottom: 0;
}

.hp-consent-cat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.hp-consent-cat__toggle {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	user-select: none;
}

.hp-consent-cat__toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
}

.hp-consent-cat__switch {
	position: relative;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #cdc4b6;
	transition: background-color 180ms ease;
	flex-shrink: 0;
}

.hp-consent-cat__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 180ms ease;
}

.hp-consent-cat__toggle input:checked ~ .hp-consent-cat__switch {
	background: var(--hp-consent-accent);
}

.hp-consent-cat__toggle input:checked ~ .hp-consent-cat__switch::after {
	transform: translateX(18px);
}

.hp-consent-cat__toggle input:disabled ~ .hp-consent-cat__switch {
	opacity: 0.6;
	cursor: not-allowed;
}

.hp-consent-cat__toggle input:focus-visible ~ .hp-consent-cat__switch {
	outline: 2px solid var(--hp-consent-accent);
	outline-offset: 3px;
}

.hp-consent-cat__title {
	font-weight: 600;
	font-size: 0.98rem;
}

.hp-consent-cat__pill {
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hp-consent-muted);
	border: 1px solid var(--hp-consent-border);
	border-radius: 999px;
	padding: 3px 10px;
}

.hp-consent-cat__desc {
	margin: 0;
	padding-left: 54px;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--hp-consent-muted);
}

.hp-consent-modal__footer {
	display: flex;
	gap: 10px;
	padding: 16px 22px;
	border-top: 1px solid var(--hp-consent-border);
}

.hp-consent-modal__footer .hp-consent__btn {
	flex: 1 1 0;
}

/* === Footer-Link === */
.hp-footer__legal-cookie {
	display: inline;
	background: transparent;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hp-footer__legal-cookie:hover {
	opacity: 0.75;
}

/* Mobil-Tweak: Buttons untereinander */
@media (max-width: 520px) {
	.hp-consent__actions {
		flex-direction: column;
	}

	.hp-consent__btn {
		min-width: 0;
	}

	.hp-consent-modal__footer {
		flex-direction: column;
	}
}
