/**
 * BVD Sitzplan – Optik der gemeinsamen Saalplan-Komponente.
 *
 * Farben und Verhalten aus dem Seehof-Prototyp: dunkler Grund, warmes Bühnenlicht,
 * Kategorie-Farben an den Sitzen, Pink für die eigene Auswahl.
 * Wird identisch in Editor, Kasse und Shop geladen.
 */

.bvd-saalplan {
	--bvd-bg: #17120E;
	--bvd-bg-tief: #0E0B09;
	--bvd-linie: rgba(232, 180, 92, 0.22);
	--bvd-gold: #E8B45C;
	--bvd-text: #F3EDE4;
	--bvd-text-leise: #9C8F7E;
	--bvd-pink: #F0399B;
	--bvd-verkauft: #4A423A;
	--bvd-gesperrt: #A6A6AD; /* 1.0.64: gesperrt = grau (vorher Braun #6E6154) */

	position: relative;
	overflow: hidden;
	background:
		radial-gradient(120% 80% at 50% 0%, #241B14 0%, var(--bvd-bg) 55%, var(--bvd-bg-tief) 100%);
	border-radius: 10px;
	touch-action: none;
	color: var(--bvd-text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bvd-saalplan__svg {
	display: block;
	width: 100%;
	height: auto;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.bvd-saalplan__svg.is-panning {
	cursor: grabbing;
}

/* --- Bühne ------------------------------------------------------------- */

.bvd-buehne__box {
	fill: rgba(255, 255, 255, 0.028);
	stroke: var(--bvd-linie);
	stroke-width: 1;
}

.bvd-buehne__rampe {
	fill: var(--bvd-gold);
	opacity: 0.85;
}

.bvd-buehne__label {
	fill: var(--bvd-gold);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.32em;
	opacity: 0.9;
}

.bvd-buehne__icon {
	fill: none;
	stroke: var(--bvd-text-leise);
	stroke-width: 1.2;
	opacity: 0.55;
}

/* --- Blöcke ------------------------------------------------------------ */

.bvd-block__label {
	fill: var(--bvd-text);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	opacity: 0.78;
}

.bvd-block__nr {
	fill: var(--bvd-text-leise);
	font-size: 9.5px;
	opacity: 0.7;
}

/* --- Sitze ------------------------------------------------------------- */

.bvd-sitz {
	transition: transform 0.12s ease, opacity 0.12s ease;
	transform-box: fill-box;
	transform-origin: center;
	outline: none;
}

.bvd-sitz.is-clickable {
	cursor: pointer;
}

.bvd-sitz.is-clickable:hover {
	transform: scale(1.28);
}

.bvd-sitz.is-clickable:focus-visible {
	stroke: var(--bvd-text);
	stroke-width: 2;
}

/* Verkauft und gesperrt überschreiben die Kategoriefarbe. */
.bvd-sitz.is-verkauft {
	fill: var(--bvd-verkauft) !important;
	cursor: not-allowed;
}

.bvd-sitz.is-gesperrt {
	fill: var(--bvd-gesperrt) !important;
	opacity: 0.85;
}

.bvd-sitz.is-hold {
	opacity: 0.4;
	cursor: not-allowed;
}

.bvd-sitz.is-selected {
	fill: var(--bvd-pink) !important;
	stroke: #FFF;
	stroke-width: 1.4;
	transform: scale(1.15);
}

/* Im Sperren-Modus sind gesperrte Plätze wieder anklickbar. */
.bvd-saalplan[data-modus="sperren"] .bvd-sitz.is-gesperrt {
	cursor: pointer;
}

/* --- Zoom -------------------------------------------------------------- */

.bvd-saalplan__zoom {
	position: absolute;
	left: 14px;
	bottom: 14px;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--bvd-linie);
	border-radius: 8px;
	overflow: hidden;
	background: rgba(14, 11, 9, 0.85);
	backdrop-filter: blur(6px);
}

.bvd-saalplan__zoom-btn {
	appearance: none;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--bvd-linie);
	color: var(--bvd-text);
	font-size: 13px;
	line-height: 1;
	padding: 11px 13px;
	cursor: pointer;
	transition: background 0.12s ease;
}

.bvd-saalplan__zoom-btn:last-child {
	border-bottom: 0;
	font-size: 10px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bvd-text-leise);
}

.bvd-saalplan__zoom-btn:hover {
	background: rgba(232, 180, 92, 0.12);
}

/* --- Hinweis & Tooltip ------------------------------------------------- */

.bvd-saalplan__hint {
	position: absolute;
	right: 14px;
	bottom: 14px;
	padding: 9px 16px;
	border: 1px solid var(--bvd-linie);
	border-radius: 8px;
	background: rgba(14, 11, 9, 0.85);
	color: var(--bvd-text-leise);
	font-size: 11.5px;
	pointer-events: none;
}

.bvd-saalplan__tooltip {
	position: absolute;
	z-index: 5;
	display: none;
	max-width: 240px;
	padding: 8px 11px;
	border: 1px solid var(--bvd-linie);
	border-radius: 7px;
	background: rgba(14, 11, 9, 0.96);
	color: var(--bvd-text);
	font-size: 12px;
	line-height: 1.45;
	pointer-events: none;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

.bvd-saalplan__tooltip.is-visible {
	display: block;
}

.bvd-saalplan__tooltip em {
	color: var(--bvd-text-leise);
	font-style: normal;
}

/* --- Legende (Sidebar, von Kasse und Shop genutzt) --------------------- */

.bvd-legende {
	border: 1px solid rgba(232, 180, 92, 0.18);
	border-radius: 10px;
	padding: 18px 20px;
	background: rgba(255, 255, 255, 0.02);
	color: #F3EDE4;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bvd-legende__titel {
	margin: 0 0 14px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #9C8F7E;
}

.bvd-legende__zeile {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 9px;
	font-size: 14px;
}

.bvd-legende__preis {
	margin-left: auto;
	font-weight: 600;
}

.bvd-legende__punkt {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	flex: 0 0 auto;
}

.bvd-legende__punkt--ausgewaehlt { background: #F0399B; }
.bvd-legende__punkt--verkauft { background: #4A423A; }
.bvd-legende__punkt--gesperrt { background: #6E6154; }

.bvd-legende__status {
	display: flex;
	gap: 18px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid rgba(232, 180, 92, 0.14);
	font-size: 12.5px;
	color: #9C8F7E;
}

.bvd-legende__status .bvd-legende__zeile {
	margin-bottom: 0;
	font-size: 12.5px;
}

/* --- Auswahl-Box ------------------------------------------------------- */

.bvd-auswahl {
	border: 1px solid rgba(232, 180, 92, 0.18);
	border-radius: 10px;
	padding: 18px 20px;
	background: rgba(255, 255, 255, 0.02);
	color: #F3EDE4;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bvd-auswahl__leer {
	color: #9C8F7E;
	font-size: 13.5px;
	line-height: 1.55;
}

.bvd-auswahl__liste {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
}

.bvd-auswahl__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(232, 180, 92, 0.1);
	font-size: 13.5px;
}

.bvd-auswahl__item-preis {
	margin-left: auto;
	font-weight: 600;
}

.bvd-auswahl__entfernen {
	appearance: none;
	background: transparent;
	border: 0;
	color: #9C8F7E;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 0 2px;
}

.bvd-auswahl__entfernen:hover {
	color: #F0399B;
}

.bvd-auswahl__summe {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-top: 14px;
	font-size: 13px;
	color: #9C8F7E;
}

.bvd-auswahl__summe-wert {
	font-size: 26px;
	font-weight: 700;
	color: #F3EDE4;
}

/* --- Mobil ------------------------------------------------------------- */

@media (max-width: 782px) {
	.bvd-saalplan__hint {
		display: none;
	}

	.bvd-saalplan__zoom-btn {
		padding: 13px 15px;
	}

	.bvd-sitz.is-clickable:hover {
		transform: none;
	}
}

/* --- Barrierefreiheit: Listenauswahl als Alternative zur Grafik -------- */

.bvd-sitz-liste {
	margin-top: 14px;
}

.bvd-sitz-liste__summary {
	color: #9C8F7E;
	cursor: pointer;
	font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
	.bvd-sitz {
		transition: none;
	}
}

/* --- Vollbild ---------------------------------------------------------- */
.bvd-saalplan--vollbild {
	position: fixed;
	inset: 0;
	z-index: 99999;
	width: 100vw;
	height: 100vh;
	max-height: none;
	margin: 0;
	border-radius: 0;
}

.bvd-saalplan--vollbild .bvd-saalplan__svg {
	width: 100%;
	height: 100%;
}

body.bvd-saalplan-vollbild-aktiv {
	overflow: hidden;
}

.bvd-saalplan:fullscreen,
.bvd-saalplan:-webkit-full-screen {
	width: 100vw;
	height: 100vh;
	border-radius: 0;
}
.bvd-saalplan:fullscreen .bvd-saalplan__svg,
.bvd-saalplan:-webkit-full-screen .bvd-saalplan__svg {
	width: 100%;
	height: 100%;
}

/* --- Sitztypen (nur bei freien Plätzen sichtbar; Verkaufsstatus hat Vorrang) --- */
.bvd-sitz[data-status="frei"][data-typ="rollstuhl"] { fill: #5CC9B4; }
/* 1.0.59 – Andreas, 25.09.2026: Dienstplätze (im Layout als „gesperrt" gezeichnet – Feuerwehr,
   Technik) sollen wie auf dem Hallenplan ROT stehen, nicht im Braun der Event-Sperren.
   Das Braun bleibt für Plätze, die je Event gesperrt werden (.is-gesperrt). */
/* 1.0.64 – Andreas: „gesperrt = grau, Dienstplätze roter Kasten ausgefüllt". Unabhängig vom
   Status (!important), weil Layout-Sperren auch als Status „gesperrt" ankommen. */
.bvd-sitz[data-typ="gesperrt"] { fill: #A6A6AD !important; stroke: #7C7C84 !important; stroke-width: 1 !important; opacity: 1 !important; }
.bvd-sitz[data-typ="dienst"]   { fill: #C8102E !important; stroke: #7A0A1C !important; stroke-width: 2 !important; opacity: 1 !important; cursor: not-allowed !important; }
.bvd-sitz[data-status="frei"][data-typ="steh"]      { fill: #E8B45C; }
.bvd-sitz[data-status="frei"][data-typ="ausbaubar"] { fill: #C98BD0; }

/* --- Tische ------------------------------------------------------------ */
.bvd-tisch { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.5; }
.bvd-tisch__label { fill: rgba(255, 255, 255, 0.55); font-size: 11px; font-weight: 600; }
