/* ===========================================================================
 * BAN Standardprodukt-Single – Zusätze zu ban-restposten-single.css
 * ---------------------------------------------------------------------------
 * Das Standardtemplate (single-produkt-ban.php) nutzt bewusst denselben
 * Container #ban-rps und die bewährten rps-*-Komponenten. Hier stehen nur die
 * wenigen Ergänzungen für die neuen Bausteine (bps-*): Stufen-Hinweis,
 * Gesamt-Zeile, €/m²-Suffix. Reine Additive, kein Eingriff in Restposten.
 * =========================================================================== */

/* €/m²-Suffix am Preis (auch in Shop-/Kategorie-Listen sichtbar) */
.bps-unit {
	font-size: .72em;
	font-weight: 600;
	opacity: .7;
	white-space: nowrap;
}

/* Stufen-Hinweis „Berechnet auf X,XX m Breite." unter den Feldern */
#ban-rps .bps-tierhint {
	margin-top: 6px;
}
#ban-rps .bps-tiernote {
	font-weight: 700;
	color: #6b5b3e; /* gedämpftes BAN-Braun, harmoniert mit der Restposten-CI */
}

/* Zusatzzeile „Gesamt inkl. Einfassung" in der Summenbox */
#ban-rps .bps-summary .bps-total-wrap {
	font-weight: 600;
}
#ban-rps .bps-summary .bps-total-wrap[hidden] {
	display: none !important;
}
#ban-rps .bps-summary .bps-total {
	white-space: nowrap;
}

/* „nach Maß" hat zwei Felder → etwas Luft zwischen Länge × Breite (wie qm) */
#ban-rps.bps-nachmass .rps-qm__fields {
	align-items: end;
}

/* ── Farbumschalter (Teil 2): großes Foto + Swatches ──────────────────────── */
#ban-rps .bps-gal { border-radius: 12px; overflow: hidden; }
#ban-rps .bps-main-img { display: block; width: 100%; height: auto; border-radius: 12px; }
#ban-rps .bps-main-tile { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; }
#ban-rps .bps-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 24px; }
#ban-rps .bps-sw {
	width: 46px; height: 46px; border-radius: 10px; padding: 0; position: relative;
	border: 1px solid rgba(0,0,0,.14); cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease;
}
#ban-rps .bps-sw:hover { transform: translateY(-2px); }
#ban-rps .bps-sw:focus-visible { outline: 2px solid #5f6747; outline-offset: 2px; }
#ban-rps .bps-sw[aria-checked="true"] { box-shadow: 0 0 0 2px #faf7f0, 0 0 0 4px #5f6747; }
#ban-rps .bps-sw__nm {
	position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
	font-size: 11px; white-space: nowrap; color: #6b5b3e; opacity: 0;
	pointer-events: none; transition: opacity .15s ease;
}
#ban-rps .bps-sw:hover .bps-sw__nm { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
	#ban-rps .bps-sw { transition: none; }
	#ban-rps .bps-sw:hover { transform: none; }
}

/* Farbwähler in der rechten Spalte (über den Maß-Eingaben) */
#ban-rps .bps-colorpick { margin: 18px 0 0; padding: 0 18px; }
#ban-rps .bps-colorpick__cap { display: flex; align-items: center; gap: 6px; font-size: .95rem; color: #4a4a42; margin: 0 0 10px; }
#ban-rps .bps-colorpick__cap svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }
#ban-rps .bps-colorpick .bps-swatches { margin: 0; }

/* „ab" vor dem m²-Preis und Hinweis, für welche Breite der Preis gilt */
.bps-from {
	font-size: .55em;
	font-weight: 600;
	opacity: .75;
	margin-right: .15em;
}
#ban-rps .bps-pricenote {
	margin: 10px 0 14px;
	font-size: 14px;
	line-height: 1.45;
	color: #5a5040;
}

/* Das „ab" steht vor dem Betrag: Betrag trotzdem groß, grün und in der Display-Schrift
   (die Restposten-Regel greift nur, wenn der Betrag das erste Element ist). */
#ban-rps .rps-summary .price > .bps-from {
	font-family: var(--disp);
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--green-dk);
	opacity: 1;
	margin-right: -4px;
}
#ban-rps .rps-summary .price > .bps-from + .woocommerce-Price-amount {
	font-family: var(--disp);
	font-size: 2.15rem;
	font-weight: 700;
	color: var(--green-dk);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* Produktbeschreibung mobil: rechts/links umflossene Bilder über die volle Breite,
   sonst quetscht das Bild den Text in eine schmale Spalte. */
@media (max-width: 640px) {
	#ban-rps .rps-desc img.alignright,
	#ban-rps .rps-desc img.alignleft,
	#ban-rps .rps-desc .alignright,
	#ban-rps .rps-desc .alignleft {
		float: none;
		display: block;
		width: 100%;
		max-width: 100%;
		height: auto;
		margin: 0 0 16px;
	}
}

/* ── Umschalter „Teppich nach Maß" / „Bahnenware ohne Einfassung" ─────────────
   Segment-Schalter wie im Mockup, aber deutlich markiert: grüner Rahmen um das
   Ganze, gewählte Seite dunkelgrün gefüllt mit Häkchen, jede Seite mit Symbol. */
#ban-rps [data-only][hidden] { display: none; }
#ban-rps .bps-format { margin: 18px 0 6px; }
#ban-rps .bps-format__q {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--green-dk);
}
#ban-rps .bps-format__opts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
	padding: 5px;
	background: var(--surface);
	border: 2px solid var(--green);
	border-radius: var(--radius);
}
#ban-rps .bps-fmt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 62px;
	padding: 10px 14px;
	text-align: left;
	font: inherit;
	color: var(--ink);
	background: transparent;
	border: 0;
	border-radius: calc(var(--radius) - 4px);
	white-space: normal; /* Theme setzt bei Buttons nowrap, Untertitel sonst abgeschnitten */
	cursor: pointer;
	transition: background .15s, color .15s;
}
#ban-rps .bps-fmt:not(.is-active):hover { background: #EEF0E0; background: color-mix(in srgb, var(--green) 10%, transparent); }
#ban-rps .bps-fmt__s { overflow-wrap: anywhere; }

#ban-rps .bps-fmt__ico { display: flex; flex-shrink: 0; color: var(--green-dk); }
#ban-rps .bps-fmt__ico svg { width: 22px; height: 22px; }
#ban-rps .bps-fmt__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#ban-rps .bps-fmt__t { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
#ban-rps .bps-fmt__s { font-size: 13px; line-height: 1.3; color: var(--ink-mid); }
#ban-rps .bps-fmt.is-active {
	color: #fff;
	background: var(--green-dk);
	box-shadow: 0 4px 12px rgba(79, 106, 31, .28);
}
#ban-rps .bps-fmt.is-active .bps-fmt__ico,
#ban-rps .bps-fmt.is-active .bps-fmt__s { color: #EEF0E0; }
#ban-rps .bps-fmt__chk {
	display: none;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	margin-left: auto;
	border-radius: 50%;
	color: var(--green-dk);
	background: #fff;
}
#ban-rps .bps-fmt__chk svg { width: 14px; height: 14px; }
#ban-rps .bps-fmt.is-active .bps-fmt__chk { display: flex; }
/* Dunkelmodus: Das aktive Grün ist dort hell, deshalb dunkle Schrift statt Weiß */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) #ban-rps .bps-fmt.is-active,
	:root:not([data-theme="light"]) #ban-rps .bps-fmt.is-active .bps-fmt__ico { color: var(--on-green); }
	:root:not([data-theme="light"]) #ban-rps .bps-fmt.is-active .bps-fmt__s { color: var(--on-green); opacity: .8; }
	:root:not([data-theme="light"]) #ban-rps .bps-fmt__chk { background: var(--on-green); }
}
:root[data-theme="dark"] #ban-rps .bps-fmt.is-active,
:root[data-theme="dark"] #ban-rps .bps-fmt.is-active .bps-fmt__ico { color: var(--on-green); }
:root[data-theme="dark"] #ban-rps .bps-fmt.is-active .bps-fmt__s { color: var(--on-green); opacity: .8; }
:root[data-theme="dark"] #ban-rps .bps-fmt__chk { background: var(--on-green); }

/* Feste Breite bei Bahnenware und Hinweis zur offenen Kante */
#ban-rps .bps-fixlabel {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-mid);
}
#ban-rps .bps-fixw {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 48px;
	padding: 0 14px;
	font-size: 17px;
	font-weight: 600;
	background: #F1F3E6; /* Ersatz für Browser ohne color-mix */
	background: color-mix(in srgb, var(--green) 8%, transparent);
	border: 1px dashed var(--green);
	border-radius: var(--radius-sm);
}
#ban-rps .bps-fixw small { font-size: 12px; font-weight: 600; color: var(--green-dk); }
#ban-rps .bps-bahninfo {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 14px 0;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink-mid);
	background: #F1F3E6; /* Ersatz für Browser ohne color-mix */
	background: color-mix(in srgb, var(--green) 9%, transparent);
	border-radius: var(--radius-sm);
}
#ban-rps .bps-bahninfo svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--green); }
#ban-rps .bps-bahninfo strong { color: var(--ink); }

@media (max-width: 420px) {
	#ban-rps .bps-fmt { gap: 7px; padding: 8px 9px; }
	#ban-rps .bps-fmt__ico svg { width: 18px; height: 18px; }
	#ban-rps .bps-fmt__t { font-size: 14px; }
	#ban-rps .bps-fmt__s { font-size: 12px; }
	#ban-rps .bps-fmt__chk { display: none !important; }
}

/* ── Lieferung im Preis (Absprache Oschwald 15.10.2026, Mockup A4) ───────────── */
/* Plakette „inkl. Lieferung" hinter dem m²-Preis */
.bps-ship-incl {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 99px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	color: #3B5214;
	background: #EEF0E0;
}
#ban-rps .rps-summary .price > .bps-ship-incl { align-self: center; font-family: inherit; }
/* Versandkosten stecken im Preis: German-Market-Zeile „zzgl. Versand" auf dieser Seite ausblenden */
#ban-rps.mode-produkt .woocommerce_de_versandkosten { display: none; }

/* Endpreis-Box „Ihr Preis" (kompakt, Text und Betrag mittig auf einer Höhe) */
#ban-rps .bps-pricebox {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 14px 0;
	padding: 8px 14px;
	background: var(--surface-2);
	border-radius: var(--radius-sm);
}
#ban-rps .bps-pricebox__l { display: flex; flex-direction: column; line-height: 1.3; }
#ban-rps .bps-pricebox__l strong { font-size: 15px; color: var(--ink); }
#ban-rps .bps-pricebox__l span { font-size: 13px; color: var(--ink-mid); }
#ban-rps .bps-pricebox .bps-total {
	font-family: var(--disp);
	font-size: 28px;
	line-height: 1.1;
	font-weight: 700;
	color: var(--ink);
	white-space: nowrap;
}

/* ── Handy: Mini-Leiste beim Scrollen + Foto im Vollbild (Mockup A5) ─────────
   Erscheint nur bis 900 px Breite (einspaltiges Layout), sobald das große Foto
   nach oben aus dem Bild gescrollt ist. Steuerung per Skript im Template. */
#ban-rps .bps-minibar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 990; /* unter dem mobilen Menü (997) und dessen Overlay (998) */
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: var(--surface); /* Theme-Farbe, damit die Schrift auch im Dunkelmodus lesbar ist */
	border-bottom: 1px solid var(--border);
	box-shadow: 0 6px 16px rgba(44, 42, 35, .14);
}
#ban-rps .bps-minibar[hidden] { display: none; }
#ban-rps .bps-minibar__thumb {
	flex: none;
	width: 54px;
	height: 54px;
	padding: 0;
	overflow: hidden;
	background: var(--surface-2);
	border: 2px solid var(--green);
	border-radius: 9px;
	cursor: zoom-in;
}
#ban-rps .bps-minibar__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
#ban-rps .bps-minibar__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
#ban-rps .bps-minibar__name,
#ban-rps .bps-minibar__var { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#ban-rps .bps-minibar__name { font-size: 13px; font-weight: 700; color: var(--ink); }
#ban-rps .bps-minibar__var { font-size: 12px; color: var(--ink-mid); }
#ban-rps .bps-minibar__price { font-family: var(--disp); font-size: 16px; font-weight: 700; color: var(--ink); }
#ban-rps .bps-minibar__cart {
	flex: none;
	min-height: 44px;
	padding: 0 12px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.2;
	white-space: normal;
	color: var(--on-green);
	background: var(--green);
	border: 0;
	border-radius: 9px;
	cursor: pointer;
}
@media (min-width: 901px) { #ban-rps .bps-minibar { display: none !important; } }

#ban-rps .bps-zoom {
	position: fixed;
	inset: 0;
	z-index: 1001;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
	background: rgba(28, 27, 22, .92);
}
#ban-rps .bps-zoom[hidden] { display: none; }
#ban-rps .bps-zoom img { width: 100%; max-width: 640px; max-height: 75vh; object-fit: contain; border-radius: 12px; }
#ban-rps .bps-zoom__cap { color: #FAF6EE; font-size: 14px; text-align: center; }
#ban-rps .bps-zoom__close {
	min-height: 44px;
	padding: 0 22px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #FAF6EE;
	background: transparent;
	border: 2px solid #FAF6EE;
	border-radius: 99px;
	cursor: pointer;
}
