.bb-bespoke-builder {
	--bb-selected-colour: #efe5d4;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 280px),
		var(--bb-bg);
	color: var(--bb-text);
	font-family: var(--bb-font-family);
	font-size: var(--bb-font-size);
	font-weight: var(--bb-body-weight);
	line-height: 1.55;
	padding: clamp(28px, 4vw, 56px) 16px;
}

.bb-bespoke-builder * {
	box-sizing: border-box;
}

.bb-builder-shell {
	margin: 0 auto;
	max-width: 1320px;
}

.bb-builder-hero {
	align-items: flex-end;
	display: flex;
	gap: 24px;
	justify-content: space-between;
	margin: 0 0 28px;
}

.bb-builder-hero h1 {
	color: var(--bb-text);
	font-size: clamp(34px, 4.4vw, 62px);
	font-weight: var(--bb-heading-weight);
	letter-spacing: 0;
	line-height: 1.04;
	margin: 0 0 14px;
	max-width: 760px;
}

.bb-builder-hero p {
	color: var(--bb-muted);
	margin: 0;
	max-width: 710px;
}

.bb-eyebrow {
	color: var(--bb-secondary) !important;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.11em;
	margin: 0 0 10px !important;
	text-transform: uppercase;
}

.bb-trust-strip {
	background: rgba(255, 255, 255, 0.74);
	border: 1px solid rgba(21, 23, 43, 0.12);
	border-radius: var(--bb-radius);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px;
}

.bb-trust-strip span {
	background: rgba(21, 23, 43, 0.06);
	border-radius: calc(var(--bb-radius) - 2px);
	color: var(--bb-text);
	font-size: 0.82rem;
	font-weight: 700;
	padding: 8px 10px;
	white-space: nowrap;
}

.bb-builder-form {
	margin: 0;
}

.bb-field-hidden {
	height: 0 !important;
	left: -9999px !important;
	opacity: 0 !important;
	position: absolute !important;
	width: 0 !important;
}

.bb-builder-grid {
	align-items: start;
	display: grid;
	gap: 22px;
	grid-template-columns: minmax(320px, 0.92fr) minmax(460px, 1.08fr);
}

.bb-preview-panel {
	position: sticky;
	top: 24px;
}

.bb-preview-stage,
.bb-summary-card,
.bb-options-panel,
.bb-step {
	background: var(--bb-surface);
	border: 1px solid rgba(21, 23, 43, 0.1);
	border-radius: var(--bb-radius);
	box-shadow: 0 20px 60px rgba(21, 23, 43, 0.08);
}

.bb-preview-stage {
	overflow: hidden;
}

.bb-preview-room {
	aspect-ratio: 1.18 / 1;
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.28)),
		linear-gradient(180deg, #f8f3eb 0%, #f8f3eb 63%, #dfd2bf 63%, #cdbca5 100%);
	display: grid;
	overflow: hidden;
	place-items: center;
	position: relative;
}

.bb-preview-room::before,
.bb-preview-room::after {
	background: rgba(21, 23, 43, 0.08);
	content: "";
	position: absolute;
}

.bb-preview-room::before {
	height: 1px;
	left: 0;
	right: 0;
	top: 63%;
}

.bb-preview-room::after {
	border-radius: 999px;
	filter: blur(18px);
	height: 22%;
	left: 15%;
	right: 15%;
	top: 70%;
}

.bb-preview-bed {
	height: 66%;
	max-height: 430px;
	max-width: 520px;
	position: relative;
	width: 82%;
	z-index: 2;
}

.bb-preview-headboard {
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.06)),
		var(--bb-selected-colour);
	border: 1px solid rgba(21, 23, 43, 0.16);
	border-radius: var(--bb-radius) var(--bb-radius) 4px 4px;
	box-shadow: inset 0 -18px 36px rgba(21, 23, 43, 0.08);
	height: 54%;
	left: 10%;
	position: absolute;
	top: 4%;
	width: 80%;
}

.bb-preview-headboard::before,
.bb-preview-headboard::after {
	background: rgba(21, 23, 43, 0.09);
	content: "";
	position: absolute;
	top: 0;
}

.bb-preview-headboard::before {
	bottom: 0;
	left: 33%;
	width: 1px;
}

.bb-preview-headboard::after {
	bottom: 0;
	right: 33%;
	width: 1px;
}

.bb-preview-mattress {
	background: linear-gradient(180deg, #fff, #ebe5dc);
	border: 1px solid rgba(21, 23, 43, 0.12);
	border-radius: 10px 10px 4px 4px;
	height: 22%;
	left: 7%;
	position: absolute;
	top: 50%;
	width: 86%;
	z-index: 3;
}

.bb-preview-base {
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.08)),
		var(--bb-selected-colour);
	border: 1px solid rgba(21, 23, 43, 0.15);
	border-radius: 5px;
	height: 19%;
	left: 9%;
	position: absolute;
	top: 68%;
	width: 82%;
	z-index: 2;
}

.bb-preview-base::before,
.bb-preview-base::after {
	background: rgba(21, 23, 43, 0.13);
	border-radius: 2px;
	content: "";
	height: 40%;
	position: absolute;
	top: 30%;
	width: 26%;
}

.bb-preview-base::before {
	left: 13%;
}

.bb-preview-base::after {
	right: 13%;
}

.bb-preview-footboard {
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.17), rgba(0, 0, 0, 0.08)),
		var(--bb-selected-colour);
	border: 1px solid rgba(21, 23, 43, 0.15);
	border-radius: 4px 4px var(--bb-radius) var(--bb-radius);
	bottom: 6%;
	display: none;
	height: 17%;
	left: 12%;
	position: absolute;
	width: 76%;
	z-index: 4;
}

.bb-bespoke-builder.has-footboard .bb-preview-footboard {
	display: block;
}

.bb-preview-shadow {
	background: rgba(21, 23, 43, 0.2);
	border-radius: 999px;
	bottom: 1%;
	filter: blur(18px);
	height: 10%;
	left: 10%;
	position: absolute;
	right: 10%;
	z-index: 1;
}

.bb-preview-caption {
	align-items: center;
	display: flex;
	justify-content: space-between;
	padding: 16px 18px;
}

.bb-preview-caption strong {
	color: var(--bb-text);
	font-size: 1rem;
	font-weight: var(--bb-heading-weight);
}

.bb-preview-caption span {
	color: var(--bb-muted);
	font-size: 0.92rem;
	font-weight: 700;
}

.bb-summary-card {
	margin-top: 16px;
	padding: 20px;
}

.bb-summary-card h2 {
	color: var(--bb-text);
	font-size: 1.25rem;
	font-weight: var(--bb-heading-weight);
	margin: 0 0 14px;
}

.bb-summary-card dl {
	display: grid;
	gap: 10px;
	margin: 0;
}

.bb-summary-card dl div {
	align-items: baseline;
	border-bottom: 1px solid rgba(21, 23, 43, 0.08);
	display: flex;
	justify-content: space-between;
	padding-bottom: 9px;
}

.bb-summary-card dt {
	color: var(--bb-muted);
	font-size: 0.86rem;
	margin: 0;
}

.bb-summary-card dd {
	color: var(--bb-text);
	font-weight: 800;
	margin: 0 0 0 18px;
	text-align: right;
}

.bb-summary-card p {
	background: rgba(185, 151, 91, 0.12);
	border-left: 3px solid var(--bb-secondary);
	color: var(--bb-text);
	font-size: 0.9rem;
	margin: 16px 0 0;
	padding: 10px 12px;
}

.bb-options-panel {
	padding: 16px;
}

.bb-step {
	box-shadow: none;
	margin-bottom: 14px;
	padding: 18px;
}

.bb-step-heading {
	align-items: center;
	display: flex;
	gap: 11px;
	margin-bottom: 14px;
}

.bb-step-heading span {
	align-items: center;
	background: var(--bb-accent);
	border-radius: 999px;
	color: var(--bb-button-text);
	display: inline-flex;
	flex: 0 0 30px;
	font-size: 0.85rem;
	font-weight: 800;
	height: 30px;
	justify-content: center;
	width: 30px;
}

.bb-step-heading h2 {
	color: var(--bb-text);
	font-size: 1.08rem;
	font-weight: var(--bb-heading-weight);
	line-height: 1.25;
	margin: 0;
}

.bb-choice-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bb-choice,
.bb-swatch {
	appearance: none;
	background: #fff;
	border: 1px solid rgba(21, 23, 43, 0.15);
	border-radius: calc(var(--bb-radius) - 2px);
	color: var(--bb-text);
	cursor: pointer;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	min-height: 48px;
	padding: 11px 12px;
	text-align: left;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
	width: 100%;
}

.bb-choice:hover,
.bb-choice:focus-visible,
.bb-swatch:hover,
.bb-swatch:focus-visible {
	border-color: var(--bb-secondary);
	box-shadow: 0 12px 30px rgba(21, 23, 43, 0.09);
	outline: none;
	transform: translateY(-1px);
}

.bb-choice.is-selected,
.bb-swatch.is-selected {
	border-color: var(--bb-accent);
	box-shadow: inset 0 0 0 1px var(--bb-accent), 0 12px 26px rgba(21, 23, 43, 0.1);
}

.bb-custom-dimensions {
	display: none;
	margin: -4px 0 14px;
}

.bb-custom-dimensions.is-open {
	display: block;
}

.bb-field-pair,
.bb-field-grid,
.bb-custom-colour {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 14px;
}

.bb-field-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bb-bespoke-builder label {
	color: var(--bb-text);
	display: grid;
	font-weight: 800;
	gap: 7px;
}

.bb-bespoke-builder label span {
	font-size: 0.9rem;
}

.bb-bespoke-builder input,
.bb-bespoke-builder textarea {
	background: #fff;
	border: 1px solid rgba(21, 23, 43, 0.15);
	border-radius: calc(var(--bb-radius) - 2px);
	color: var(--bb-text);
	font: inherit;
	font-size: 0.96rem;
	min-height: 46px;
	padding: 11px 12px;
	width: 100%;
}

.bb-bespoke-builder input:focus,
.bb-bespoke-builder textarea:focus {
	border-color: var(--bb-secondary);
	box-shadow: 0 0 0 3px rgba(185, 151, 91, 0.16);
	outline: none;
}

.bb-bespoke-builder textarea {
	resize: vertical;
}

.bb-colour-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 14px;
}

.bb-swatch {
	display: grid;
	gap: 8px;
	min-height: 84px;
	padding: 10px;
	text-align: center;
}

.bb-swatch span {
	border: 1px solid rgba(21, 23, 43, 0.14);
	border-radius: 999px;
	box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.24);
	height: 34px;
	justify-self: center;
	width: 34px;
}

.bb-swatch small {
	color: var(--bb-text);
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1.2;
}

.bb-custom-colour {
	background: rgba(21, 23, 43, 0.04);
	border-radius: calc(var(--bb-radius) - 2px);
	margin-bottom: 0;
	padding: 12px;
}

.bb-custom-colour input[type="color"] {
	cursor: pointer;
	padding: 5px;
}

.bb-full-field {
	margin-top: 12px;
}

.bb-submit-row {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	padding: 6px 2px 2px;
}

.bb-submit-button {
	appearance: none;
	background: linear-gradient(135deg, var(--bb-accent), #242746);
	border: 0;
	border-radius: var(--bb-radius);
	box-shadow: 0 18px 36px rgba(21, 23, 43, 0.22);
	color: var(--bb-button-text);
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	min-height: 54px;
	padding: 14px 24px;
	transition: filter 160ms ease, transform 160ms ease;
	white-space: normal;
}

.bb-submit-button:hover,
.bb-submit-button:focus-visible {
	filter: brightness(1.06);
	outline: none;
	transform: translateY(-1px);
}

.bb-submit-button:disabled {
	cursor: wait;
	filter: grayscale(0.25);
	opacity: 0.78;
}

.bb-submit-row p {
	color: var(--bb-muted);
	font-size: 0.9rem;
	margin: 0;
	max-width: 310px;
}

.bb-form-message {
	border-radius: calc(var(--bb-radius) - 2px);
	font-weight: 800;
	margin-top: 14px;
	padding: 0;
}

.bb-form-message.is-success,
.bb-form-message.is-error {
	padding: 12px 14px;
}

.bb-form-message.is-success {
	background: rgba(32, 90, 62, 0.1);
	color: #205a3e;
}

.bb-form-message.is-error {
	background: rgba(156, 35, 35, 0.1);
	color: #9c2323;
}

@media (max-width: 1060px) {
	.bb-builder-hero,
	.bb-builder-grid {
		display: block;
	}

	.bb-trust-strip {
		margin-top: 18px;
	}

	.bb-preview-panel {
		margin-bottom: 18px;
		position: static;
	}
}

@media (max-width: 720px) {
	.bb-bespoke-builder {
		padding: 24px 12px;
	}

	.bb-builder-hero h1 {
		font-size: 34px;
	}

	.bb-choice-grid,
	.bb-colour-grid,
	.bb-field-pair,
	.bb-field-grid,
	.bb-custom-colour {
		grid-template-columns: 1fr;
	}

	.bb-options-panel,
	.bb-step {
		padding: 14px;
	}

	.bb-submit-row {
		align-items: stretch;
		display: grid;
	}

	.bb-submit-button {
		width: 100%;
	}

	.bb-summary-card dl div {
		align-items: flex-start;
		display: grid;
		gap: 2px;
	}

	.bb-summary-card dd {
		margin-left: 0;
		text-align: left;
	}
}

/* ===== Bed type icons in choice buttons ===== */
.bb-choice--icon {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 8px;
	justify-content: center;
	min-height: 92px;
	text-align: center;
}

.bb-choice-icon {
	align-items: center;
	color: var(--bb-muted);
	display: inline-flex;
	height: 34px;
	justify-content: center;
	transition: color 160ms ease, transform 160ms ease;
	width: 56px;
}

.bb-choice-icon svg {
	height: 100%;
	width: 100%;
}

.bb-choice--icon .bb-choice-label {
	font-size: 0.86rem;
	line-height: 1.2;
}

.bb-choice--icon:hover .bb-choice-icon,
.bb-choice--icon:focus-visible .bb-choice-icon {
	color: var(--bb-secondary);
	transform: translateY(-1px);
}

.bb-choice--icon.is-selected .bb-choice-icon {
	color: var(--bb-accent);
}

/* ===== SVG live preview ===== */
.bb-preview-svg {
	display: block;
	height: auto;
	margin: 0 auto;
	max-width: 86%;
	width: 86%;
	z-index: 2;
}

.bb-preview-svg-body {
	transition: opacity 200ms ease;
}
