/**
 * consent.css – Consent-Banner (eigene westident-Consent-Lösung).
 * An die bunert-events / E.ON-CD angelehnt (dunkler Grund, Rot-Akzent, eckige Buttons).
 * Nutzt Theme-Tokens (main.css :root) mit robusten Fallbacks.
 */

.be-consent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	background: var(--gradient-eon-dark, linear-gradient(160deg, #1A0005 0%, #3D001A 45%, #1A0005 100%));
	border-top: 3px solid var(--color-primary, #E2001A);
	box-shadow: 0 -6px 32px rgba(0, 0, 0, 0.45);
	color: #fff;
	font-family: var(--font-body, 'EON BrixSans', Arial, sans-serif);
	font-size: 0.9375rem;
	line-height: 1.55;
}
.be-consent[hidden] { display: none; }

.be-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 1.25rem;
	padding-top: 1.15rem;
	padding-bottom: 1.15rem;
}

.be-consent__body { flex: 1 1 320px; min-width: 260px; }

.be-consent__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.4rem;
	font-family: var(--font-heading, 'EON BrixSans', sans-serif);
	font-weight: 700;
	font-size: 1rem;
}

.be-consent__details-toggle {
	background: none;
	border: none;
	padding: 0;
	color: #fff;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	opacity: 0.85;
}
.be-consent__details-toggle:hover { opacity: 1; }

.be-consent__intro {
	margin: 0;
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.82);
}
.be-consent__intro a { color: #fff; text-decoration: underline; }

/* --- Kategorie-Details --- */
.be-consent__details { margin-top: 0.9rem; }
.be-consent__details[hidden] { display: none; }

.be-consent__cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	background: rgba(255, 255, 255, 0.07);
	border-radius: var(--radius-md, 4px);
	padding: 0.65rem 0.85rem;
	margin-bottom: 0.55rem;
}
.be-consent__cat-label {
	margin: 0 0 0.15rem;
	font-weight: 700;
	font-size: 0.8125rem;
}
.be-consent__cat-desc {
	margin: 0;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.62);
}

.be-consent__cat-always {
	flex-shrink: 0;
	white-space: nowrap;
	font-size: 0.75rem;
	font-weight: 700;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border-radius: var(--radius-sm, 4px);
	padding: 0.2rem 0.6rem;
}

.be-consent__cat-toggle {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	font-size: 0.75rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.85);
}
.be-consent__cat-toggle input {
	width: 1rem;
	height: 1rem;
	accent-color: var(--color-primary, #E2001A);
	cursor: pointer;
}

.be-consent__save {
	margin-top: 0.5rem;
	background: rgba(255, 255, 255, 0.10);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--radius-md, 4px);
	color: #fff;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.5rem 1.1rem;
	cursor: pointer;
	transition: background 0.15s;
}
.be-consent__save:hover { background: rgba(255, 255, 255, 0.18); }

/* --- Buttons (gleichwertig) --- */
.be-consent__actions {
	display: flex;
	flex-direction: row;
	gap: 0.6rem;
	flex-shrink: 0;
	align-self: center;
}
.be-consent__btn {
	white-space: nowrap;
	font-weight: 700;
	font-size: 0.875rem;
	padding: 0.7rem 1.5rem;
	border-radius: var(--radius-md, 4px);
	cursor: pointer;
	border: 2px solid transparent;
	transition: opacity 0.15s, background 0.15s;
}
.be-consent__btn--accept {
	background: var(--color-primary, #E2001A);
	border-color: var(--color-primary, #E2001A);
	/* Nicht fest Weiß: auf einer hellen Primärfarbe wäre der wichtigste Knopf der Seite
	   unlesbar (Logo-Orange des Rhein City Run: 3,05:1). Vorgabe bleibt Weiß. */
	color: var(--color-text-on-primary, #fff);
}
.be-consent__btn--accept:hover { background: var(--color-primary-dark, #B5000F); border-color: var(--color-primary-dark, #B5000F); }
.be-consent__btn--reject {
	background: var(--surface-raised);
	border-color: #fff;
	color: var(--color-text);
}
.be-consent__btn--reject:hover { opacity: 0.88; }

/* Container wird nur programmatisch fokussiert (tabindex=-1, für Screenreader) – kein sichtbarer
   Fokusrahmen, sonst erscheint beim Öffnen ein weißer Rahmen um den Banner. Interaktive Elemente
   (Buttons/Checkboxen) behalten ihren eigenen Fokusring. */
.be-consent:focus { outline: none; }
.be-consent__btn:focus-visible,
.be-consent__save:focus-visible,
.be-consent__details-toggle:focus-visible,
.be-consent__cat-toggle input:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* --- Mobil --- */
@media (max-width: 639px) {
	.be-consent__inner { flex-direction: column; gap: 0.75rem; }
	.be-consent__actions { flex-direction: row; width: 100%; }
	.be-consent__btn { flex: 1; padding: 0.65rem 0.5rem; }
}

/* ===== Karten-Gate ([data-be-map-gate]) ===== */
.be-map-gate {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-surface-2, #EBEBEB);
	border-radius: var(--radius-md, 4px);
	overflow: hidden;
}
.be-map-gate__notice {
	max-width: 420px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem;
	text-align: center;
	color: var(--color-text, #333);
}
.be-map-gate__icon { font-size: 1.75rem; margin: 0 0 0.5rem; }
.be-map-gate__text {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--color-text-muted, #666);
}
.be-map-gate__text a { color: var(--color-primary, #E2001A); }
.be-map-gate.is-loaded { background: none; min-height: 0; }
/* Zwei Klassen (0,0,2,0) schlagen die bestehenden .ct-map iframe / .anw-map-frame iframe (0,0,1,1):
   iframe bleibt vor Consent verborgen und bekommt die per --be-map-h übergebene Höhe. */
.be-map-gate .be-map-gate__iframe {
	display: none;
	width: 100%;
	height: var(--be-map-h, 380px);
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.be-consent__save, .be-consent__btn, .be-consent__details-toggle { transition: none; }
}
