/* Ceramic Product Wizard – minimal purple theme (RTL) */

.cpw {
	--cpw-accent: #6d28d9;        /* violet-700 */
	--cpw-accent-dark: #4c1d95;   /* violet-900 */
	--cpw-accent-2: #8b5cf6;      /* violet-500 */
	--cpw-soft: #f6f4fe;          /* violet-50 tint  */
	--cpw-soft-2: #efeafc;        /* slightly deeper tint */
	--cpw-bg: #ffffff;
	--cpw-card: #ffffff;
	--cpw-border: #ece9f7;
	--cpw-text: #1c1730;
	--cpw-muted: #857e9b;
	--cpw-radius: 18px;
	--cpw-radius-sm: 12px;
	--cpw-shadow: 0 10px 30px rgba( 76, 29, 149, .07 );
	--cpw-shadow-hover: 0 14px 34px rgba( 109, 40, 217, .18 );

	box-sizing: border-box;
	max-width: 1000px;
	margin: 0 auto;
	padding: 28px;
	background: var(--cpw-bg);
	color: var(--cpw-text);
	border: 1px solid var(--cpw-border);
	border-radius: calc( var(--cpw-radius) + 6px );
	box-shadow: var(--cpw-shadow);
	font-family: inherit;
	line-height: 1.75;
}

.cpw *,
.cpw *::before,
.cpw *::after {
	box-sizing: border-box;
}

/* Head + progress */
.cpw__head {
	margin-bottom: 26px;
}
.cpw__title {
	margin: 0 0 16px;
	font-size: 1.4rem;
	font-weight: 800;
	text-align: center;
	letter-spacing: -.2px;
}
.cpw__progress {
	height: 7px;
	background: var(--cpw-soft-2);
	border-radius: 999px;
	overflow: hidden;
}
.cpw__progress-bar {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient( 90deg, var(--cpw-accent-2), var(--cpw-accent) );
	transition: width .4s cubic-bezier( .4, 0, .2, 1 );
}

.cpw__q {
	margin: 6px 0 24px;
	font-size: 1.18rem;
	font-weight: 700;
	text-align: center;
	color: var(--cpw-text);
}

/* Grids */
.cpw__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 190px, 1fr ) );
	gap: 16px;
}
.cpw__grid--2 {
	grid-template-columns: repeat( auto-fit, minmax( 240px, 1fr ) );
	max-width: 640px;
	margin: 0 auto;
}
.cpw__grid--3 {
	grid-template-columns: repeat( auto-fit, minmax( 180px, 1fr ) );
}
.cpw__grid--swatch {
	grid-template-columns: repeat( auto-fill, minmax( 150px, 1fr ) );
}

/* Cards */
.cpw__card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 22px 16px;
	background: var(--cpw-card);
	border: 1.5px solid var(--cpw-border);
	border-radius: var(--cpw-radius);
	cursor: pointer;
	text-align: center;
	font: inherit;
	color: inherit;
	transition: border-color .2s, transform .15s, box-shadow .2s, background .2s;
}
.cpw__card::after {
	/* subtle top accent line that appears on hover */
	content: '';
	position: absolute;
	inset: 0 auto auto 0;
	right: 22px;
	left: 22px;
	top: 0;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: linear-gradient( 90deg, var(--cpw-accent-2), var(--cpw-accent) );
	opacity: 0;
	transition: opacity .2s;
}
.cpw__card:hover {
	border-color: transparent;
	transform: translateY( -3px );
	box-shadow: var(--cpw-shadow-hover);
	background: var(--cpw-card);
}
.cpw__card:hover::after {
	opacity: 1;
}
.cpw__card:focus-visible {
	outline: 2px solid var(--cpw-accent);
	outline-offset: 2px;
}
.cpw__card--persona {
	padding: 32px 20px;
	gap: 10px;
}
.cpw__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	font-size: 2rem;
	line-height: 1;
	border-radius: 50%;
	background: var(--cpw-soft);
	color: var(--cpw-accent);
}
.cpw__card-title {
	font-weight: 800;
	font-size: 1.04rem;
	color: var(--cpw-text);
}
.cpw__card-sub {
	font-size: .85rem;
	color: var(--cpw-muted);
	line-height: 1.6;
}
.cpw__card-meta {
	font-size: .82rem;
	font-weight: 700;
	color: var(--cpw-accent);
	background: var(--cpw-soft);
	padding: 4px 10px;
	border-radius: 999px;
}

/* Swatch + thumb */
.cpw__swatch {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1.5px var(--cpw-border), 0 4px 10px rgba( 0, 0, 0, .08 );
}
.cpw__thumb img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 12px;
}

/* Fields */
.cpw__field {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 380px;
	margin: 0 auto 16px;
}
.cpw__input {
	flex: 1;
	padding: 13px 16px;
	border: 1.5px solid var(--cpw-border);
	border-radius: var(--cpw-radius-sm);
	font: inherit;
	background: #fff;
	color: var(--cpw-text);
	transition: border-color .2s, box-shadow .2s;
}
.cpw__input::placeholder {
	color: #b7b1c9;
}
.cpw__input:focus {
	outline: none;
	border-color: var(--cpw-accent);
	box-shadow: 0 0 0 4px rgba( 109, 40, 217, .12 );
}
.cpw__unit {
	color: var(--cpw-muted);
	white-space: nowrap;
	font-size: .92rem;
}
.cpw__next {
	display: block;
	margin: 10px auto 0;
	padding: 13px 34px;
	background: var(--cpw-accent);
	color: #fff;
	border: none;
	border-radius: var(--cpw-radius-sm);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba( 109, 40, 217, .25 );
	transition: background .2s, transform .12s, box-shadow .2s;
}
.cpw__next:hover {
	background: var(--cpw-accent-dark);
	transform: translateY( -1px );
}
.cpw__next:disabled {
	opacity: .55;
	cursor: default;
	box-shadow: none;
}

/* Notes / result meta */
.cpw__resultmeta {
	text-align: center;
	color: var(--cpw-muted);
	margin: 0 0 20px;
	font-size: .95rem;
}
.cpw__note {
	text-align: center;
	margin: 0 auto 18px;
	max-width: 660px;
	padding: 11px 16px;
	font-size: .88rem;
	color: var(--cpw-accent-dark);
	background: var(--cpw-soft);
	border: 1px solid var(--cpw-border);
	border-radius: var(--cpw-radius-sm);
}

/* Products */
.cpw__products {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 18px;
}
.cpw-product {
	border: 1px solid var(--cpw-border);
	border-radius: var(--cpw-radius);
	overflow: hidden;
	background: var(--cpw-card);
	display: flex;
	flex-direction: column;
	transition: transform .15s, box-shadow .2s, border-color .2s;
}
.cpw-product:hover {
	transform: translateY( -3px );
	box-shadow: var(--cpw-shadow-hover);
	border-color: transparent;
}
.cpw-product__media {
	display: block;
	background: var(--cpw-soft-2);
}
.cpw-product__media img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.cpw-product__body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}
.cpw-product__title {
	font-weight: 700;
	font-size: .94rem;
	color: var(--cpw-text);
	text-decoration: none;
	line-height: 1.6;
}
.cpw-product__title:hover {
	color: var(--cpw-accent);
}
.cpw-product__price {
	color: var(--cpw-accent);
	font-weight: 800;
	font-size: .98rem;
	margin-top: auto;
}
.cpw-product__price del {
	color: var(--cpw-muted);
	font-weight: 500;
	font-size: .82rem;
	margin-inline-start: 6px;
}
.cpw-product__btn {
	text-align: center;
	padding: 10px 12px;
	background: var(--cpw-accent);
	color: #fff;
	border-radius: var(--cpw-radius-sm);
	text-decoration: none;
	font-size: .88rem;
	font-weight: 700;
	transition: background .2s;
}
.cpw-product__btn:hover {
	background: var(--cpw-accent-dark);
	color: #fff;
}

/* Inquiry */
.cpw__inquiry {
	margin-top: 30px;
	padding: 26px;
	border: 1.5px solid var(--cpw-border);
	border-radius: var(--cpw-radius);
	background: var(--cpw-soft);
}
.cpw__inquiry-title {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 800;
	text-align: center;
}
.cpw__inquiry-sub {
	margin: 0 0 18px;
	text-align: center;
	color: var(--cpw-muted);
	font-size: .9rem;
}
.cpw__inquiry-msg {
	text-align: center;
	margin: 12px 0 0;
	font-weight: 700;
}
.cpw__inquiry-msg.is-error {
	color: #d33a52;
}
.cpw__inquiry-msg.is-ok {
	color: #2e9e6b;
}

/* States */
.cpw__loading,
.cpw__empty {
	text-align: center;
	padding: 40px 12px;
	color: var(--cpw-muted);
}
.cpw__loading::before {
	content: '';
	display: block;
	width: 30px;
	height: 30px;
	margin: 0 auto 14px;
	border: 3px solid var(--cpw-soft-2);
	border-top-color: var(--cpw-accent);
	border-radius: 50%;
	animation: cpw-spin .8s linear infinite;
}
@keyframes cpw-spin {
	to { transform: rotate( 360deg ); }
}

/* Nav */
.cpw__nav {
	display: flex;
	justify-content: space-between;
	margin-top: 26px;
}
.cpw__back,
.cpw__restart {
	background: transparent;
	border: 1.5px solid var(--cpw-border);
	color: var(--cpw-muted);
	padding: 10px 20px;
	border-radius: var(--cpw-radius-sm);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .2s, color .2s, background .2s;
}
.cpw__back:hover,
.cpw__restart:hover {
	border-color: var(--cpw-accent);
	color: var(--cpw-accent);
	background: var(--cpw-soft);
}

/* "See results now" shortcut, available on every step */
.cpw__skip {
	background: var(--cpw-soft);
	border: 1.5px solid var(--cpw-accent);
	color: var(--cpw-accent);
	padding: 10px 22px;
	border-radius: var(--cpw-radius-sm);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s, color .2s, transform .12s, box-shadow .2s;
}
.cpw__skip:hover {
	background: var(--cpw-accent);
	color: #fff;
	transform: translateY( -1px );
	box-shadow: 0 8px 20px rgba( 109, 40, 217, .25 );
}
.cpw__skip[hidden] {
	display: none;
}

@media ( max-width: 560px ) {
	.cpw__nav {
		flex-wrap: wrap;
		gap: 10px;
	}
	.cpw__skip {
		order: -1;
		flex-basis: 100%;
		text-align: center;
	}
}

/* ---------------------------------------------------------------------
 * Animations — everything eases in.
 * ------------------------------------------------------------------- */
@keyframes cpw-fade-up {
	from { opacity: 0; transform: translateY( 14px ); }
	to   { opacity: 1; transform: none; }
}
@keyframes cpw-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes cpw-pop {
	0%   { transform: scale( 1 ); }
	40%  { transform: scale( .94 ); }
	100% { transform: scale( 1 ); }
}
@keyframes cpw-title-in {
	from { opacity: 0; transform: translateY( -8px ); letter-spacing: 2px; }
	to   { opacity: 1; transform: none; letter-spacing: -.2px; }
}

/* Question title slides in each step */
.cpw__q {
	animation: cpw-title-in .45s cubic-bezier( .22, 1, .36, 1 ) both;
}

/* Cards / products enter staggered via the --i delay set in JS */
.cpw__card,
.cpw-product {
	animation: cpw-fade-up .5s cubic-bezier( .22, 1, .36, 1 ) both;
	animation-delay: var( --i, 0ms );
}

/* Other stage pieces just fade up */
.cpw__field,
.cpw__next,
.cpw__note,
.cpw__resultmeta,
.cpw__inquiry,
.cpw__empty {
	animation: cpw-fade-up .45s cubic-bezier( .22, 1, .36, 1 ) both;
}
.cpw__loading {
	animation: cpw-fade-in .3s ease both;
}

/* Press feedback when a choice is made */
.cpw__card.is-selected {
	animation: cpw-pop .3s ease;
	border-color: transparent;
	box-shadow: var(--cpw-shadow-hover);
	background: var(--cpw-soft);
}
.cpw__card.is-selected::after {
	opacity: 1;
}

/* Progress bar shimmer */
.cpw__progress-bar {
	position: relative;
	overflow: hidden;
}
.cpw__progress-bar::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient( 90deg, transparent, rgba( 255, 255, 255, .5 ), transparent );
	transform: translateX( -100% );
	animation: cpw-shimmer 1.8s ease-in-out infinite;
}
@keyframes cpw-shimmer {
	to { transform: translateX( 100% ); }
}

/* Respect users who prefer less motion */
@media ( prefers-reduced-motion: reduce ) {
	.cpw *,
	.cpw *::after,
	.cpw *::before {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* Dark mode */
@media ( prefers-color-scheme: dark ) {
	.cpw {
		--cpw-soft: #241b3a;
		--cpw-soft-2: #2c2246;
		--cpw-bg: #17131f;
		--cpw-card: #201a2e;
		--cpw-border: #342a49;
		--cpw-text: #ece8f6;
		--cpw-muted: #a79fbd;
		--cpw-accent: #a78bfa;
		--cpw-accent-2: #8b5cf6;
		--cpw-accent-dark: #7c5cf0;
		--cpw-shadow: 0 10px 30px rgba( 0, 0, 0, .35 );
		--cpw-shadow-hover: 0 14px 34px rgba( 124, 92, 240, .3 );
	}
	.cpw__input {
		background: var(--cpw-card);
	}
	.cpw__swatch {
		border-color: var(--cpw-card);
	}
}

/* Responsive */
@media ( max-width: 560px ) {
	.cpw {
		padding: 16px;
		border-radius: var(--cpw-radius);
	}
	.cpw__grid {
		grid-template-columns: repeat( auto-fill, minmax( 145px, 1fr ) );
		gap: 12px;
	}
	.cpw__products {
		grid-template-columns: repeat( auto-fill, minmax( 150px, 1fr ) );
		gap: 12px;
	}
	.cpw__card {
		padding: 18px 12px;
	}
}
