/* Webfluss Produktwahl – Farbpunkte und Grössen-Knöpfe */
:root {
	--wfpw-dot: 32px;
	--wfpw-accent-fallback: var(--theme-palette-color-1, #c8102e);
}
.wfpw {
	--wfpw-a: var(--wfpw-accent, var(--wfpw-accent-fallback));
	--wfpw-line: var(--theme-border-color, #dfe3e8);
	--wfpw-text: var(--theme-headings-color, #1b1d21);
	display: flex; flex-wrap: wrap; gap: 10px;
	width: 100%; margin: 6px 0 4px; padding: 0;
}
.wfpw *, .wfpw *::before, .wfpw *::after { box-sizing: border-box; }

/* Originales Auswahlfeld bleibt im Formular (WooCommerce braucht es), ist aber unsichtbar. */
select.wfpw-select {
	position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
	opacity: 0 !important; pointer-events: none !important; clip: rect(0 0 0 0); overflow: hidden; border: 0 !important; padding: 0 !important;
}
/* Tabelle der Varianten: Beschriftung über der Auswahl */
.variations_form table.variations tr:has(.wfpw) { display: block; margin-bottom: 14px; }
.variations_form table.variations tr:has(.wfpw) th,
.variations_form table.variations tr:has(.wfpw) td { display: block; width: 100%; padding: 0 !important; border: 0; text-align: left; }
.variations_form table.variations tr:has(.wfpw) th label { font-weight: 600; }
.wfpw-chosen { font-weight: 400; opacity: .8; }

/* Theme-Button-Stile zurücksetzen */
.wfpw button.wfpw-dot, .wfpw button.wfpw-size {
	-webkit-appearance: none; appearance: none; margin: 0; min-height: 0; line-height: 1.2;
	letter-spacing: normal; text-transform: none; text-decoration: none; box-shadow: none; cursor: pointer;
	font: inherit; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease, opacity .15s;
}
.wfpw button:focus { outline: none; }
.wfpw button:focus-visible { outline: 2px solid var(--wfpw-a); outline-offset: 3px; }

/* ---------- Farbpunkte ---------- */
.wfpw button.wfpw-dot {
	position: relative; flex: none; width: calc(var(--wfpw-dot) + 8px); height: calc(var(--wfpw-dot) + 8px); min-width: 0; padding: 3px;
	border: 2px solid transparent; border-radius: 50%; background: transparent;
}
.wfpw .wfpw-dot:hover { transform: translateY(-1px); border-color: var(--wfpw-line); }
.wfpw .wfpw-dot.is-sel { border-color: var(--wfpw-a); }
.wfpw-dot-in, .wfpw-loop-dot {
	display: block; width: 100%; height: 100%; border-radius: 50%;
	background-color: var(--c);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.is-light > .wfpw-dot-in, .wfpw-loop-dot.is-light { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }

/* Effekte – flache Farbflächen wie echte Folienmuster, Metallic mit weichem Verlauf, Chrom mit harter Spiegelkante */
.wfpw-fx-gloss > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-gloss { background-image: none; }
/* Matt: dunkle Farben eine Spur heller, helle Farben eine Spur grauer – wie das echte Folienmuster */
.wfpw-fx-matt > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-matt { background-image: linear-gradient(rgba(255, 255, 255, .1), rgba(255, 255, 255, .1)); }
.wfpw-fx-matt.is-light > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-matt.is-light { background-image: linear-gradient(rgba(0, 0, 0, .055), rgba(0, 0, 0, .055)); }
.wfpw-fx-gold > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-gold {
	background-image: linear-gradient(135deg, #a07d2a 0%, #d9b85c 28%, #f1dc94 46%, #c9a23f 64%, #8f6d1f 100%);
}
.wfpw-fx-silver > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-silver {
	background-image: linear-gradient(135deg, #8e9398 0%, #c9cdd1 28%, #f2f3f4 46%, #b4b8bc 64%, #7f8489 100%);
}
.wfpw-fx-copper > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-copper {
	background-image: linear-gradient(135deg, #7a4a28 0%, #c07e4c 30%, #edb98e 48%, #b26f3d 66%, #6e4021 100%);
}
.wfpw-fx-chrome > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-chrome {
	background-image: linear-gradient(135deg, #f1f1f1 0%, #a9a9a9 30%, #ffffff 47%, #ffffff 50%, #6f6f6f 53%, #c2c2c2 75%, #f4f4f4 100%);
}
.wfpw-fx-goldchrome > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-goldchrome {
	background-image: linear-gradient(135deg, #ffe7a3 0%, #e0a520 30%, #fff1c4 47%, #ffd879 50%, #9a6200 53%, #d8961a 75%, #ffe39a 100%);
}
.wfpw-fx-holo > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-holo {
	background-image: linear-gradient(135deg, #f7b6d8 0%, #c9b8f5 28%, #9fe7e2 52%, #c8f0b4 70%, #f9e7a8 86%, #f7b6d8 100%);
}
.wfpw-fx-glitter > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-glitter {
	background-image: radial-gradient(rgba(255, 255, 255, .85) .7px, transparent 1px), radial-gradient(rgba(255, 255, 255, .45) .6px, transparent .9px);
	background-size: 5px 5px, 7px 7px; background-position: 0 0, 2px 3px;
}
.wfpw-fx-transparent > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-transparent {
	background-color: #fff;
	background-image: linear-gradient(45deg, #e6e8eb 25%, transparent 25%), linear-gradient(-45deg, #e6e8eb 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e6e8eb 75%), linear-gradient(-45deg, transparent 75%, #e6e8eb 75%);
	background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}
.wfpw-fx-reflex > .wfpw-dot-in, .wfpw-loop-dot.wfpw-fx-reflex {
	background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .35) 0 2px, rgba(255, 255, 255, 0) 2px 6px);
}

/* Nicht erhältlich / nicht an Lager */
.wfpw .is-na { opacity: .32; }
.wfpw .wfpw-dot.is-na::after, .wfpw .wfpw-dot.is-out::after {
	content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px;
	background: var(--wfpw-text); transform: rotate(45deg); border-radius: 2px; opacity: .7;
}
.wfpw .is-out { opacity: .55; }

/* ---------- Grössen ---------- */
.wfpw--size { gap: 8px; }
.wfpw button.wfpw-size {
	height: auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	min-width: 76px; padding: 9px 14px; border: 1.5px solid var(--wfpw-line); border-radius: 10px;
	background: #fff; color: var(--wfpw-text);
}
.wfpw .wfpw-size:hover { border-color: var(--wfpw-text); transform: translateY(-1px); }
.wfpw-size-name { font-weight: 700; font-size: 15px; white-space: nowrap; }
.wfpw-size-price { font-size: 12px; opacity: .75; white-space: nowrap; }
.wfpw .wfpw-size.is-sel { border-color: var(--wfpw-a); background: var(--wfpw-a); color: #fff; }
.wfpw .wfpw-size.is-sel .wfpw-size-price { opacity: .9; }
.wfpw .wfpw-size.is-na { text-decoration: line-through; }

/* ---------- Shop-Übersicht ---------- */
.wfpw-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 6px 0 4px; }
.products .wfpw-loop, .wfpw-loop.is-center { justify-content: inherit; }
.wfpw-loop-dot { display: inline-block; width: 15px; height: 15px; flex: none; }
.wfpw-loop-more { font-size: 12px; opacity: .7; line-height: 15px; }

@media (max-width: 600px) {
	.wfpw .wfpw-size { min-width: 0; flex: 1 1 calc(33.33% - 8px); padding: 9px 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.wfpw button { transition: none; }
}
