/* ==========================================================================
   Custom Product Designer — Wizard Styles
   ========================================================================== */

.cpd-wizard, .cpd-wizard * { box-sizing: border-box; }

.cpd-wizard {
	--cpd-black: #0d0d0d;
	--cpd-white: #ffffff;
	--cpd-accent: #ff0000;
	--cpd-border: #e5e5e5;
	--cpd-muted: #8a8a8a;
	font-family: 'Montserrat', -apple-system, sans-serif;
	color: var(--cpd-black);
	max-width: 1100px;
	margin: 0 auto;
}

.cpd-wizard-heading {
	font-size: 24px;
	font-weight: 800;
	margin: 0 0 24px;
	text-align: center;
}

/* ---------- Step 0: Product Picker ---------- */

.cpd-picker-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px 20px;
}

@media (min-width: 700px) {
	.cpd-picker-grid { grid-template-columns: repeat(3, 1fr); }
}

.cpd-picker-card {
	display: block;
	text-align: left;
	background: var(--cpd-white);
	border: none;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
	transition: opacity 0.2s ease;
}
.cpd-picker-card:hover { opacity: 0.85; }
.cpd-picker-card-img { display: block; aspect-ratio: 3/4; background: #eeeeee; overflow: hidden; }
.cpd-picker-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpd-picker-card-placeholder { display: block; width: 100%; height: 100%; background: #e2e2e2; }
.cpd-picker-card-body { display: block; padding: 12px 4px; }
.cpd-picker-card-type {
	display: block;
	font-size: 10px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--cpd-muted);
	font-weight: 600;
	margin-bottom: 2px;
}
.cpd-picker-card-title { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }

/* ---------- Progress bar ---------- */

.cpd-progress {
	display: flex;
	justify-content: center;
	gap: 24px;
	margin-bottom: 28px;
	flex-wrap: wrap;
}
.cpd-progress-step {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--cpd-muted);
	padding-bottom: 8px;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
}
.cpd-progress-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cpd-border);
	flex-shrink: 0;
	transition: background-color 0.2s ease;
}
.cpd-progress-step.is-active { color: var(--cpd-black); border-color: var(--cpd-black); }
.cpd-progress-step.is-active .cpd-progress-dot { background: var(--cpd-black); }
.cpd-progress-step.is-done { color: var(--cpd-muted); }
.cpd-progress-step.is-done .cpd-progress-dot { background: var(--cpd-accent); }

@media (max-width: 600px) {
	.cpd-progress-label { display: none; }
}

/* ---------- Back to picker ---------- */

.cpd-flow-back-to-picker {
	background: none;
	border: none;
	color: var(--cpd-muted);
	font-size: 12px;
	font-family: inherit;
	cursor: pointer;
	margin-bottom: 16px;
	padding: 0;
	text-decoration: underline;
}
.cpd-flow-back-to-picker:hover { color: var(--cpd-black); }

/* ---------- Flow layout ---------- */

.cpd-flow-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: start;
}

@media (max-width: 900px) {
	.cpd-flow-body { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Live preview ---------- */

.cpd-flow-preview { position: sticky; top: 24px; }
@media (max-width: 900px) { .cpd-flow-preview { position: static; } }

/* Wall backdrop — subtle neutral texture so the piece looks "hung" rather than floating on a flat color */
.cpd-preview-wall {
	background:
		radial-gradient(circle at 20% 15%, rgba(255,255,255,0.5), transparent 60%),
		linear-gradient(180deg, #efece6 0%, #e9e5de 100%);
	border-radius: 4px;
	padding: 40px 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cpd-preview-frame {
	background: #f2efe9;
	width: 100%;
	max-width: 320px;
	border-radius: 2px;
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease, aspect-ratio 0.3s ease;
	box-shadow: 0 18px 30px -12px rgba(0,0,0,0.25);
}
.cpd-preview-mat {
	background: #ffffff;
	width: 100%;
	height: 100%;
	padding: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
	transition: background-color 0.3s ease;
}
.cpd-preview-artwork {
	width: 100%;
	height: 100%;
	background: #f7f7f5;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.cpd-preview-artwork img { width: 100%; height: 100%; object-fit: cover; }
.cpd-preview-placeholder { font-size: 11px; color: var(--cpd-muted); text-align: center; padding: 20px; letter-spacing: 0.5px; text-transform: uppercase; }
.cpd-preview-caption { text-align: center; font-size: 11px; color: var(--cpd-muted); margin: 10px 0 0; min-height: 14px; font-weight: 600; letter-spacing: 0.5px; }

/* "View on your wall" camera toggle */
.cpd-ar-toggle {
	display: block;
	width: 100%;
	margin-top: 12px;
	background: none;
	border: 1px solid var(--cpd-black);
	color: var(--cpd-black);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	padding: 10px;
	border-radius: 4px;
	cursor: pointer;
}
.cpd-ar-toggle.is-active { background: var(--cpd-black); color: #fff; }
.cpd-ar-error { font-size: 11px; color: var(--cpd-accent); text-align: center; margin: 8px 0 0; }

.cpd-ar-view {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
	touch-action: none;
}
.cpd-ar-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cpd-ar-box {
	position: absolute;
	top: 30%;
	left: 30%;
	width: 40%;
	height: 40%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
	cursor: move;
}
.cpd-ar-box-inner {
	width: 100%;
	height: 100%;
	background: #f2efe9 center / cover no-repeat;
	box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.cpd-ar-resize-handle {
	position: absolute;
	right: -8px;
	bottom: -8px;
	width: 16px;
	height: 16px;
	background: #fff;
	border: 2px solid var(--cpd-black);
	border-radius: 50%;
	cursor: nwse-resize;
}
.cpd-ar-hint {
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font-size: 10px;
	letter-spacing: 0.5px;
	text-shadow: 0 1px 2px rgba(0,0,0,0.6);
	margin: 0;
	pointer-events: none;
}

/* Selections summary — always visible list of every current choice */
.cpd-selections-summary { margin-top: 20px; border-top: 1px solid var(--cpd-border); padding-top: 14px; }
.cpd-selections-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--cpd-muted); margin: 0 0 8px; }
.cpd-selections-list { list-style: none; margin: 0; padding: 0; }
.cpd-selections-list li {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	padding: 5px 0;
	border-bottom: 1px solid #f2f2f2;
}
.cpd-selections-list li:last-child { border-bottom: none; }
.cpd-selections-list .cpd-sel-label { color: var(--cpd-muted); }
.cpd-selections-list .cpd-sel-value { font-weight: 600; }

/* ---------- Panels ---------- */

.cpd-step-title { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 4px; }
.cpd-step-subtitle { font-size: 12px; color: var(--cpd-muted); margin: 0 0 16px; }

/* Size step */
.cpd-size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.cpd-size-pill {
	border: 1px solid var(--cpd-border);
	border-radius: 4px;
	padding: 12px 8px;
	background: #fff;
	cursor: pointer;
	text-align: center;
	font-family: inherit;
	transition: border-color 0.15s ease;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.cpd-size-pill:hover { border-color: var(--cpd-black); }
.cpd-size-pill.is-selected { border-color: var(--cpd-black); background: #fafafa; }
.cpd-size-pill-label { font-size: 13px; font-weight: 600; }
.cpd-size-pill-price { font-size: 10px; color: var(--cpd-muted); }

/* Options */
.cpd-option-group { margin-bottom: 20px; }
.cpd-option-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.cpd-select, .cpd-quantity-input, .cpd-notes {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--cpd-border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 13px;
	background: #fff;
}
.cpd-quantity-input { max-width: 100px; }

.cpd-swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cpd-swatch {
	width: 32px; height: 32px;
	border-radius: 50%;
	border: 1px solid var(--cpd-border);
	background-size: cover;
	background-position: center;
	cursor: pointer;
	padding: 0;
	transition: box-shadow 0.15s ease;
}
.cpd-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--cpd-black); }

.cpd-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cpd-radio-pill {
	border: 1px solid var(--cpd-border);
	border-radius: 4px;
	padding: 7px 14px;
	font-size: 12px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.cpd-radio-pill input { accent-color: var(--cpd-black); }
.cpd-radio-pill:has(input:checked) { border-color: var(--cpd-black); font-weight: 700; }

/* Upload */
.cpd-upload-area { margin-bottom: 20px; }
.cpd-upload-dropzone {
	border: 2px dashed var(--cpd-border);
	border-radius: 8px;
	padding: 32px 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}
.cpd-upload-dropzone:hover, .cpd-upload-dropzone.is-dragover {
	border-color: var(--cpd-black);
	background: #fafafa;
}
.cpd-upload-icon { display: block; font-size: 22px; margin-bottom: 8px; }
.cpd-upload-types { font-size: 11px; color: var(--cpd-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.cpd-upload-preview { display: flex; align-items: center; gap: 14px; border: 1px solid var(--cpd-border); border-radius: 8px; padding: 12px; }
.cpd-upload-preview-img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #f4f4f4; }
.cpd-upload-preview-info { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cpd-upload-preview-info button { background: none; border: none; text-decoration: underline; cursor: pointer; font-size: 12px; color: var(--cpd-muted); padding: 0; width: fit-content; }

.cpd-upload-status { font-size: 12px; margin-top: 8px; }
.cpd-upload-status.is-error { color: var(--cpd-accent); }
.cpd-upload-status.is-success { color: #1a7a1a; }

/* Services */
.cpd-service-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; cursor: pointer; font-size: 14px; }
.cpd-service-row input { margin-top: 3px; }
.cpd-service-label em { display: block; font-style: normal; color: var(--cpd-muted); font-size: 12px; }

.cpd-whatsapp-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0 20px 26px;
	background: #25D366;
	color: #fff;
	padding: 8px 16px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
}
.cpd-book-link {
	display: inline-block;
	margin: 4px 0 20px 26px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: underline;
	color: var(--cpd-black);
}

/* ---------- Summary / Review ---------- */

.cpd-summary { margin-top: 20px; border-top: 1px solid var(--cpd-border); padding-top: 20px; }
.cpd-summary-rows { font-size: 12px; color: var(--cpd-muted); margin-bottom: 8px; }
.cpd-summary-row { display: flex; justify-content: space-between; padding: 2px 0; }
.cpd-summary-total-row {
	display: flex;
	justify-content: space-between;
	font-size: 18px;
	font-weight: 800;
	border-top: 1px solid var(--cpd-border);
	padding-top: 10px;
	margin-top: 6px;
}
.cpd-shipping-note { font-size: 11px; color: var(--cpd-muted); margin: 6px 0 0; }
.cpd-add-to-cart-btn {
	width: 100%;
	margin-top: 16px;
	background: var(--cpd-black);
	color: #fff;
	border: none;
	padding: 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.2s ease;
}
.cpd-add-to-cart-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cpd-summary-message { font-size: 12px; margin-top: 8px; text-align: center; }
.cpd-summary-message.is-error { color: var(--cpd-accent); }
.cpd-summary-message.is-success { color: #1a7a1a; }

/* ---------- Step nav (Next / Back) ---------- */

.cpd-flow-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 32px;
	border-top: 1px solid var(--cpd-border);
	padding-top: 20px;
}
.cpd-btn-back, .cpd-btn-next {
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	padding: 10px 24px;
	border-radius: 4px;
	cursor: pointer;
}
.cpd-btn-back {
	background: none;
	border: 1px solid var(--cpd-border);
	color: var(--cpd-black);
}
.cpd-btn-back:disabled { opacity: 0.3; cursor: not-allowed; }
.cpd-btn-next {
	background: var(--cpd-black);
	border: none;
	color: #fff;
	margin-left: auto;
}

/* ==========================================================================
   Brand header / hero banner / tagline (optional, shown via [cpd_wizard])
   ========================================================================== */

.cpd-wizard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0 20px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--cpd-border);
}
.cpd-wizard-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: 0.3px; }
.cpd-wizard-brand-mark {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--cpd-black);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
	flex-shrink: 0;
}
.cpd-wizard-cart {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cpd-black);
}
.cpd-wizard-cart-count {
	background: var(--cpd-black);
	color: #fff;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
}

.cpd-wizard-hero {
	background: #f5f3f0;
	border-radius: 8px;
	padding: 26px 24px;
	text-align: center;
	margin-bottom: 20px;
}
.cpd-wizard-hero-banner {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--cpd-muted);
	margin-bottom: 8px;
}
.cpd-wizard-hero-title {
	font-size: 34px;
	font-weight: 900;
	letter-spacing: -0.5px;
	line-height: 1.15;
	margin: 0 0 6px;
	text-transform: uppercase;
}
.cpd-wizard-hero-accent { color: var(--cpd-accent); }
.cpd-wizard-hero-sub {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--cpd-muted);
}

.cpd-wizard-tagline {
	text-align: center;
	padding: 0 0 22px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--cpd-muted);
}
.cpd-wizard-tagline-dot { color: var(--cpd-accent); font-size: 6px; vertical-align: middle; }

@media (max-width: 600px) {
	.cpd-wizard-hero-title { font-size: 24px; }
}

/* ==========================================================================
   Room background selector (client-side only, tints the preview wall)
   ========================================================================== */

.cpd-room-select {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 12px;
}
.cpd-room-select button {
	padding: 5px 14px;
	border-radius: 20px;
	border: 1px solid var(--cpd-border);
	background: #fff;
	font-family: inherit;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--cpd-muted);
	cursor: pointer;
	transition: 0.2s ease;
}
.cpd-room-select button:hover { border-color: var(--cpd-black); }
.cpd-room-select button.is-active {
	background: var(--cpd-black);
	border-color: var(--cpd-black);
	color: #fff;
}

/* ==========================================================================
   Sticky mobile "Add to Cart" bar — mirrors the live total on small screens
   ========================================================================== */

.cpd-sticky-bar { display: none; }

@media (max-width: 768px) {
	.cpd-sticky-bar.is-visible {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100;
		background: #fff;
		padding: 10px 16px;
		border-top: 1px solid var(--cpd-border);
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
	}
	.cpd-sticky-bar-price { font-size: 16px; font-weight: 800; }
	.cpd-sticky-bar-btn {
		flex: 1;
		max-width: 220px;
		padding: 12px;
		border-radius: 4px;
		background: var(--cpd-black);
		color: #fff;
		border: none;
		font-family: inherit;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.5px;
		text-transform: uppercase;
		cursor: pointer;
	}
	.cpd-sticky-bar-btn:disabled { opacity: 0.5; cursor: not-allowed; }
	/* Leave room at the bottom of the page so the bar never covers content */
	.cpd-wizard { padding-bottom: 70px; }
}
