.cc-configurator {
	--cc-olive: #a8b625;
	--cc-olive-dark: #8f9b1f;
	--cc-olive-light: #c3cf5a;
	--cc-bg: #f2f1ef;
	--cc-white: #ffffff;
	--cc-text-dark: #262626;
	--cc-text-grey: #868e96;
	--cc-border: #e3e3e1;
	--cc-radius: 6px;
	--cc-shadow: 0 2px 10px rgba(20, 20, 20, 0.06);
	--cc-shadow-lg: 0 12px 30px rgba(20, 20, 20, 0.14);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--cc-text-dark);
	max-width: 1568px;
	margin: 0 auto;
	background: var(--cc-white);
	box-shadow: var(--cc-shadow);
	border-radius: var(--cc-radius);
	overflow: hidden;
}

.cc-configurator * {
	box-sizing: border-box;
}

/* ---------------- Top tab bar ---------------- */

.cc-tabs {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 60px;
	background: var(--cc-white);
	border-bottom: 1px solid var(--cc-border);
	padding: 22px 24px;
	flex-wrap: wrap;
}

.cc-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	line-height: 1.6;
	user-select: none;
	position: relative;
	padding-bottom: 8px;
}

.cc-tab-label {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #a2a8ad;
	transition: color 0.2s ease;
}

.cc-tab-value {
	font-size: 11px;
	letter-spacing: 0.03em;
	color: #c3c8cc;
	transition: color 0.2s ease;
	max-width: 190px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cc-tab::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 20px;
	height: 3px;
	border-radius: 2px;
	background: #d8dcd0;
	transition: background 0.2s ease, width 0.2s ease;
}

.cc-tab:hover .cc-tab-label {
	color: #7d8388;
}

.cc-tab.cc-active .cc-tab-label {
	color: var(--cc-olive-dark);
}

.cc-tab.cc-active .cc-tab-value {
	color: var(--cc-olive);
	font-weight: 600;
}

.cc-tab.cc-active::after {
	background: var(--cc-olive);
	width: 28px;
}

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

.cc-panels {
	position: relative;
	background: var(--cc-bg);
}

.cc-panel {
	display: none;
	padding: 44px 48px;
}

.cc-panel.cc-active {
	display: block;
	animation: cc-fade-in 0.25s ease;
}

@keyframes cc-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

.cc-panel-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	grid-template-rows: auto 1fr;
	column-gap: 34px;
	row-gap: 28px;
}

.cc-panel-header {
	grid-column: 1;
	grid-row: 1;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	flex-wrap: wrap;
}

.cc-heading {
	font-size: 23px;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--cc-text-dark);
	letter-spacing: -0.01em;
}

.cc-subtext {
	font-size: 14px;
	color: var(--cc-text-grey);
	margin: 0;
}

.cc-continue-btn {
	background: var(--cc-olive);
	color: var(--cc-white);
	border: none;
	padding: 15px 30px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-align: center;
	cursor: pointer;
	line-height: 1.6;
	border-radius: var(--cc-radius);
	white-space: nowrap;
	box-shadow: 0 4px 10px rgba(168, 182, 37, 0.28);
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cc-continue-btn:hover {
	background: var(--cc-olive-dark);
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(168, 182, 37, 0.34);
}

.cc-continue-btn:active {
	transform: translateY(0);
}

.cc-continue-btn span {
	display: block;
	font-size: 10.5px;
	font-weight: 600;
	opacity: 0.9;
	letter-spacing: 0.05em;
}

/* ---------------- Carousel (coverflow) ---------------- */

.cc-carousel {
	grid-column: 1;
	grid-row: 2;
	display: flex;
	align-items: stretch;
	min-width: 0;
	min-height: 320px;
}

.cc-arrow {
	flex: 0 0 52px;
	background: var(--cc-olive);
	border: none;
	color: var(--cc-white);
	font-size: 26px;
	cursor: pointer;
	border-radius: var(--cc-radius);
	margin: 4px;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.cc-arrow:hover:not(:disabled) {
	background: var(--cc-olive-dark);
}

.cc-arrow:disabled {
	background: #dfe3cf;
	color: #fff;
	cursor: default;
	opacity: 0.7;
}

.cc-carousel-viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	position: relative;
	padding: 16px 0;
	touch-action: pan-y;
	cursor: grab;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.cc-carousel-viewport:active {
	cursor: grabbing;
}

.cc-carousel-track {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 100%;
	transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.cc-card {
	flex: 0 0 190px;
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.35s ease;
	opacity: 0.4;
	transform: scale(0.78);
}

.cc-card[data-pos="0"] {
	opacity: 1;
	transform: scale(1.14) translateY(-18px);
	z-index: 5;
}

.cc-card[data-pos="1"] {
	opacity: 0.78;
	transform: scale(0.9) translateY(0);
	z-index: 4;
}

.cc-card[data-pos="2"] {
	opacity: 0.5;
	transform: scale(0.8);
	z-index: 3;
}

.cc-card-image {
	width: 190px;
	height: 258px;
	background: var(--cc-white);
	border: 1px solid #d8d8d6;
	border-radius: var(--cc-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: var(--cc-shadow);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cc-card[data-pos="0"] .cc-card-image {
	border-color: var(--cc-olive);
	border-width: 2px;
	box-shadow: var(--cc-shadow-lg);
}

.cc-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cc-card-placeholder {
	font-size: 12px;
	color: #b7bcc2;
	text-align: center;
	padding: 10px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.cc-card-name {
	margin-top: 14px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--cc-text-dark);
	text-align: center;
	max-width: 190px;
	transition: opacity 0.3s ease;
}

.cc-card:not([data-pos="0"]) .cc-card-name {
	opacity: 0;
}

.cc-card.cc-hidden {
	display: none;
}

/* ---------------- Cabinet Series (static, no slider) ---------------- */

.cc-carousel-static {
	justify-content: center;
}

.cc-carousel-static .cc-carousel-viewport {
	flex: 0 1 auto;
	overflow: visible;
	-webkit-mask-image: none;
	mask-image: none;
	padding: 24px 0;
}

.cc-carousel-static .cc-carousel-track {
	justify-content: center;
	gap: 56px;
}

.cc-carousel-static .cc-card {
	flex: 0 0 220px;
}

.cc-carousel-static .cc-card-image {
	width: 220px;
	height: 300px;
}

.cc-carousel-static .cc-card:not([data-pos="0"]) .cc-card-name {
	opacity: 1;
}

/* ---------------- Right preview panel ---------------- */

.cc-preview-panel {
	grid-column: 2;
	grid-row: 1 / span 2;
	border: 1px solid var(--cc-border);
	border-radius: var(--cc-radius);
	background: var(--cc-white);
	display: flex;
	flex-direction: column;
	min-height: 380px;
	box-shadow: var(--cc-shadow);
	overflow: hidden;
}

.cc-preview-image-wrap {
	flex: 1 1 auto;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fafaf9;
	overflow: hidden;
	min-height: 300px;
}

.cc-preview-image {
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	object-fit: contain; /* show the whole door - Juno's taller drawer-front image sizes the pane */
	display: none;
}

.cc-preview-placeholder {
	color: #c3c7cb;
	font-size: 12.5px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-align: center;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Full dimmed overlay with a centered spinner, shown over the Color
   step's preview while its Design+Material+Color render is being
   fetched/generated. Nothing else (no flat swatch, no old image) shows
   underneath it while it's up. */
.cc-ai-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.cc-ai-overlay-spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.12);
	border-top-color: var(--cc-olive);
	animation: cc-spin 0.8s linear infinite;
}

@keyframes cc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------- Submit block (Color step only) ---------------- */

.cc-submit-block {
	padding: 18px;
	border-top: 1px solid var(--cc-border);
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
}

.cc-submit-btn {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--cc-olive);
	color: var(--cc-white);
	border: none;
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-radius: var(--cc-radius);
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(168, 182, 37, 0.28);
	transition: background 0.15s ease, transform 0.15s ease;
}

.cc-submit-btn:hover:not(:disabled) {
	background: var(--cc-olive-dark);
	transform: translateY(-1px);
}

.cc-submit-btn:disabled {
	opacity: 0.7;
	cursor: default;
}

.cc-submit-status {
	font-size: 13px;
	text-align: center;
	min-height: 18px;
}

.cc-submit-status.cc-submit-success {
	color: #4c7a2a;
}

.cc-submit-status.cc-submit-error {
	color: #b3402f;
}

/* ---------------- Final Preview tab ---------------- */

.cc-panel-preview {
	padding: 0;
}

.cc-final-preview {
	position: relative;
	width: 100%;
	min-height: 85vh;
	background: #e9e9e7;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	padding: 32px 24px;
}

.cc-final-preview-images {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 32px;
	flex-wrap: wrap;
	width: 100%;
	height: 100%;
}

.cc-final-preview-image {
	width: auto;
	height: auto;
	max-width: 92%;
	max-height: 78vh;
	object-fit: contain;
	border-radius: var(--cc-radius);
	box-shadow: var(--cc-shadow-lg);
	display: block;
}

/* Only the open-door view is shown. .cc-two-images is toggled in JS once
   the open-door image has loaded, so the closed view stays as a fallback
   for combinations that have no open-door image. */
.cc-final-preview-images.cc-two-images .cc-final-preview-image-closed {
	display: none !important;
}

.cc-final-preview:has( .cc-two-images ) .cc-final-preview-message {
	display: none !important;
}

.cc-back-arrow {
	position: absolute;
	top: 20px;
	left: 20px;
	width: 60px;
	height: 60px;
	border-radius: var(--cc-radius);
	background: var(--cc-olive);
	color: var(--cc-white);
	border: none;
	font-size: 26px;
	cursor: pointer;
	z-index: 2;
	transition: background 0.15s ease;
}

.cc-back-arrow:hover {
	background: var(--cc-olive-dark);
}

.cc-final-preview-message,
.cc-final-preview-loading {
	color: #9aa0a6;
	font-size: 15px;
	text-align: center;
	padding: 0 40px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
	.cc-panel-inner {
		grid-template-columns: minmax(0, 1fr);
	}
	.cc-preview-panel {
		grid-column: 1;
		grid-row: 3;
		min-height: 260px;
	}
	.cc-panel-header {
		grid-column: 1;
		grid-row: 1;
	}
	.cc-carousel {
		grid-column: 1;
		grid-row: 2;
	}
	.cc-tabs {
		gap: 24px;
	}
}

@media (max-width: 640px) {
	.cc-configurator {
		border-radius: 0;
	}

	/* Tabs: scroll horizontally instead of wrapping/overflowing. */
	.cc-tabs {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 22px;
		padding: 14px 16px;
	}
	.cc-tab {
		flex: 0 0 auto;
	}
	.cc-tab-label {
		font-size: 11px;
	}
	.cc-tab-value {
		font-size: 10px;
		max-width: 110px;
	}

	.cc-panel {
		padding: 20px 14px;
	}

	.cc-panel-inner {
		row-gap: 16px;
	}

	.cc-panel-header {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.cc-heading {
		font-size: 19px;
	}

	.cc-continue-btn {
		width: 100%;
		padding: 13px 18px;
	}

	/* Carousel: smaller cards and arrows so everything fits without
	   horizontal page overflow, and the coverflow effect still reads
	   clearly on a narrow screen. */
	.cc-carousel {
		min-height: 230px;
	}
	.cc-arrow {
		flex: 0 0 36px;
		font-size: 20px;
		margin: 2px;
	}
	.cc-card {
		flex-basis: 128px;
	}
	.cc-card-image {
		width: 128px;
		height: 172px;
	}
	.cc-card-name {
		font-size: 13px;
		margin-top: 10px;
	}
	.cc-carousel-track {
		gap: 16px;
	}

	/* Cabinet Series (static, centered) needs its own smaller sizing so
	   two cards plus their gap never exceed a phone-width viewport. */
	.cc-carousel-static .cc-card {
		flex-basis: 130px;
	}
	.cc-carousel-static .cc-card-image {
		width: 130px;
		height: 176px;
	}
	.cc-carousel-static .cc-carousel-track {
		gap: 20px;
	}

	.cc-preview-panel {
		min-height: 220px;
	}
	.cc-preview-image-wrap {
		min-height: 200px;
	}

	.cc-final-preview {
		min-height: 70vh;
		padding: 16px;
	}
	.cc-final-preview-image {
		max-width: 100%;
		max-height: 65vh;
	}
	.cc-back-arrow {
		width: 52px;
		height: 52px;
		font-size: 20px;
		top: 12px;
		left: 12px;
	}
}
