/*
 * WS Custom Woo – Produktseite, Warenkorb, Kasse.
 * Farben/Maße kommen als CSS-Variablen aus den Einstellungen. Feinstyling über das Shop-CSS;
 * stabile Klassen: wscw-group, wscw-toggle, wscw-field, wscw-pos (aria-pressed), wscw-price, wscw-chip, wscw-note.
 */
.wscw,
.wscw-chips {
	--wscw-accent: #009fe3;
	--wscw-accent-text: #fff;
	--wscw-text: #1d1d1b;
	--wscw-muted: color-mix(in srgb, var(--wscw-text) 60%, transparent);
	--wscw-border: #d5dbe1;
	--wscw-bg: #fff;
	--wscw-soft: color-mix(in srgb, var(--wscw-accent) 10%, var(--wscw-bg));
	--wscw-error: #d63638;
	--wscw-radius: 12px;
	--wscw-height: 50px;
	--wscw-font-size: 16px;
}
.wscw {
	clear: both;
	width: 100%;
	margin: 0 0 20px;
	color: var(--wscw-text);
	font-size: var(--wscw-font-size);
	line-height: 1.4;
	display: grid;
	gap: 16px;
}
.wscw *, .wscw *::before, .wscw *::after { box-sizing: border-box; }
.wscw [hidden] { display: none !important; }

.wscw-heading { font-weight: 700; font-size: 1.1em; }

/* Gruppe als Karte mit Schalter */
.wscw-group--toggle {
	border: 2px solid var(--wscw-border);
	border-radius: calc(var(--wscw-radius) + 8px);
	background: var(--wscw-bg);
	overflow: hidden;
	transition: border-color .25s ease, box-shadow .25s ease;
}
.wscw-group--toggle.is-open { border-color: var(--wscw-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wscw-accent) 12%, transparent); }
.wscw .wscw-toggle {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: 0;
	padding: 16px 18px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
}
.wscw-toggle-text { display: grid; gap: 2px; min-width: 0; }
.wscw-toggle-title { font-weight: 700; font-size: 1.15em; line-height: 1.2; }
.wscw-toggle-sub { font-size: .875em; color: var(--wscw-muted); }
.wscw-switch { position: relative; flex: none; width: 50px; height: 30px; margin-left: auto; border-radius: 999px; background: var(--wscw-border); transition: background-color .25s ease; }
.wscw-switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.is-open > .wscw-toggle .wscw-switch { background: var(--wscw-accent); }
.is-open > .wscw-toggle .wscw-switch::after { transform: translateX(20px); }
.wscw .wscw-toggle:focus-visible { outline: 3px solid var(--wscw-accent); outline-offset: -3px; }

.wscw-group--toggle .wscw-group-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.22, 1, .36, 1); }
.wscw-group--toggle.is-open .wscw-group-body { grid-template-rows: 1fr; }
.wscw-group-inner { min-height: 0; overflow: hidden; }
.wscw-group--toggle .wscw-fields { padding: 18px; border-top: 1px solid var(--wscw-border); }

/* Raster: Felder nebeneinander, auf dem Handy untereinander */
.wscw-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
	gap: 18px 12px;
	align-items: start;
}
.wscw-w-full { grid-column: 1 / -1; }
@media (max-width: 560px) {
	.wscw-fields { grid-template-columns: 1fr; }
}
.wscw-field { margin: 0; min-width: 0; }
.wscw-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-weight: 600; margin: 0 0 6px; min-height: 1.4em; }
.wscw-req { color: var(--wscw-error); text-decoration: none; border: 0; }
.wscw-label .wscw-price { font-weight: 500; color: var(--wscw-muted); font-size: .875em; }

.wscw-input-wrap { position: relative; }
.wscw .wscw-input {
	display: block;
	width: 100%;
	height: var(--wscw-height);
	min-height: var(--wscw-height);
	margin: 0;
	padding: 0 16px;
	font: inherit;
	color: var(--wscw-text);
	background: var(--wscw-bg);
	border: 2px solid var(--wscw-border);
	border-radius: var(--wscw-radius);
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.wscw .has-count .wscw-input { padding-right: 64px; }
.wscw select.wscw-input { padding-right: 40px; }
.wscw .wscw-input:focus { outline: none; border-color: var(--wscw-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wscw-accent) 15%, transparent); }
.wscw .has-error .wscw-input { border-color: var(--wscw-error); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wscw-error) 14%, transparent); }
.wscw-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: .8em; font-weight: 600; color: var(--wscw-muted); font-variant-numeric: tabular-nums; pointer-events: none; }

/* Kacheln: Position */
.wscw-options--pos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr)); gap: 10px; }
.wscw .wscw-pos {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: var(--wscw-height);
	margin: 0;
	padding: 10px 14px;
	border: 2px solid var(--wscw-border);
	border-radius: var(--wscw-radius);
	background: var(--wscw-bg);
	color: var(--wscw-text);
	font: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.2;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.wscw .wscw-pos:hover { border-color: var(--wscw-accent); }
.wscw .wscw-pos[aria-pressed="true"] { border-color: var(--wscw-accent); background: var(--wscw-soft); }
.wscw .wscw-pos:focus-visible { outline: 3px solid var(--wscw-accent); outline-offset: 2px; }
.wscw-pos-text { display: grid; gap: 2px; }
.wscw-pos-label { font-weight: 600; }
.wscw-pos .wscw-price { font-size: .85em; color: var(--wscw-muted); font-variant-numeric: tabular-nums; }

.wscw .wscw-pos:disabled { opacity: .4; cursor: not-allowed; border-color: var(--wscw-border); background: var(--wscw-bg); }

/* Druck-Blöcke: je Druck Position + Name (+ Nummer) */
.wscw-blocks { display: grid; gap: 14px; }
.wscw-group--toggle .wscw-blocks { padding: 18px 18px 0; border-top: 1px solid var(--wscw-border); }
.wscw-group--toggle .wscw-blocks .wscw-fields { padding: 0; border-top: 0; }
.wscw-group--toggle .wscw-blocks + .wscw-fields { padding-top: 14px; border-top: 0; }
.wscw-block + .wscw-block { padding-top: 14px; border-top: 1px dashed var(--wscw-border); }
.wscw-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.wscw-block-title { font-weight: 700; font-size: .8em; letter-spacing: .08em; text-transform: uppercase; color: var(--wscw-muted); }
.wscw .wscw-remove { margin: 0; padding: 4px 0; border: 0; background: none; color: var(--wscw-muted); font: inherit; font-size: .875em; text-decoration: underline; text-transform: none; box-shadow: none; cursor: pointer; }
.wscw .wscw-remove:hover { color: var(--wscw-error); }
.wscw .wscw-add { justify-self: start; min-height: 44px; margin: 0; padding: 0 16px; border: 2px dashed var(--wscw-border); border-radius: var(--wscw-radius); background: transparent; color: var(--wscw-text); font: inherit; font-weight: 600; text-transform: none; letter-spacing: normal; box-shadow: none; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.wscw .wscw-add:hover { border-color: var(--wscw-accent); color: var(--wscw-accent); }
.wscw .wscw-add:focus-visible, .wscw .wscw-remove:focus-visible { outline: 3px solid var(--wscw-accent); outline-offset: 2px; }

/* Kacheln: Druckfarbe als Pillen */
.wscw-options--color { display: flex; flex-wrap: wrap; gap: 10px; }
.wscw .wscw-pos--color { border-radius: 999px; padding: 6px 16px 6px 6px; min-height: 42px; }
.wscw .wscw-pos--color[aria-pressed="true"] { background: var(--wscw-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wscw-accent) 18%, transparent); }
.wscw-pos--color .wscw-pos-text { display: flex; gap: 6px; align-items: baseline; }
.wscw-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); display: inline-block; flex: none; }

.wscw-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; }
.wscw-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--wscw-accent); flex: 0 0 auto; }
.wscw-rights { margin-top: 10px; font-size: .9em; }
.wscw-file { display: block; width: 100%; padding: 12px; border: 2px dashed var(--wscw-border); border-radius: var(--wscw-radius); background: var(--wscw-bg); font: inherit; }

.wscw-hint { margin-top: 4px; font-size: .85em; color: var(--wscw-muted); }
.wscw-error { color: var(--wscw-error); font-size: .875em; margin-top: 4px; }
.wscw-error:empty { display: none; }

/* Chips: „Deine Auswahl“, Warenkorb, Kasse */
.wscw-summary { display: grid; gap: 8px; }
.wscw-summary-label { font-weight: 700; font-size: .8em; letter-spacing: .08em; text-transform: uppercase; color: var(--wscw-muted); }
.wscw-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.wscw-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--wscw-accent) 10%, #fff); color: var(--wscw-text); font-size: .9em; line-height: 1.2; }
.wscw-chip strong { color: var(--wscw-accent); font-weight: 700; }
.wscw-chip-sep { display: none; }

/* Aufpreis neben dem Produktpreis */
.wscw-price--total { display: inline-flex; align-items: center; margin-left: 10px; padding: 6px 11px; border-radius: 999px; background: var(--wscw-accent, #009fe3); color: var(--wscw-accent-text, #fff); font-size: max(12px, .5em); font-weight: 700; line-height: 1; vertical-align: middle; white-space: nowrap; }
.wscw-price--total[hidden] { display: none; }

.wscw-total { display: grid; gap: 6px; padding: 12px 16px; border-radius: var(--wscw-radius); background: var(--wscw-soft); }
.wscw-total-lines { display: grid; gap: 4px; font-size: .9em; }
.wscw-total-line, .wscw-total-sum { display: flex; justify-content: space-between; gap: 12px; }
.wscw-total-line span:last-child, .wscw-total-sum strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wscw-total-lines:not(:empty) + .wscw-total-sum { padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--wscw-accent) 25%, transparent); }
.wscw-note { margin: 0; font-size: .85em; line-height: 1.45; padding: 12px 14px; color: var(--wscw-muted); background: color-mix(in srgb, var(--wscw-border) 35%, var(--wscw-bg)); border-radius: var(--wscw-radius); }

/* Vorschau (abschaltbar) */
.wscw-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wscw-preview-title { font-weight: 700; }
.wscw-views { display: flex; flex-wrap: wrap; gap: 6px; }
.wscw .wscw-view { min-height: 36px; padding: 0 12px; margin: 0; font: inherit; font-size: .85em; font-weight: 600; color: var(--wscw-text); background: var(--wscw-bg); border: 2px solid var(--wscw-border); border-radius: var(--wscw-radius); cursor: pointer; line-height: 1; text-transform: none; box-shadow: none; }
.wscw .wscw-view.is-active { background: var(--wscw-accent); border-color: var(--wscw-accent); color: var(--wscw-accent-text); }
.wscw-stage { position: relative; overflow: hidden; border-radius: var(--wscw-radius); border: 2px solid var(--wscw-border); background: #f4f6f8; }
.wscw-stage img { display: block; width: 100%; height: auto; margin: 0; }
.wscw-layer { position: absolute; inset: 0; pointer-events: none; }
.wscw-print { position: absolute; white-space: nowrap; line-height: 1; font-family: var(--wscw-preview-font); font-weight: var(--wscw-preview-weight); letter-spacing: .02em; -webkit-text-stroke: 1px var(--wscw-preview-stroke); paint-order: stroke fill; }
.wscw-preview-note { font-size: .8em; color: var(--wscw-muted); margin: 6px 0 0; }

@media (prefers-reduced-motion: reduce) {
	.wscw *, .wscw-price--total { transition: none !important; }
}

/* Kasse */
.wscw-checkout-box { margin: 0 0 12px; }
