/* Quiz landing + wizard — mobile first */

.cdc-quiz-page .site-main { padding: 0; }

.cdc-quiz-container {
	max-width: var(--cdc-max, 680px);
	margin: 0 auto;
	padding: 24px 20px 32px;
}

/* ── Landing ── */
.cdc-quiz-landing {
	margin-bottom: 28px;
}

.cdc-quiz-landing__hero {
	text-align: center;
	padding-bottom: 20px;
}

.cdc-quiz__title {
	font-family: var(--cdc-font-display);
	font-size: clamp(2rem, 8vw, 2.75rem);
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: 0.01em;
	margin: 0 0 14px;
	color: var(--cdc-text);
}

.cdc-quiz__subtitle {
	color: var(--cdc-muted);
	font-size: 1.0625rem;
	line-height: 1.65;
	margin: 0 auto;
	max-width: 40ch;
}

/* ── Wizard ── */
.cdc-quiz__wizard {
	background: var(--cdc-surface);
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
}

.cdc-quiz__wizard-inner {
	padding: 20px 16px 16px;
}

.cdc-quiz__loading {
	color: var(--cdc-muted);
	font-size: 0.9375rem;
	padding: 16px 0;
}

/* Progress */
.cdc-quiz__progress {
	margin-bottom: 20px;
}

.cdc-quiz__progress-bar {
	height: 2px;
	background: var(--cdc-border);
}

.cdc-quiz__progress-bar::after {
	content: '';
	display: block;
	height: 100%;
	width: var(--progress, 0%);
	background: var(--cdc-text);
	transition: width 0.25s ease;
}

.cdc-quiz__progress-text {
	display: block;
	font-size: 0.75rem;
	color: var(--cdc-muted);
	margin-top: 8px;
	letter-spacing: 0.04em;
}

/* Question */
.cdc-quiz__question-title {
	font-family: var(--cdc-font-body);
	font-size: clamp(1.25rem, 4.5vw, 1.5rem);
	font-weight: 600;
	line-height: 1.35;
	margin: 0 0 20px;
	letter-spacing: -0.01em;
}

.cdc-answers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cdc-answer { margin: 0; }

.cdc-answer__label {
	display: block;
	padding: 16px 18px;
	background: var(--cdc-bg);
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	cursor: pointer;
	font-family: var(--cdc-font-body);
	font-size: 1.0625rem;
	font-weight: 400;
	line-height: 1.5;
	transition: border-color 0.15s, background 0.15s;
	min-height: 54px;
}

.cdc-answer__label:hover { border-color: var(--cdc-text); }

.cdc-answer input { position: absolute; opacity: 0; pointer-events: none; }

.cdc-answer input:checked + .cdc-answer__label {
	border-color: var(--cdc-text);
	background: var(--cdc-surface);
	box-shadow: inset 3px 0 0 var(--cdc-text);
}

.cdc-answer__radio { display: none; }

/* Wizard steps */
.cdc-quiz__step {
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.cdc-quiz__step--leaving {
	opacity: 0;
	transform: translateY(-8px);
	pointer-events: none;
}

/* Nav */
.cdc-quiz__nav {
	display: flex;
	gap: 10px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--cdc-border);
}

.cdc-quiz__nav .cdc-btn {
	flex: 1;
	min-width: 0;
}

.cdc-quiz__nav #cdc-quiz-back {
	flex: 0 1 40%;
}

.cdc-quiz__nav #cdc-quiz-next {
	flex: 1 1 60%;
}

.cdc-quiz__nav .cdc-btn[hidden] {
	display: none;
}

.cdc-quiz__nav[hidden],
.cdc-quiz--result .cdc-quiz__nav {
	display: none !important;
}

.cdc-quiz__error {
	background: #faf0ee;
	color: #7a2e2e;
	border: 1px solid #e8c4c0;
	padding: 12px 14px;
	font-size: 0.875rem;
	margin-top: 12px;
	border-radius: var(--cdc-radius);
}

.cdc-honeypot { position: absolute; left: -9999px; }

/* Lead form */
.cdc-lead-form .cdc-quiz__question-title { margin-bottom: 16px; }

.cdc-lead-form .cdc-field { margin-bottom: 16px; }

.cdc-lead-form label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--cdc-muted);
	margin-bottom: 6px;
}

.cdc-lead-form input[type="text"],
.cdc-lead-form input[type="email"],
.cdc-lead-form input[type="tel"] {
	width: 100%;
	padding: 14px 12px;
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	font-family: var(--cdc-font-body);
	font-size: 1.0625rem;
	background: var(--cdc-bg);
	color: var(--cdc-text);
	-webkit-appearance: none;
}

.cdc-lead-form input:focus {
	outline: none;
	border-color: var(--cdc-text);
}

.cdc-field--checkbox label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 0.9375rem;
	text-transform: none;
	letter-spacing: 0;
	color: var(--cdc-text);
	font-weight: 400;
	cursor: pointer;
	line-height: 1.5;
}

.cdc-field--checkbox input {
	margin-top: 3px;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: var(--cdc-text);
}

/* Result */
.cdc-result { text-align: left; }

.cdc-result__greeting {
	font-size: 0.9375rem;
	color: var(--cdc-muted);
	margin-bottom: 4px;
}

.cdc-result__title {
	font-family: var(--cdc-font-display);
	font-size: clamp(1.75rem, 6vw, 2.25rem);
	font-weight: 400;
	margin: 0 0 12px;
	line-height: 1.15;
}

.cdc-result__desc {
	color: var(--cdc-muted);
	margin-bottom: 24px;
	line-height: 1.65;
	font-size: 1rem;
}

.cdc-result__note {
	margin: -12px 0 20px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--cdc-muted);
}

.cdc-result__image {
	margin-bottom: 20px;
	border: 1px solid var(--cdc-border);
	background: var(--cdc-bg);
	overflow: hidden;
}

.cdc-result__image img {
	display: block;
	width: 100%;
	height: auto;
}

.cdc-result__price {
	font-size: 1.125rem;
	font-weight: 500;
	margin-bottom: 4px;
}

.cdc-result__stock {
	font-size: 0.8125rem;
	color: var(--cdc-muted);
	margin-bottom: 20px;
}

.cdc-result__actions .cdc-btn { width: 100%; }

.cdc-result__cart-note {
	margin: 10px 0 0;
	font-size: 0.9375rem;
	color: var(--cdc-muted);
	text-align: center;
}

.cdc-result__cart-note a {
	color: var(--cdc-accent-dark);
	font-weight: 600;
}

.cdc-btn--success {
	background: #3d6b4f;
	border-color: #3d6b4f;
}

.cdc-result__product-desc {
	margin: 20px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--cdc-border);
	color: var(--cdc-muted);
	font-size: 0.9375rem;
	line-height: 1.65;
	text-align: center;
}

.cdc-result__product-desc p:first-child { margin-top: 0; }
.cdc-result__product-desc p:last-child { margin-bottom: 0; }
.cdc-result__product-desc ul {
	margin: 0 auto;
	padding-left: 0;
	list-style-position: inside;
	display: inline-block;
	text-align: left;
}

.cdc-result__related {
	border-top: 1px solid var(--cdc-border);
	padding-top: 28px;
	margin-top: 32px;
}

.cdc-result__related h3 {
	font-family: var(--cdc-font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cdc-muted);
	margin: 0 0 16px;
}

.cdc-related-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.cdc-related-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--cdc-border);
	background: var(--cdc-bg);
	overflow: hidden;
}

.cdc-related-card img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
}

.cdc-related-card__open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.cdc-related-card__open:hover {
	opacity: 0.92;
}

.cdc-related-card__body {
	padding: 12px;
	font-size: 0.8125rem;
	line-height: 1.4;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cdc-related-card__name {
	display: block;
	font-weight: 500;
	line-height: 1.35;
}

.cdc-related-card__price {
	font-weight: 500;
	margin-bottom: 4px;
}

.cdc-related-card__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

.cdc-related-card__add {
	width: 100%;
	padding: 12px 10px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cdc-related-card__more {
	width: 100%;
	padding: 10px;
	font-size: 0.75rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.cdc-related-card__add--done {
	background: #3d6b4f;
	border-color: #3d6b4f;
	color: #faf7f2;
}

.cdc-quiz--result .cdc-quiz-landing { display: none; }

.cdc-quiz--result .cdc-quiz__progress {
	display: none;
}

.cdc-quiz--result .cdc-quiz__loading {
	display: none;
}

.cdc-quiz-container--result {
	padding-bottom: 32px !important;
}

/* Mobile */
@media (max-width: 767px) {
	.cdc-quiz-container {
		padding: 20px 16px 32px;
	}

	.cdc-quiz__wizard-inner {
		padding-bottom: 8px;
	}

	.cdc-quiz__nav {
		position: static;
		flex-direction: column-reverse;
		gap: 10px;
		margin-top: 20px;
		padding: 16px 0 0;
		background: transparent;
	}

	.cdc-quiz__nav .cdc-btn {
		width: 100%;
	}
}

@media (min-width: 768px) {
	.cdc-quiz-container { padding: 48px 24px 64px; }

	.cdc-quiz__wizard-inner { padding: 28px 28px 24px; }

	.cdc-result { text-align: center; }
	.cdc-result__actions .cdc-btn { width: auto; min-width: 220px; }
	.cdc-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
	.cdc-related-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.cdc-quiz__progress-bar::after { transition: none; }
}

/* Quiz modals */
body.cdc-quiz-modal-open { overflow: hidden; }

.cdc-quiz-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
}

.cdc-quiz-modal[hidden] { display: none !important; }

.cdc-quiz-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(31, 27, 24, 0.45);
}

.cdc-quiz-modal__dialog {
	position: relative;
	width: min(100%, 560px);
	max-height: min(88vh, 720px);
	overflow: auto;
	background: var(--cdc-surface);
	border: 1px solid var(--cdc-border);
	border-radius: var(--cdc-radius);
	padding: 24px 20px 20px;
	box-shadow: 0 12px 40px rgba(31, 27, 24, 0.18);
}

.cdc-quiz-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	color: var(--cdc-muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.cdc-product-modal__title,
.cdc-upsell-modal__title {
	margin: 0 0 16px;
	font-family: var(--cdc-font-display);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.2;
	padding-right: 28px;
}

.cdc-product-modal__image {
	margin-bottom: 16px;
	border: 1px solid var(--cdc-border);
}

.cdc-product-modal__image img {
	display: block;
	width: 100%;
	height: auto;
}

.cdc-product-modal__price {
	font-size: 1.125rem;
	font-weight: 500;
	margin-bottom: 12px;
}

.cdc-product-modal__desc {
	margin: 0 0 20px;
	color: var(--cdc-muted);
	line-height: 1.6;
	font-size: 0.9375rem;
	text-align: left;
}

.cdc-product-modal__desc p:first-child { margin-top: 0; }
.cdc-product-modal__desc p:last-child { margin-bottom: 0; }
.cdc-product-modal__desc ul {
	margin: 0;
	padding-left: 1.2rem;
}

.cdc-product-modal__desc li {
	margin-bottom: 10px;
}

.cdc-product-modal__desc li:last-child { margin-bottom: 0; }

.cdc-product-modal__desc strong {
	color: var(--cdc-text);
	font-weight: 600;
}

.cdc-product-modal__cta { width: 100%; }

.cdc-upsell-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--cdc-border);
}

.cdc-upsell-modal__actions .cdc-btn { flex: 1; min-width: 140px; }

.cdc-related-card__open:focus-visible,
.cdc-related-card__add:focus-visible {
	outline: 2px solid var(--cdc-accent);
	outline-offset: 2px;
}

@media (min-width: 768px) {
	.cdc-quiz-modal { align-items: center; }
	.cdc-product-modal__cta { width: auto; min-width: 220px; }
}
