/* ==========================================================================
   Plate Builder — plate preview + builder layout
   Plate sizes use container query units (cqw = 1% of the plate's width),
   so a plate looks the same at any size.
   ========================================================================== */

/* ---------- The plate ---------- */
.pb-plate {
	--pb-ink: #111;
	--pb-font: 20.5cqw;
	--pb-badge-w: 9.5cqw;
	container-type: inline-size;
	position: relative;
	width: 100%;
	border-radius: 2.2cqw;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 255, 255, .4) inset;
	user-select: none;
	transition: aspect-ratio .25s ease;
}
.pb-plate-inner { position: absolute; inset: 0; display: flex; align-items: stretch; }

.pb-side-front { background: linear-gradient(170deg, #ffffff 0%, #f4f4f2 55%, #e9e9e6 100%); }
.pb-side-rear  { background: linear-gradient(170deg, #ffdb3d 0%, #fcd116 55%, #f2c200 100%); }

/* Gloss sheen across the whole plate */
.pb-plate::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(160deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 38%);
}

/* Border */
.pb-border-black .pb-plate-inner::after {
	content: ""; position: absolute; inset: 1.2cqw; border: .75cqw solid var(--pb-ink); border-radius: 1.4cqw; pointer-events: none;
}

/* Side badge */
.pb-badge {
	flex: 0 0 var(--pb-badge-w);
	margin: 2.1cqw 0 2.1cqw 2.1cqw;
	border-radius: 1cqw;
	background: #0a47a5;
	color: #fff;
	display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
	padding: 1cqw .6cqw;
	position: relative; z-index: 1;
}
.pb-badge[hidden] { display: none; }
.pb-flag { display: block; width: 100%; line-height: 0; }
.pb-flag:empty { display: none; }
.pb-flag svg { width: 100%; height: auto; border-radius: .3cqw; }
.pb-code { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 3.6cqw; line-height: 1; letter-spacing: .02em; }
.pb-badge-plain-uk .pb-code { font-size: 4.6cqw; }

/* Characters */
.pb-chars {
	flex: 1 1 auto; min-width: 0;
	display: flex; align-items: center; justify-content: center; gap: .32em;
	font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
	font-weight: 700;
	font-size: var(--pb-font);
	line-height: 1;
	letter-spacing: .035em;
	color: var(--pb-ink);
	white-space: nowrap;
	padding-bottom: 2.4cqw; /* room for the supplier mark */
	position: relative; z-index: 1;
}
.pb-row { position: relative; display: block; }
.pb-row:empty { display: none; }

/* Two-line plates (square, motorcycle) */
.pb-lines-2 { --pb-font: 27cqw; --pb-badge-w: 13cqw; }
.pb-lines-2 .pb-chars { flex-direction: column; gap: .02em; line-height: .95; padding-bottom: 4cqw; }
.pb-lines-2 .pb-code { font-size: 5.4cqw; }
.pb-lines-2 .pb-mark { font-size: 2.6cqw; }
.pb-size-large { --pb-font: 21cqw; }
/* Leave room for the side badge on one-line plates */
.pb-lines-1:not(.pb-badge-none) { --pb-font: 18.5cqw; }

/* Supplier mark (BS AU 145e) */
.pb-mark {
	position: absolute; left: 0; right: 0; bottom: 1.6cqw; z-index: 1;
	text-align: center; font-family: "Inter", Arial, sans-serif; font-size: 1.45cqw; font-weight: 600;
	letter-spacing: .04em; text-transform: uppercase; color: rgba(0, 0, 0, .55);
}

/* ---------- Plate styles ---------- */
/* 3D gel: domed resin — soft shadow plus a glossy highlight on each character */
.pb-style-3d-gel .pb-chars { text-shadow: 0 .012em .01em rgba(0, 0, 0, .55), 0 .03em .04em rgba(0, 0, 0, .3); }
.pb-style-3d-gel .pb-row::after,
.pb-style-4d-gel .pb-row::after {
	content: attr(data-text);
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .12) 30%, rgba(255, 255, 255, 0) 52%);
	-webkit-background-clip: text; background-clip: text;
	color: transparent; text-shadow: none;
	pointer-events: none;
}

/* 4D: laser-cut acrylic — a hard extruded edge, then a cast shadow */
.pb-style-4d-3mm .pb-chars,
.pb-style-4d-gel .pb-chars {
	text-shadow:
		.006em .006em 0 #3a3a3a,
		.012em .012em 0 #333,
		.018em .018em 0 #2b2b2b,
		.03em .05em .04em rgba(0, 0, 0, .35);
}
.pb-style-4d-5mm .pb-chars {
	text-shadow:
		.006em .006em 0 #3c3c3c,
		.012em .012em 0 #363636,
		.018em .018em 0 #303030,
		.024em .024em 0 #2a2a2a,
		.03em .03em 0 #242424,
		.045em .07em .05em rgba(0, 0, 0, .38);
}

.pb-preview-inline { max-width: 520px; }

/* ==========================================================================
   Builder layout
   ========================================================================== */
.plate-builder { --pb-accent: #ffd21f; --pb-line: #e3e0d6; margin: 0; }
.pb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: start; }

.pb-step { border: 0; margin: 0 0 18px; padding: 24px; background: #fff; border-radius: 14px; border: 1px solid var(--pb-line); min-width: 0; }
/* float + width keeps the legend inside the box instead of on its border */
.pb-step-title {
	float: left; width: 100%;
	display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 14px;
	font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 26px; text-transform: uppercase; letter-spacing: .02em;
}
.pb-step-num {
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
	background: #0e1013; color: var(--pb-accent); font-size: 20px; flex: 0 0 auto;
}
.pb-step-title + * { clear: both; }
.pb-hint { color: #5d6470; font-size: 14px; margin: -4px 0 14px; }
.pb-step .reg-input { width: 100%; max-width: 420px; display: block; margin-bottom: 12px; }
.pb-step .reg-input:invalid:not(:placeholder-shown) { box-shadow: 0 0 0 2px #d63638; }

.pb-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.pb-option { position: relative; cursor: pointer; display: block; }
.pb-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pb-option-body {
	display: flex; flex-direction: column; gap: 3px; height: 100%;
	padding: 14px 14px 12px; border: 2px solid var(--pb-line); border-radius: 10px; background: #fbfaf7;
	transition: border-color .15s ease, background .15s ease;
}
.pb-option:hover .pb-option-body { border-color: #c9c4b5; }
.pb-option input:checked + .pb-option-body { border-color: #0e1013; background: #fff8d6; box-shadow: inset 0 0 0 1px #0e1013; }
.pb-option input:focus-visible + .pb-option-body { outline: 3px solid var(--pb-accent); outline-offset: 2px; }
.pb-option input:disabled + .pb-option-body { opacity: .4; cursor: not-allowed; }
.pb-option-label { font-weight: 700; font-size: 15px; line-height: 1.25; }
.pb-option-note { font-size: 13px; color: #5d6470; line-height: 1.35; }
.pb-option-price { margin-top: auto; padding-top: 6px; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 19px; }
.pb-option-flag { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; height: 20px; }
.pb-option-flag svg { width: 32px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.pb-option-flag b { font-family: "Barlow Condensed", sans-serif; font-size: 16px; }

/* Summary column */
/* Sticky, but never taller than the screen, so "Add to basket" is always reachable */
.pb-summary { position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto; border-radius: 16px; scrollbar-width: thin; }
.pb-summary-card { background: #0e1013; color: #fff; border-radius: 16px; padding: 22px; }
.pb-previews { display: grid; gap: 16px; padding: 22px 18px; background: radial-gradient(circle at 50% 0%, #2a2f38, #15181d 70%); border-radius: 12px; }
.pb-preview { position: relative; transition: opacity .2s ease; }
.pb-preview.is-off { opacity: .22; }
.pb-preview-label {
	display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 13px;
	letter-spacing: .14em; text-transform: uppercase; color: #9aa1ac; margin-bottom: 6px;
}
.pb-preview .pb-plate { margin: 0 auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 14px 26px rgba(0, 0, 0, .45); }
.pb-preview .pb-lines-2 { max-width: 62%; }

.pb-breakdown { list-style: none; margin: 18px 0 0; padding: 0; font-size: 14px; color: #c3c8d0; }
.pb-breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #262a31; }
.pb-total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 16px; }
.pb-total-row span { font-family: "Barlow Condensed", sans-serif; font-size: 20px; text-transform: uppercase; letter-spacing: .06em; color: #c3c8d0; }
.pb-total { font-family: "Barlow Condensed", sans-serif; font-size: 44px; color: var(--pb-accent); line-height: 1; }

.pb-confirm { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #c3c8d0; line-height: 1.45; margin-bottom: 16px; cursor: pointer; }
.pb-confirm input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--pb-accent); flex: 0 0 auto; }
.pb-submit { width: 100%; }
.pb-small { text-align: center; font-size: 13px; color: #9aa1ac; margin: 12px 0 0; }

.pb-notices { max-width: 1180px; }
.pb-notices:empty { display: none; }

/* Thank-you page documents box */
.pb-documents { background: #fff8d6; border: 2px solid #0e1013; border-radius: 14px; padding: 22px 24px; margin: 0 0 32px; }
.pb-documents h2, .entry-content .pb-documents h2 { margin-top: 0; font-size: 28px; }

/* Compact sticky preview, phones and tablets only */
.pb-mini { display: none; }

@media (max-width: 980px) {
	.pb-layout { grid-template-columns: 1fr; }
	.pb-summary { position: static; max-height: none; overflow: visible; scroll-margin-top: 90px; }
	.pb-mini {
		display: flex; align-items: center; gap: 12px;
		position: sticky; top: 72px; z-index: 5;
		margin: 0 calc(var(--gutter, 16px) * -1) 16px; padding: 10px var(--gutter, 16px);
		background: rgba(14, 16, 19, .96); backdrop-filter: blur(6px);
	}
	.pb-mini-plate { flex: 1 1 auto; max-width: 300px; }
	.pb-mini-plate .pb-lines-2 { max-width: 90px; }
	.pb-mini-total {
		margin-left: auto; text-decoration: none; white-space: nowrap;
		font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 24px; color: var(--pb-accent);
	}
}
@media (max-width: 600px) {
	.pb-step { padding: 18px 16px; }
	.pb-options { grid-template-columns: 1fr 1fr; }
	.pb-summary-card { padding: 16px; }
}
