/* Cozique Produktkonfigurator */

:root {
	--czc-accent: #2f2a26;
	--czc-accent-contrast: #fff;
	--czc-border: #ddd8d2;
	--czc-muted: #6b645d;
	--czc-surface: #fff;
	--czc-surface-alt: #f7f5f2;
	--czc-radius: 8px;
	/* Theme-Farbe (Taupe #ab9e84), abgedunkelt für lesbare weiße Schrift. */
	--czc-btn: #8c7f64;
	--czc-btn-hover: #73674f;
}

/* ---------------------------------------------------------------- Produktseite */

.czc-selector {
	margin: 0 0 1.25em;
	width: 100%;
}

.czc-selector .czc-open {
	width: 100%;
}

/* Menge und Warenkorb-Button erst nach vollständiger Auswahl zeigen. */
form.czc-form:not(.czc-configured) .single_add_to_cart_button,
form.czc-form:not(.czc-configured) .quantity,
form.czc-form:not(.czc-configured) .qty_label {
	display: none !important;
}

.czc-summary {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.75em 1em;
	align-items: start;
	margin-top: 1em;
	padding: 1em;
	background: var(--czc-surface-alt);
	border-radius: var(--czc-radius);
}

.czc-summary[hidden] {
	display: none;
}

.czc-summary__swatch {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
}

.czc-summary__list {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25em 0.75em;
	margin: 0;
	font-size: 0.95em;
}

.czc-summary__list dt {
	font-weight: 600;
}

.czc-summary__list dd {
	margin: 0;
}

.czc-summary__price {
	grid-column: 1 / -1;
	font-size: 1.25em;
	font-weight: 600;
}

/* Muster-Modus: Menge ist immer 1 */
form.czc-form--samples .quantity,
form.czc-form--samples .qty_label {
	display: none !important;
}

.czc-samples-note {
	margin: 0 0 0.75em;
	padding: 0.6em 0.8em;
	background: var(--czc-surface-alt);
	border-radius: var(--czc-radius);
}

/* Muster-Modus */
.czc-summary__samples {
	display: grid;
	grid-column: 1 / -1;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.czc-summary__samples li {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin: 0;
}

.czc-summary__samples .czc-summary__swatch {
	width: 48px;
	height: 48px;
}

.czc-extra {
	margin-top: 1em;
}

.czc-extra__field {
	margin: 0 0 0.75em;
}

.czc-extra__field label {
	display: block;
	margin-bottom: 0.3em;
}

.czc-extra__field input[type="text"] {
	width: 100%;
}

.czc-extra__field--check label {
	display: flex;
	gap: 0.5em;
	align-items: flex-start;
}

.czc-extra__field--check input {
	margin-top: 0.25em;
}

.czc-card.is-muted {
	opacity: 0.55;
}

.czc-preview__note {
	color: #b32d2e;
}

.czc-steps[hidden] {
	display: none !important;
}

.czc-price-from {
	font-weight: normal;
}

.czc-cart-fabric {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.czc-cart-fabric img {
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 4px;
}

/* ---------------------------------------------------------------- Dialog */

html.czc-lock {
	overflow: hidden;
}

.czc-modal {
	width: min(1100px, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--czc-surface);
	color: inherit;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.czc-modal::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.czc-modal[open] {
	display: flex;
}

.czc-modal__inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: inherit;
	min-height: 0;
}

.czc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--czc-border);
}

.czc-modal__title {
	margin: 0;
	font-size: 1.35rem;
}

.czc-modal__close,
.czc-lightbox__close {
	display: inline-flex;
	padding: 0.4rem;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

/* Kopf, Schritte und Fuß behalten ihre Höhe – nur der Inhaltsbereich scrollt. */
.czc-modal__header,
.czc-steps,
.czc-modal__footer {
	flex-shrink: 0;
}

.czc-modal .czc-steps {
	display: flex;
	align-items: center;
	gap: 0.75rem 2rem;
	margin: 0;
	padding: 1rem 1.5rem;
	list-style: none;
	border-bottom: 1px solid var(--czc-border);
	overflow-x: auto;
}

.czc-modal .czc-steps__item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	color: var(--czc-muted);
	line-height: 1.3;
	white-space: nowrap;
}

.czc-modal .czc-steps__item::before,
.czc-modal .czc-steps__item::marker {
	content: none;
}

.czc-steps__no {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: 2px solid currentColor;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: 600;
}

.czc-steps__item.is-active {
	color: var(--czc-accent);
	font-weight: 600;
}

.czc-steps__item.is-active .czc-steps__no,
.czc-steps__item.is-done .czc-steps__no {
	background: var(--czc-accent);
	border-color: var(--czc-accent);
	color: var(--czc-accent-contrast);
}

.czc-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 1.25rem 1.5rem;
	overflow-y: auto;
}

.czc-step__title {
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

.czc-loading,
.czc-empty {
	color: var(--czc-muted);
}

.czc-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.czc-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.czc-filter {
	padding: 0.45rem 1rem;
	border: 1px solid var(--czc-border);
	border-radius: 999px;
	background: var(--czc-surface);
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
}

.czc-filter.is-active {
	background: var(--czc-accent);
	border-color: var(--czc-accent);
	color: var(--czc-accent-contrast);
}

.czc-search input {
	min-width: 220px;
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--czc-border);
	border-radius: 6px;
	font: inherit;
}

/* ---------------------------------------------------------------- Kacheln */

.czc-grid {
	display: grid;
	gap: 0.75rem;
}

.czc-grid--variants {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.czc-grid--fabrics {
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.czc-grid--stitches {
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.czc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 2px solid var(--czc-border);
	border-radius: var(--czc-radius);
	background: var(--czc-surface);
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.czc-card:hover,
.czc-card:focus-visible {
	border-color: var(--czc-muted);
	outline: none;
}

.czc-card.is-selected {
	border-color: var(--czc-accent);
	box-shadow: 0 0 0 2px var(--czc-accent);
}

.czc-card.is-disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.czc-card__media {
	position: relative;
	aspect-ratio: 1;
	background: var(--czc-surface-alt);
}

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

.czc-card__zoom {
	position: absolute;
	right: 0.4rem;
	bottom: 0.4rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--czc-accent);
	font-size: 1.25rem;
	line-height: 2rem;
	cursor: zoom-in;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.czc-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.6rem 0.75rem 0.75rem;
	font-size: 0.9rem;
	line-height: 1.3;
}

.czc-card__title {
	font-weight: 600;
}

.czc-card__line {
	color: var(--czc-muted);
}

.czc-card__badge {
	margin-top: 0.25rem;
	font-weight: 600;
}

/* ---------------------------------------------------------------- Fußzeile */

.czc-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--czc-border);
	background: var(--czc-surface-alt);
}

.czc-preview {
	display: flex;
	flex: 1 1 320px;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: center;
	justify-content: space-between;
}

.czc-preview__selection {
	display: flex;
	flex-direction: column;
	font-size: 0.9rem;
	color: var(--czc-muted);
}

.czc-preview__price {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	font-size: 1.15rem;
}

.czc-actions {
	display: flex;
	gap: 0.5rem;
}

/* Eigene Buttons – unabhängig von Theme- und WooCommerce-Stilen (.button/.alt). */
.czc-modal .czc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 0.6rem 1.4rem;
	border: 1px solid var(--czc-btn);
	border-radius: 5px;
	background: var(--czc-btn);
	color: #fff;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.czc-modal .czc-btn:hover,
.czc-modal .czc-btn:focus-visible {
	border-color: var(--czc-btn-hover);
	background: var(--czc-btn-hover);
	color: #fff;
}

.czc-modal .czc-btn:focus-visible {
	outline: 2px solid var(--czc-btn-hover);
	outline-offset: 2px;
}

.czc-modal .czc-btn--secondary {
	background: #fff;
	color: var(--czc-btn-hover);
	box-shadow: none;
}

.czc-modal .czc-btn--secondary:hover,
.czc-modal .czc-btn--secondary:focus-visible {
	background: var(--czc-surface-alt);
	color: var(--czc-btn-hover);
}

.czc-modal .czc-btn:disabled,
.czc-modal .czc-btn:disabled:hover {
	border-color: var(--czc-border);
	background: var(--czc-border);
	color: #fff;
	box-shadow: none;
	cursor: not-allowed;
	opacity: 1;
}

.czc-modal .czc-btn[hidden] {
	display: none;
}

/* ---------------------------------------------------------------- Lightbox */

.czc-lightbox {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(0, 0, 0, 0.75);
}

.czc-lightbox[hidden] {
	display: none;
}

.czc-lightbox__content {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: 1.5rem;
	max-width: 980px;
	max-height: 100%;
	padding: 1.5rem;
	border-radius: 12px;
	background: var(--czc-surface);
	overflow: auto;
}

.czc-lightbox__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

.czc-lightbox__img {
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.czc-lightbox__info h4 {
	margin: 0 2rem 0.75rem 0;
}

.czc-lightbox__info p {
	margin: 0 0 0.6rem;
	font-size: 0.95rem;
}

/* ---------------------------------------------------------------- Mobil */

@media (max-width: 640px) {
	.czc-modal {
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
	}

	.czc-modal__header,
	.czc-modal__body,
	.czc-modal__footer,
	.czc-steps {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.czc-grid--fabrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.czc-search,
	.czc-search input {
		width: 100%;
		min-width: 0;
	}

	.czc-actions {
		width: 100%;
	}

	.czc-modal .czc-actions .czc-btn {
		flex: 1;
	}

	.czc-lightbox__content {
		grid-template-columns: 1fr;
	}
}
