/**
 * Wirbelprint Filamente – Frontend.
 * Bewusst ohne feste Maximalbreite: die Breite bestimmt der Divi Builder.
 */

.wpf {
	--wpf-radius: 10px;
	--wpf-rand: #e2e2e2;
	--wpf-grau: #6b6b6b;
	--wpf-min: 240px;
	box-sizing: border-box;
	color: inherit;
	font-size: 1rem;
}

.wpf *,
.wpf *::before,
.wpf *::after {
	box-sizing: border-box;
}

/*
 * Divi-Falle: Divi/Themes überschreiben gern `display` auf Elementen und schlagen
 * damit die schwache Browser-Regel `[hidden] { display: none }`. Ohne diese Härtung
 * würden gefilterte Karten, Drawer und ausgeblendete Formulare sichtbar bleiben.
 */
.wpf [hidden],
.wpf[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- Filter */

.wpf-filter {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 18px;
}

.wpf-filter__zeile {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
}

.wpf-feld {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Nur in der Filterleiste wachsen die Felder nebeneinander; im Formular stapeln sie eng. */
.wpf-filter .wpf-feld {
	flex: 1 1 170px;
	min-width: 150px;
}

.wpf-filter .wpf-feld--suche {
	flex: 2 1 240px;
}

.wpf-feld__label {
	font-size: 0.78rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wpf-grau);
}

.wpf-feld input,
.wpf-feld select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--wpf-rand);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	color: inherit;
}

.wpf-feld input:focus-visible,
.wpf-feld select:focus-visible,
.wpf .wpf-btn:focus-visible,
.wpf-farbe:focus-visible {
	outline: 2px solid var(--wpf-akzent, #1f7a8c);
	outline-offset: 2px;
}

.wpf-farben {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wpf-farbe {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 11px 5px 6px;
	border: 1px solid var(--wpf-rand);
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 0.85rem;
	line-height: 1.2;
}

.wpf-farbe.is-aktiv {
	border-color: var(--wpf-akzent, #1f7a8c);
	box-shadow: inset 0 0 0 1px var(--wpf-akzent, #1f7a8c);
}

.wpf-farbe__punkt {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.18);
	flex: 0 0 auto;
}

.wpf-filter__zeile--schalter {
	gap: 18px;
	font-size: 0.9rem;
}

.wpf-schalter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.wpf-link {
	border: 0;
	background: none;
	padding: 0;
	color: var(--wpf-akzent, #1f7a8c);
	cursor: pointer;
	font: inherit;
	text-decoration: underline;
}

.wpf-treffer {
	margin: 0 0 14px;
	color: var(--wpf-grau);
	font-size: 0.9rem;
}

/* --------------------------------------------------------- Marken-Gruppen */

.wpf-gruppe {
	margin-bottom: 40px;
}

.wpf-gruppe:last-child {
	margin-bottom: 0;
}

.wpf-gruppe__kopf {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 18px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--wpf-rand);
}

.wpf-gruppe__titel {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: none;
}

.wpf-gruppe__logo {
	display: block;
	max-height: 34px;
	max-width: 170px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.wpf-gruppe__zahl {
	margin-left: auto;
	color: var(--wpf-grau);
	font-size: 0.85rem;
	white-space: nowrap;
}

/* ----------------------------------------------------------------- Grid */

.wpf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--wpf-min), 1fr));
	gap: 22px;
	align-items: start;
}

.wpf-karte {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--wpf-rand);
	border-radius: var(--wpf-radius);
	background: #fff;
	overflow: hidden;
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.wpf-karte:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
	transform: translateY(-2px);
}

.wpf-karte.is-aus {
	opacity: 0.62;
}

.wpf-karte__bild {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #f4f4f4;
	overflow: hidden;
}

.wpf-karte__bild img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wpf-karte__platzhalter {
	display: block;
	width: 100%;
	height: 100%;
}

.wpf-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 9px;
	border-radius: 999px;
	background: #b3261e;
	color: #fff;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.wpf-badge--aus {
	top: auto;
	bottom: 10px;
	background: #333;
}

.wpf-karte__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 15px 16px;
	flex: 1 1 auto;
}

.wpf-karte__marke {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wpf-grau);
}

/* Markenkennung (Karte + Gruppen-Überschrift) */
.wpf-marke__punkt {
	display: inline-block;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
	flex: 0 0 auto;
}

.wpf-marke__logo {
	display: inline-block;
	max-height: 22px;
	max-width: 120px;
	width: auto;
	height: auto;
	object-fit: contain;
	vertical-align: middle;
}

.wpf-karte__titel {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.32;
}

.wpf-karte__titel a {
	color: inherit;
	text-decoration: none;
}

.wpf-karte__daten {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpf-tag {
	padding: 3px 8px;
	border-radius: 6px;
	background: #f1f1f1;
	font-size: 0.76rem;
	color: #444;
}

.wpf-karte__preis {
	margin: 2px 0 0;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}

.wpf-karte__preis strong {
	font-size: 1.22rem;
}

.wpf-karte__proKg {
	font-size: 0.8rem;
	color: var(--wpf-grau);
}

.wpf-karte__bestand {
	margin: 0;
	font-size: 0.86rem;
}

.wpf-verf {
	color: #1f7a3c;
}

.wpf-verf--knapp {
	color: #b06000;
}

.wpf-verf--aus {
	color: #b3261e;
}

.wpf-karte__aktion {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

.wpf-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--wpf-rand);
	border-radius: 8px;
	overflow: hidden;
}

.wpf-stepper__btn {
	border: 0;
	background: #f5f5f5;
	width: 32px;
	cursor: pointer;
	font-size: 1.05rem;
	line-height: 1;
	color: #222;
}

.wpf-stepper__wert {
	width: 46px;
	border: 0;
	border-left: 1px solid var(--wpf-rand);
	border-right: 1px solid var(--wpf-rand);
	text-align: center;
	font: inherit;
	padding: 7px 2px;
	background: #fff;
	color: #222;
	-moz-appearance: textfield;
}

.wpf-stepper__wert::-webkit-outer-spin-button,
.wpf-stepper__wert::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wpf .wpf-btn {
	flex: 1 1 auto;
	padding: 9px 14px;
	border: 0;
	border-radius: 8px;
	background: var(--wpf-akzent, #1f7a8c);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.wpf .wpf-btn:hover {
	filter: brightness(1.08);
}

.wpf .wpf-btn.is-drin {
	background: #1f7a3c;
}

.wpf .wpf-btn--gross {
	width: 100%;
	padding: 13px 18px;
	font-size: 1.03rem;
}

.wpf-datenblatt {
	font-size: 0.83rem;
	color: var(--wpf-akzent, #1f7a8c);
}

.wpf-keine {
	padding: 26px 0;
	text-align: center;
	color: var(--wpf-grau);
}

/* ------------------------------------------------------------ Warenkorb */

.wpf-korb-knopf {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 13px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--wpf-akzent, #1f7a8c);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.wpf-korb-knopf__zahl {
	min-width: 24px;
	height: 24px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.22);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
}

/*
 * Reservierung als natives <dialog> im Top-Layer: liegt zuverlässig über der
 * gesamten Theme-Chrome – auch über Divis klebendem Header – unabhängig von
 * z-index oder transformierten Eltern-Containern. Kein eigener z-index nötig.
 */
.wpf-korb--modal {
	position: fixed;
	inset: 0;
	margin: auto;
	width: min(880px, calc(100% - 32px));
	max-width: min(880px, calc(100% - 32px));
	max-height: calc(100vh - 40px);
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: #fff;
	color: inherit;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
	overflow: auto;
	overscroll-behavior: contain;
}

.wpf-korb--modal::backdrop {
	background: rgba(15, 23, 27, 0.55);
}

.wpf-korb--modal[open] {
	animation: wpf-pop-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.wpf-korb--modal[open]::backdrop {
	animation: wpf-fade 0.18s ease-out;
}

@keyframes wpf-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wpf-pop-in {
	from { opacity: 0; transform: translateY(8px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.wpf-korb--modal[open],
	.wpf-korb--modal[open]::backdrop {
		animation: none;
	}
}

.wpf-korb--inline {
	border: 1px solid var(--wpf-rand);
	border-radius: var(--wpf-radius);
	background: #fff;
}

.wpf-korb__inner {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wpf-korb__kopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Kopf bleibt beim internen Scrollen des Popups oben stehen. */
.wpf-korb--modal .wpf-korb__kopf {
	position: sticky;
	top: 0;
	z-index: 2;
	margin: -20px -20px 6px;
	padding: 16px 20px;
	background: #fff;
	border-bottom: 1px solid var(--wpf-rand);
	border-radius: 14px 14px 0 0;
}

.wpf-korb__kopf h3 {
	margin: 0;
	font-size: 1.15rem;
}

.wpf-korb__zu {
	border: 0;
	background: none;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
	color: #444;
}

/* Zweispaltig: links Warenkorb + Summe, rechts das Formular. */
.wpf-korb__body {
	display: grid;
	gap: 20px;
}

.wpf-korb__spalte {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

@media (min-width: 700px) {
	.wpf-korb__body {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 30px;
		align-items: start;
	}

	.wpf-korb__spalte--form {
		position: relative;
		padding-left: 30px;
	}

	.wpf-korb__spalte--form::before {
		content: "";
		position: absolute;
		left: 0;
		top: 4px;
		bottom: 4px;
		width: 1px;
		background: var(--wpf-rand);
	}
}

.wpf-korb__leer {
	color: var(--wpf-grau);
	margin: 0;
}

.wpf-zeile {
	display: grid;
	grid-template-columns: 54px 1fr auto;
	grid-template-areas:
		"bild text weg"
		"bild menge summe";
	gap: 6px 10px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--wpf-rand);
}

.wpf-zeile__bild {
	grid-area: bild;
	width: 54px;
	height: 54px;
	object-fit: cover;
	border-radius: 6px;
}

.wpf-zeile__text {
	grid-area: text;
	display: flex;
	flex-direction: column;
	font-size: 0.9rem;
	line-height: 1.35;
}

.wpf-zeile__marke,
.wpf-zeile__preis {
	color: var(--wpf-grau);
	font-size: 0.8rem;
}

.wpf-zeile__menge {
	grid-area: menge;
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--wpf-rand);
	border-radius: 8px;
	overflow: hidden;
	width: max-content;
}

.wpf-zeile__menge input {
	width: 44px;
	border: 0;
	border-left: 1px solid var(--wpf-rand);
	border-right: 1px solid var(--wpf-rand);
	text-align: center;
	font: inherit;
	padding: 5px 0;
	-moz-appearance: textfield;
}

.wpf-zeile__summe {
	grid-area: summe;
	font-weight: 600;
	text-align: right;
}

.wpf-zeile__weg {
	grid-area: weg;
	border: 0;
	background: none;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	color: #999;
}

.wpf-chip {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 999px;
	background: #b3261e;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
}

.wpf-hinweis {
	margin: 0;
	padding: 9px 12px;
	border-radius: 8px;
	background: #fff6e5;
	border: 1px solid #f0dcae;
	font-size: 0.87rem;
}

.wpf-summe__zeile {
	display: flex;
	justify-content: space-between;
	margin: 0 0 4px;
	font-size: 0.94rem;
}

.wpf-summe__zeile--rabatt {
	color: #1f7a3c;
}

.wpf-summe__zeile--gesamt {
	font-size: 1.1rem;
	font-weight: 700;
	border-top: 1px solid var(--wpf-rand);
	padding-top: 8px;
	margin-top: 8px;
}

.wpf-summe__meta {
	margin: 0;
	color: var(--wpf-grau);
	font-size: 0.83rem;
}

.wpf-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wpf-form__intro {
	margin: 0;
	font-size: 0.88rem;
	color: var(--wpf-grau);
}

.wpf-check {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 0.86rem;
	line-height: 1.45;
}

.wpf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wpf-form__meldung {
	margin: 0;
	font-size: 0.9rem;
}

.wpf-fehler {
	color: #b3261e;
}

.wpf-geschlossen {
	margin: 0;
	padding: 12px 14px;
	border-radius: 8px;
	background: #fdecea;
	border: 1px solid #f3c0bb;
	font-size: 0.9rem;
}

.wpf-danke {
	padding: 14px;
	border-radius: 8px;
	background: #eaf6ee;
	border: 1px solid #b9dfc6;
}

.wpf-danke h4 {
	margin: 0 0 6px;
}

body.wpf-korb-offen {
	overflow: hidden;
}

/* -------------------------------------------------------- Einzelansicht */

.wpf-single__daten {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px 22px;
}

.wpf-single__daten li {
	display: flex;
	flex-direction: column;
	padding-bottom: 7px;
	border-bottom: 1px solid var(--wpf-rand);
}

.wpf-single__daten span {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wpf-grau);
}

.wpf-staffel {
	padding: 14px 16px;
	border-radius: var(--wpf-radius);
	background: #fff6e5;
	border: 1px solid #f0dcae;
	margin-bottom: 18px;
}

.wpf-staffel ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.wpf-single__aktion {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin: 16px 0;
}

.wpf-single-seite__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 30px;
	padding: 30px 20px;
}

/* -------------------------------------------------------- Öffnungszeiten */

.wpf-oz__tabelle {
	width: 100%;
	border-collapse: collapse;
}

.wpf-oz__tabelle th,
.wpf-oz__tabelle td {
	padding: 7px 10px;
	border-bottom: 1px solid var(--wpf-rand);
	text-align: left;
}

.wpf-oz__tabelle tr.is-heute {
	font-weight: 700;
	background: #f6f6f6;
}

.wpf-oz__abw {
	margin: 14px 0 0;
	padding-left: 20px;
	font-size: 0.9rem;
}

@media (max-width: 640px) {
	.wpf-korb--modal {
		width: calc(100% - 20px);
		max-width: calc(100% - 20px);
		max-height: calc(100vh - 20px);
	}

	.wpf-filter__zeile {
		gap: 10px;
	}
}
