/* ==========================================================================
   Create Your Perfume Builder — public styles
   Palette: ivory / ink / warm gold-orange accent (matches the "orange
   border" selection behaviour called for in the spec).
   ========================================================================== */

.cypb-builder {
	--cypb-ink: #171512;
	--cypb-ink-soft: #4a463f;
	--cypb-ivory: #faf8f5;
	--cypb-paper: #ffffff;
	--cypb-line: #eee9e2;
	--cypb-accent: #c8722c;
	--cypb-accent-soft: rgba(200, 114, 44, 0.12);
	--cypb-radius-lg: 20px;
	--cypb-radius-md: 14px;
	--cypb-radius-sm: 10px;
	--cypb-shadow-sm: 0 2px 10px rgba(23, 21, 18, 0.05);
	--cypb-shadow-md: 0 12px 32px rgba(23, 21, 18, 0.08);
	--cypb-ease: cubic-bezier(0.4, 0, 0.2, 1);

	position: relative;
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 32px);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--cypb-ink);
	background: var(--cypb-ivory);
	border-radius: 28px;
}

.cypb-builder * {
	box-sizing: border-box;
}

.cypb-empty {
	text-align: center;
	color: var(--cypb-ink-soft);
	padding: 60px 20px;
	font-size: 15px;
}

.cypb-step {
	margin-bottom: clamp(32px, 5vw, 56px);
	animation: cypb-fade-in 0.4s var(--cypb-ease);
}

.cypb-step[hidden] {
	display: none !important;
}

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

.cypb-step__header {
	margin-bottom: 24px;
	text-align: center;
}

.cypb-step__eyebrow {
	display: block;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--cypb-accent);
	font-weight: 600;
	margin-bottom: 6px;
}

.cypb-step__title {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-weight: 500;
	font-size: clamp(24px, 3vw, 32px);
	margin: 0;
	letter-spacing: 0.01em;
}

/* ---------- Product Type cards ---------- */

.cypb-type-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: clamp(12px, 2vw, 20px);
}

.cypb-type-card {
	background: var(--cypb-paper);
	border: 1.5px solid var(--cypb-line);
	border-radius: var(--cypb-radius-lg);
	padding: 18px 16px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	font-family: inherit;
	box-shadow: var(--cypb-shadow-sm);
	transition: border-color 0.25s var(--cypb-ease), box-shadow 0.25s var(--cypb-ease), transform 0.25s var(--cypb-ease);
}

.cypb-type-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--cypb-shadow-md);
}

.cypb-type-card:focus-visible {
	outline: 2px solid var(--cypb-accent);
	outline-offset: 2px;
}

.cypb-type-card[aria-checked="true"] {
	border-color: var(--cypb-accent);
	box-shadow: 0 0 0 1px var(--cypb-accent), var(--cypb-shadow-md);
}

.cypb-type-card__image-wrap {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--cypb-radius-md);
	overflow: hidden;
	background: var(--cypb-ivory);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cypb-type-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--cypb-ease);
}

.cypb-type-card:hover .cypb-type-card__image {
	transform: scale(1.04);
}

.cypb-type-card__image-placeholder {
	width: 40%;
	height: 40%;
	background: var(--cypb-line);
	border-radius: 50%;
}

.cypb-type-card__name {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 18px;
	font-weight: 600;
	text-align: center;
	line-height: 1.2;
}

.cypb-type-card__size {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cypb-ink-soft);
}

/* ---------- Size grid ---------- */

.cypb-size-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.cypb-size-option {
	min-width: 84px;
	padding: 14px 20px;
	border: 1.5px solid var(--cypb-line);
	border-radius: 999px;
	background: var(--cypb-paper);
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: var(--cypb-shadow-sm);
	transition: border-color 0.2s var(--cypb-ease), background 0.2s var(--cypb-ease), color 0.2s var(--cypb-ease);
}

.cypb-size-option:hover {
	border-color: var(--cypb-accent);
}

.cypb-size-option[aria-checked="true"] {
	border-color: var(--cypb-accent);
	background: var(--cypb-accent);
	color: #fff;
}

/* ---------- Brand / Fragrance selects ---------- */

.cypb-step--selects {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

.cypb-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cypb-field label {
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cypb-ink-soft);
	font-weight: 600;
}

.cypb-select {
	appearance: none;
	background: var(--cypb-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a463f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center;
	border: 1.5px solid var(--cypb-line);
	border-radius: var(--cypb-radius-sm);
	padding: 14px 40px 14px 18px;
	font-size: 15px;
	font-family: inherit;
	color: var(--cypb-ink);
	cursor: pointer;
	transition: border-color 0.2s var(--cypb-ease), opacity 0.2s var(--cypb-ease);
}

.cypb-select:focus-visible {
	outline: 2px solid var(--cypb-accent);
	outline-offset: 2px;
}

.cypb-select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- Product panel ---------- */

.cypb-product-panel {
	background: var(--cypb-paper);
	border-radius: var(--cypb-radius-lg);
	box-shadow: var(--cypb-shadow-md);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	overflow: hidden;
}

@media (max-width: 640px) {
	.cypb-product-panel {
		grid-template-columns: 1fr;
	}
}

.cypb-product-panel__image {
	background: var(--cypb-ivory);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cypb-product-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.4s var(--cypb-ease);
}

.cypb-product-image.is-loaded {
	opacity: 1;
}

.cypb-product-panel__info {
	padding: clamp(24px, 4vw, 48px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
}

.cypb-product-subtitle {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cypb-accent);
	font-weight: 600;
}

.cypb-product-name {
	margin: 0;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: clamp(28px, 3vw, 38px);
	font-weight: 500;
	line-height: 1.15;
}

.cypb-product-price {
	font-size: 20px;
	font-weight: 500;
	color: var(--cypb-ink);
}

.cypb-product-price .amount {
	font-weight: 600;
}

.cypb-quantity {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var(--cypb-line);
	border-radius: 999px;
	width: fit-content;
	overflow: hidden;
}

.cypb-qty-btn {
	background: transparent;
	border: none;
	width: 40px;
	height: 44px;
	font-size: 18px;
	cursor: pointer;
	color: var(--cypb-ink);
	transition: background 0.2s var(--cypb-ease);
}

.cypb-qty-btn:hover {
	background: var(--cypb-accent-soft);
}

.cypb-qty-input {
	width: 46px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--cypb-line);
	border-right: 1px solid var(--cypb-line);
	height: 44px;
	font-size: 15px;
	font-family: inherit;
	background: transparent;
	color: var(--cypb-ink);
	-moz-appearance: textfield;
}

.cypb-qty-input::-webkit-outer-spin-button,
.cypb-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cypb-add-to-cart {
	margin-top: 8px;
	background: var(--cypb-ink);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 16px 28px;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	cursor: pointer;
	width: fit-content;
	transition: background 0.25s var(--cypb-ease), transform 0.15s var(--cypb-ease);
}

.cypb-add-to-cart:hover {
	background: var(--cypb-accent);
}

.cypb-add-to-cart:active {
	transform: scale(0.98);
}

.cypb-add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.cypb-feedback {
	min-height: 18px;
	font-size: 13px;
	margin: 0;
	color: var(--cypb-ink-soft);
}

.cypb-feedback.is-error {
	color: #b3261e;
}

.cypb-feedback.is-success {
	color: #1e7a3e;
}

/* ---------- Loading overlay ---------- */

.cypb-loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(250, 248, 245, 0.6);
	backdrop-filter: blur(2px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.cypb-loading-overlay.is-visible {
	display: flex;
}

.cypb-spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2.5px solid var(--cypb-line);
	border-top-color: var(--cypb-accent);
	animation: cypb-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.cypb-step,
	.cypb-type-card,
	.cypb-type-card__image,
	.cypb-product-image,
	.cypb-spinner {
		animation: none !important;
		transition: none !important;
	}
}
