/* SOLOUCE Textil-Konfigurator: Frontend
   Farben kommen per CSS-Variablen aus dem Backend (Einstellungen > Design). */

.stc-configurator,
.stc-modal {
	--stc-text: #fff;
	--stc-field-bg: #fff;
	--stc-field-text: #1d1d1f;
	--stc-btn-bg: #fff;
	--stc-btn-text: #1d1d1f;
	--stc-modal-bg: #00a57a;
	--stc-font: inherit;
	--stc-line: rgba(255, 255, 255, .35);
	--stc-h: 50px;
}
@supports (color: color-mix(in srgb, red 50%, transparent)) {
	.stc-configurator,
	.stc-modal { --stc-line: color-mix(in srgb, var(--stc-text) 35%, transparent); }
}

.stc-configurator *,
.stc-modal * { box-sizing: border-box; }

/* ---------- Layout ---------- */
.stc-configurator {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 22px;
	width: 100%;
	max-width: 100%;
	color: var(--stc-text);
	font-family: var(--stc-font);
	font-size: 15px;
	line-height: 1.4;
	text-align: left;
}
.stc-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px 16px;
	align-content: start;
	min-height: 0;
}
.stc-foot { display: grid; gap: 18px; }

/* Höhenmodus: Felder scrollen, Preis und Button bleiben sichtbar */
.stc-configurator--scroll { min-height: 320px; overflow: hidden; }
.stc-configurator--scroll .stc-fields {
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 10px;
	scrollbar-width: thin;
}
.stc-configurator--scroll .stc-fields::-webkit-scrollbar { width: 8px; }
.stc-configurator--scroll .stc-fields::-webkit-scrollbar-thumb { background: var(--stc-line); border-radius: 4px; }
.stc-configurator--scroll .stc-foot { position: relative; padding-top: 2px; }

.stc-field { grid-column: 1 / -1; min-width: 0; margin: 0; }
.stc-field--half { grid-column: span 1; }
.stc-configurator [data-stc-wrap][hidden] { display: none !important; }
@media (max-width: 600px) {
	.stc-field--half { grid-column: 1 / -1; }
}

.stc-configurator::-webkit-scrollbar { width: 8px; }
.stc-configurator::-webkit-scrollbar-track { background: transparent; }
.stc-configurator::-webkit-scrollbar-thumb { background: var(--stc-line); border-radius: 4px; }
.stc-configurator::-webkit-scrollbar-thumb:hover { background: var(--stc-text); }

/* ---------- Labels ---------- */
.stc-configurator .stc-label,
.stc-modal .stc-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 10px;
	padding: 0;
	color: inherit;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: .07em;
	line-height: 1.2;
	text-transform: uppercase;
}
.stc-label__value { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 700; text-align: right; white-space: nowrap; }
.stc-req { opacity: .8; }
.stc-configurator .stc-tag { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .85; }
.stc-configurator .stc-help { margin: 8px 0 0; font-size: 12px; opacity: .85; }

/* ---------- Inputs ---------- */
.stc-configurator select,
.stc-qty input[type="number"],
.stc-modal input[type="text"],
.stc-modal input[type="email"],
.stc-modal input[type="tel"],
.stc-modal textarea {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: var(--stc-h);
	margin: 0;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: 2px;
	background: var(--stc-field-bg);
	box-shadow: none;
	color: var(--stc-field-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	outline: none;
	transition: border-color .15s;
}
.stc-configurator select:focus-visible,
.stc-qty input:focus-visible,
.stc-modal input:focus-visible,
.stc-modal textarea:focus-visible { border-color: var(--stc-field-text); }

.stc-modal textarea { height: auto; min-height: 104px; padding: 12px 16px; resize: vertical; }
.stc-modal textarea::placeholder { color: var(--stc-field-text); opacity: .45; }

/* Dropdown with the triangle from the SOLOUCE bunting */
.stc-select { position: relative; }
.stc-configurator select { padding-right: 48px; cursor: pointer; }
.stc-select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 18px;
	margin-top: -4px;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 9px solid var(--stc-field-text);
	pointer-events: none;
}

/* ---------- Slider (günstig bis teuer) ---------- */
.stc-configurator .stc-range {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 6px;
	margin: 18px 0 14px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: linear-gradient(to right,
		var(--stc-text) 0, var(--stc-text) var(--stc-fill, 0%),
		var(--stc-line) var(--stc-fill, 0%), var(--stc-line) 100%);
	cursor: pointer;
	outline: none;
}
.stc-configurator .stc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 26px;
	height: 26px;
	border: 3px solid var(--stc-field-text);
	border-radius: 2px;
	background: var(--stc-field-bg);
	transition: transform .15s;
}
.stc-configurator .stc-range::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border: 3px solid var(--stc-field-text);
	border-radius: 2px;
	background: var(--stc-field-bg);
}
.stc-configurator .stc-range::-moz-range-track { height: 6px; border: 0; background: transparent; }
.stc-configurator .stc-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.stc-configurator .stc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--stc-line); }
.stc-configurator .stc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--stc-line); }

.stc-range-ends {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	font-weight: 700;
	opacity: .85;
}

/* ---------- Mehrfachauswahl ---------- */
.stc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stc-chip { position: relative; margin: 0; cursor: pointer; }
.stc-configurator .stc-chip[hidden] { display: none; }
.stc-chips--interest .stc-tag:empty { display: none; }
.stc-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.stc-chip span {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	min-height: 42px;
	padding: 6px 18px;
	border: 2px solid var(--stc-text);
	border-radius: 2px;
	color: var(--stc-text);
	font-size: 14px;
	font-weight: 700;
	user-select: none;
	transition: background-color .15s, color .15s;
}
.stc-chip:hover span { background: var(--stc-line); }
.stc-chip input:checked + span { background: var(--stc-text); color: var(--stc-field-text); }
.stc-chip input:focus-visible + span { outline: 3px solid var(--stc-field-text); outline-offset: 2px; }

/* Hinweis zur gewählten Option */
.stc-configurator .stc-hint {
	margin: 10px 0 0;
	padding-left: 12px;
	border-left: 3px solid var(--stc-text);
	font-size: 13px;
	line-height: 1.45;
}
.stc-configurator .stc-hint[hidden] { display: none; }

/* Upload */
.stc-upload__drop {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 14px;
	min-height: 84px;
	padding: 16px;
	border: 2px dashed var(--stc-text);
	border-radius: 2px;
	text-align: center;
	cursor: pointer;
	transition: background-color .15s;
}
.stc-upload__drop:hover,
.stc-upload__drop.is-over { background: var(--stc-line); }
.stc-upload__drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.stc-upload__drop:focus-within { outline: 3px solid var(--stc-field-text); outline-offset: 2px; }
.stc-upload__btn {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 16px;
	border-radius: 2px;
	background: var(--stc-btn-bg);
	color: var(--stc-btn-text);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.stc-upload__text { font-size: 13px; font-weight: 600; }
.stc-configurator .stc-upload__list { margin: 10px 0 0; padding: 0; list-style: none; }
.stc-configurator .stc-upload__list:empty { display: none; }
.stc-upload__list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 6px;
	padding: 8px 8px 8px 12px;
	background: var(--stc-field-bg);
	color: var(--stc-field-text);
	font-size: 13px;
	font-weight: 600;
	word-break: break-all;
}
.stc-configurator .stc-upload__remove {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.stc-configurator .stc-upload__meta { margin: 8px 0 0; font-size: 12px; opacity: .85; }

/* Disclaimer ganz unten */
.stc-configurator .stc-disclaimer {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	opacity: .85;
}

/* Pflichtfeld nicht ausgefüllt */
.stc-field--error .stc-label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.stc-field--error select,
.stc-field--error .stc-upload__drop,
.stc-field--error .stc-chip span { border-color: #b3261e !important; }
.stc-configurator .stc-error:empty { display: none; }
.stc-configurator .stc-error {
	grid-column: 1 / -1;
	margin: 0;
	padding: 12px 14px;
	border-left: 4px solid #b3261e;
	background: var(--stc-field-bg);
	color: #b3261e;
	font-size: 14px;
	font-weight: 700;
}

/* ---------- Stückzahl ---------- */
.stc-qty { display: flex; gap: 6px; }
.stc-qty input[type="number"] { flex: 1 1 auto; min-width: 72px; text-align: center; font-size: 18px; font-weight: 800; -moz-appearance: textfield; }
.stc-qty input::-webkit-outer-spin-button,
.stc-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stc-configurator .stc-qty__btn {
	flex: 0 0 var(--stc-h);
	width: var(--stc-h);
	height: var(--stc-h);
	margin: 0;
	padding: 0;
	border: 2px solid var(--stc-text);
	border-radius: 2px;
	background: transparent;
	box-shadow: none;
	color: var(--stc-text);
	font: inherit;
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.stc-configurator .stc-qty__btn:hover { background: var(--stc-text); color: var(--stc-field-text); }
.stc-configurator .stc-qty__btn:focus-visible { outline: 3px solid var(--stc-field-text); outline-offset: 2px; }

/* ---------- Preis ---------- */
.stc-price {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
	padding-top: 20px;
	border-top: 2px solid var(--stc-text);
}
.stc-price__item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stc-price__label {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .07em;
	text-transform: uppercase;
	opacity: .9;
}
.stc-price__value {
	font-size: clamp(20px, 2.1vw, 28px);
	font-style: italic;
	font-weight: 800;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}
.stc-configurator .stc-price__meta { grid-column: 1 / -1; margin: 0; font-size: 12px; opacity: .85; }
@media (max-width: 420px) {
	.stc-price { grid-template-columns: 1fr; }
}

/* ---------- Button (wie "Mehr Infos" / "Jetzt konfigurieren") ---------- */
.stc-configurator .stc-btn,
.stc-modal .stc-btn {
	grid-column: 1 / -1;
	display: block;
	width: 100%;
	height: var(--stc-h);
	margin: 0;
	padding: 0 20px;
	border: 2px solid var(--stc-btn-bg);
	border-radius: 2px;
	background: var(--stc-btn-bg);
	box-shadow: none;
	color: var(--stc-btn-text);
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .06em;
	line-height: 1;
	text-shadow: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.stc-configurator .stc-btn:hover,
.stc-modal .stc-btn:hover { background: transparent; color: var(--stc-btn-bg); }
.stc-configurator .stc-btn:focus-visible,
.stc-modal .stc-btn:focus-visible { outline: 3px solid var(--stc-field-text); outline-offset: 3px; }
.stc-modal .stc-btn.is-loading { opacity: .7; cursor: wait; }

/* ---------- Anleitungs-Button und Sprechblase ---------- */
.stc-configurator .stc-guide-btn {
	grid-column: 1 / -1;
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0 16px 0 8px;
	height: 42px;
	border: 2px solid var(--stc-text);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--stc-text);
	font: inherit;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.stc-configurator .stc-guide-btn:hover { background: var(--stc-text); color: var(--stc-field-text); }
.stc-configurator .stc-guide-btn:focus-visible { outline: 3px solid var(--stc-field-text); outline-offset: 3px; }
.stc-guide-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--stc-text);
	color: var(--stc-field-text);
	font-size: 15px;
	font-weight: 800;
}

.stc-guide {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 26px;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	outline: none;
}
.stc-guide__avatar {
	flex: 0 0 auto;
	align-self: flex-start;
	margin-top: 6px;
	max-width: 40%;
	border: 0;
	background: none;
}
.stc-guide__avatar img { display: block; width: 100%; height: auto; max-height: min(60vh, 460px); object-fit: contain; }
.stc-guide__bubble {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	padding: 28px 34px;
	border-radius: 18px;
	background: var(--stc-field-bg);
	color: var(--stc-field-text);
}
.stc-guide__bubble::before {
	content: "";
	position: absolute;
	top: var(--stc-tail-top, 46px);
	left: -18px;
	width: 0;
	height: 0;
	transform: translateY(-50%);
	border-top: 13px solid transparent;
	border-bottom: 13px solid transparent;
	border-right: 19px solid var(--stc-field-bg);
}
.stc-guide--plain .stc-guide__bubble::before { display: none; }
.stc-modal.stc-modal--guide .stc-modal__close {
	top: 4px;
	right: 6px;
	z-index: 2;
	width: 40px;
	height: 40px;
	color: var(--stc-field-text);
	font-size: 28px;
}
.stc-guide__title {
	margin: 0 44px 14px 0;
	color: inherit;
	font-family: inherit;
	font-size: 22px;
	font-style: italic;
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
}
.stc-guide__text {
	flex: 1 1 auto;
	min-height: 0;
	max-height: min(56vh, 460px);
	overflow-y: auto;
	padding-right: 14px;
	font-size: 15px;
	line-height: 1.6;
	overscroll-behavior: contain;
}
.stc-guide__text:focus-visible { outline: 2px solid var(--stc-field-text); outline-offset: 4px; }
.stc-guide__text h4 {
	margin: 20px 0 6px;
	color: inherit;
	font-family: inherit;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.stc-guide__text h4:first-child { margin-top: 0; }
.stc-guide__text p { margin: 0 0 14px; }
.stc-guide__text ul { margin: 0 0 14px; padding-left: 20px; }
.stc-guide__text li { margin: 0 0 6px; }
.stc-guide__bubble::after {
	content: "";
	position: absolute;
	left: 34px;
	right: 44px;
	bottom: 28px;
	height: 34px;
	background: linear-gradient(to top, var(--stc-field-bg), transparent);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s;
}
.stc-guide--scrollable .stc-guide__bubble::after { opacity: 1; }
.stc-guide--at-end .stc-guide__bubble::after { opacity: 0; }
.stc-guide__text::-webkit-scrollbar { width: 8px; }
.stc-guide__text::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .25); border-radius: 4px; }

@media (max-width: 680px) {
	.stc-guide {
		flex-direction: column;
		align-items: center;
		gap: 10px;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
	}
	.stc-guide__avatar {
		align-self: center;
		flex: 0 0 auto;
		max-width: 46%;
		width: auto !important;
		margin-top: 0;
	}
	.stc-guide__avatar img { max-height: 118px; width: auto; margin: 0 auto; }
	.stc-guide__bubble {
		flex: 1 1 auto;
		min-height: 0;
		width: 100%;
		padding: 22px 16px 20px;
	}
	.stc-guide__bubble::before {
		top: -16px;
		left: 50%;
		transform: translateX(-50%);
		border: 0;
		border-left: 12px solid transparent;
		border-right: 12px solid transparent;
		border-bottom: 17px solid var(--stc-field-bg);
	}
	.stc-guide__bubble::after { left: 16px; right: 26px; bottom: 20px; height: 28px; }
	.stc-guide__title { margin: 0 40px 10px 0; font-size: 20px; }
	.stc-guide__text { max-height: none; padding-right: 10px; }
	.stc-modal.stc-modal--guide .stc-modal__close { top: 0; right: 0; color: var(--stc-text); }
}

/* ---------- Popup ---------- */
.stc-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	color: var(--stc-text);
	font-family: var(--stc-font);
	font-size: 15px;
	line-height: 1.45;
	opacity: 0;
	transition: opacity .2s;
}
.stc-modal[hidden] { display: none !important; }
.stc-modal.is-open { opacity: 1; }
.stc-modal__backdrop { position: absolute; inset: 0; background: rgba(12, 14, 16, .72); }
.stc-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 980px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	padding: 52px 44px 44px;
	background: var(--stc-modal-bg);
	outline: none;
	transform: translateY(14px);
	transition: transform .25s ease;
}
.stc-modal.is-open .stc-modal__dialog { transform: none; }

.stc-modal .stc-modal__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}
.stc-modal .stc-modal__close:focus-visible { outline: 3px solid var(--stc-field-text); }

.stc-modal__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; }
.stc-modal__grid[hidden] { display: none; }

.stc-modal .stc-modal__title {
	margin: 0 0 20px;
	color: inherit;
	font-family: inherit;
	font-size: 26px;
	font-style: italic;
	font-weight: 800;
	letter-spacing: .01em;
	line-height: 1.1;
	text-transform: uppercase;
}

.stc-summary__list {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 0 0 22px;
	border-top: 2px solid var(--stc-text);
}
.stc-summary__list dt,
.stc-summary__list dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--stc-line); }
.stc-summary__list dt { padding-right: 18px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stc-summary__list dd { font-weight: 700; text-align: right; }

.stc-summary__prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stc-summary__prices div { display: flex; flex-direction: column; gap: 4px; }
.stc-summary__prices strong { font-size: 22px; font-style: italic; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stc-modal .stc-summary__note { margin: 14px 0 0; font-size: 12px; opacity: .85; }

.stc-form { display: grid; gap: 16px; margin: 0; }
.stc-form__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stc-modal .stc-form__row .stc-label { margin-bottom: 7px; font-size: 13px; }

.stc-check { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 0; font-size: 13px; line-height: 1.5; cursor: pointer; }
.stc-check input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--stc-field-text); cursor: pointer; }
.stc-check a { color: inherit; font-weight: 700; text-decoration: underline; }

.stc-form__msg:empty { display: none; }
.stc-form__msg {
	padding: 12px 14px;
	border-left: 4px solid #b3261e;
	background: var(--stc-field-bg);
	color: #b3261e;
	font-size: 14px;
	font-weight: 700;
}

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

.stc-success { max-width: 520px; margin: 0 auto; padding: 20px 0 8px; text-align: center; }
.stc-success[hidden] { display: none; }
.stc-success__icon { display: block; width: 56px; height: 56px; margin: 0 auto 18px; color: var(--stc-field-text); }
.stc-success p { margin: 0 0 28px; font-size: 16px; }

html.stc-lock,
html.stc-lock body { overflow: hidden; }

@media (max-width: 780px) {
	.stc-modal__grid { grid-template-columns: 1fr; gap: 32px; }
	.stc-modal__dialog { padding: 52px 20px 24px; }
	.stc-modal .stc-modal__title { font-size: 22px; }
}
@media (max-width: 480px) {
	.stc-form__pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.stc-modal,
	.stc-modal__dialog,
	.stc-configurator * { transition: none !important; }
}
