/* ==========================================================================
   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-edge: #2e2e2e;       /* colour of the 4D extruded edge */
	--pb-mark: rgba(0, 0, 0, .55);
	--pb-font: 20.5cqw;
	--pb-badge-w: 9.5cqw;
	--pb-radius: .5cqw;       /* square corners: just the slight softening of a real cut plate */
	container-type: inline-size;
	position: relative;
	width: 100%;
	border-radius: var(--pb-radius);
	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;
}
.pb-corner-rounded { --pb-radius: 2.4cqw; }
.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: max(0px, calc(var(--pb-radius) - 1cqw)); pointer-events: none;
}

/* Side badge */
.pb-badge {
	flex: 0 0 var(--pb-badge-w);
	margin: 2.1cqw 0 2.1cqw 2.1cqw;
	border-radius: min(1cqw, var(--pb-radius) + .4cqw);
	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; }

/* Small print along the bottom */
.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: var(--pb-mark);
}

/* ---------- Letter styles ---------- */
/* 3D gel and 5D: a glossy highlight over 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-5d .pb-row::after {
	content: attr(data-text);
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, .14) 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 {
	text-shadow:
		.006em .006em 0 var(--pb-edge),
		.012em .012em 0 var(--pb-edge),
		.018em .018em 0 var(--pb-edge),
		.03em .05em .04em rgba(0, 0, 0, .35);
}
.pb-style-4d-5mm .pb-chars,
.pb-style-5d .pb-chars {
	text-shadow:
		.006em .006em 0 var(--pb-edge),
		.012em .012em 0 var(--pb-edge),
		.018em .018em 0 var(--pb-edge),
		.024em .024em 0 var(--pb-edge),
		.03em .03em 0 var(--pb-edge),
		.045em .07em .05em rgba(0, 0, 0, .38);
}
/* Bevel: 4D with a polished highlight along the top-left edge */
.pb-style-4d-bevel .pb-chars {
	text-shadow:
		-.008em -.008em 0 rgba(255, 255, 255, .7),
		.006em .006em 0 var(--pb-edge),
		.012em .012em 0 var(--pb-edge),
		.018em .018em 0 var(--pb-edge),
		.024em .024em 0 var(--pb-edge),
		.04em .06em .05em rgba(0, 0, 0, .36);
}

/* ---------- Finishes (show plates) ---------- */
.pb-finish-tinted.pb-side-front { background: linear-gradient(170deg, #c9ccd1 0%, #a6aab0 55%, #8b9097 100%); }
.pb-finish-tinted.pb-side-rear  { background: linear-gradient(170deg, #caa21c 0%, #a9850c 55%, #8a6b05 100%); }
.pb-finish-tinted { --pb-mark: rgba(0, 0, 0, .6); }

.pb-finish-retro { background: linear-gradient(170deg, #4a4d52 0%, #26282b 50%, #141516 100%) !important; }
.pb-finish-retro { --pb-ink: #e4e7eb; --pb-edge: #7b8189; --pb-mark: rgba(255, 255, 255, .45); }
.pb-finish-retro::after { background: linear-gradient(160deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 40%); }

/* ---------- Shapes (show plates) ---------- */
/* Hex: angled ends */
.pb-shape-hex {
	border-radius: 0;
	clip-path: polygon(5cqw 0, calc(100% - 5cqw) 0, 100% 50%, calc(100% - 5cqw) 100%, 5cqw 100%, 0 50%);
}
.pb-shape-hex .pb-badge { margin-left: 5.5cqw; }
.pb-shape-hex.pb-border-black .pb-plate-inner::after {
	inset: 0; border: 0; border-radius: 0; background: var(--pb-ink);
	clip-path: polygon(evenodd,
		5.4cqw 1.2cqw, calc(100% - 5.4cqw) 1.2cqw, calc(100% - 1.3cqw) 50%, calc(100% - 5.4cqw) calc(100% - 1.2cqw), 5.4cqw calc(100% - 1.2cqw), 1.3cqw 50%,
		5.8cqw 1.95cqw, calc(100% - 5.8cqw) 1.95cqw, calc(100% - 2.1cqw) 50%, calc(100% - 5.8cqw) calc(100% - 1.95cqw), 5.8cqw calc(100% - 1.95cqw), 2.1cqw 50%);
}

/* Drip: the bottom edge melts into drips (the plate is drawn 30% taller) */
.pb-shape-drip {
	border-radius: var(--pb-radius) var(--pb-radius) 0 0;
	box-shadow: none;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V77H98.2C98.2 82.6 98.1 86.0 96.0 86.0C93.9 86.0 93.8 82.6 93.8 77H90.8C90.8 86.3 90.7 92.0 89.0 92.0C87.3 92.0 87.2 86.3 87.2 77H85.4C85.4 81.3 85.3 84.0 83.0 84.0C80.7 84.0 80.6 81.3 80.6 77H77.6C77.6 88.8 77.5 96.0 76.0 96.0C74.5 96.0 74.4 88.8 74.4 77H72.0C72.0 83.8 71.9 88.0 70.0 88.0C68.1 88.0 68.0 83.8 68.0 77H65.6C65.6 90.6 65.5 99.0 63.0 99.0C60.5 99.0 60.4 90.6 60.4 77H57.7C57.7 82.6 57.6 86.0 56.0 86.0C54.4 86.0 54.3 82.6 54.3 77H52.2C52.2 86.9 52.1 93.0 50.0 93.0C47.9 93.0 47.8 86.9 47.8 77H44.9C44.9 82.0 44.8 85.0 43.0 85.0C41.2 85.0 41.1 82.0 41.1 77H39.5C39.5 89.4 39.4 97.0 37.0 97.0C34.6 97.0 34.5 89.4 34.5 77H31.7C31.7 84.4 31.6 89.0 30.0 89.0C28.4 89.0 28.3 84.4 28.3 77H26.2C26.2 87.5 26.1 94.0 24.0 94.0C21.9 94.0 21.8 87.5 21.8 77H18.8C18.8 82.0 18.7 85.0 17.0 85.0C15.3 85.0 15.2 82.0 15.2 77H13.4C13.4 85.7 13.3 91.0 11.0 91.0C8.7 91.0 8.6 85.7 8.6 77H6.3C6.3 83.2 6.2 87.0 4.5 87.0C2.8 87.0 2.7 83.2 2.7 77H0Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H100V77H98.2C98.2 82.6 98.1 86.0 96.0 86.0C93.9 86.0 93.8 82.6 93.8 77H90.8C90.8 86.3 90.7 92.0 89.0 92.0C87.3 92.0 87.2 86.3 87.2 77H85.4C85.4 81.3 85.3 84.0 83.0 84.0C80.7 84.0 80.6 81.3 80.6 77H77.6C77.6 88.8 77.5 96.0 76.0 96.0C74.5 96.0 74.4 88.8 74.4 77H72.0C72.0 83.8 71.9 88.0 70.0 88.0C68.1 88.0 68.0 83.8 68.0 77H65.6C65.6 90.6 65.5 99.0 63.0 99.0C60.5 99.0 60.4 90.6 60.4 77H57.7C57.7 82.6 57.6 86.0 56.0 86.0C54.4 86.0 54.3 82.6 54.3 77H52.2C52.2 86.9 52.1 93.0 50.0 93.0C47.9 93.0 47.8 86.9 47.8 77H44.9C44.9 82.0 44.8 85.0 43.0 85.0C41.2 85.0 41.1 82.0 41.1 77H39.5C39.5 89.4 39.4 97.0 37.0 97.0C34.6 97.0 34.5 89.4 34.5 77H31.7C31.7 84.4 31.6 89.0 30.0 89.0C28.4 89.0 28.3 84.4 28.3 77H26.2C26.2 87.5 26.1 94.0 24.0 94.0C21.9 94.0 21.8 87.5 21.8 77H18.8C18.8 82.0 18.7 85.0 17.0 85.0C15.3 85.0 15.2 82.0 15.2 77H13.4C13.4 85.7 13.3 91.0 11.0 91.0C8.7 91.0 8.6 85.7 8.6 77H6.3C6.3 83.2 6.2 87.0 4.5 87.0C2.8 87.0 2.7 83.2 2.7 77H0Z'/%3E%3C/svg%3E");
	-webkit-mask-size: 100% 100%; mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.pb-shape-drip .pb-plate-inner { bottom: 23%; }
.pb-shape-drip.pb-lines-1 { --pb-font: 17cqw; }
.pb-shape-drip.pb-lines-2 { --pb-font: 21cqw; }

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

/* ==========================================================================
   Builder layout (dark, black + gold)
   ========================================================================== */
.plate-builder {
	--pb-accent: #ffd000;
	--pb-line: #2a2a2a;
	--pb-card: #141414;
	--pb-card-2: #1b1b1b;
	--pb-text: #f2f2f2;
	--pb-muted: #a3a3a3;
	margin: 0; color: var(--pb-text);
}
.pb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: start; }

.pb-step {
	border: 1px solid var(--pb-line); margin: 0 0 16px; padding: 22px 24px; min-width: 0;
	background: var(--pb-card); border-radius: 6px;
}
/* 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;
	color: var(--pb-text);
}
.pb-step-title + * { clear: both; }
.pb-step-num {
	display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
	background: var(--pb-accent); color: #000; font-size: 19px;
	clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.pb-hint { color: var(--pb-muted); 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 #ff5a5a; }

.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: 1px solid var(--pb-line); border-radius: 4px; background: var(--pb-card-2);
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.pb-option:hover .pb-option-body { border-color: #4a4a4a; }
.pb-option input:checked + .pb-option-body {
	border-color: var(--pb-accent); background: rgba(255, 208, 0, .08);
	box-shadow: inset 0 0 0 1px var(--pb-accent), 0 0 18px rgba(255, 208, 0, .12);
}
.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: .35; cursor: not-allowed; }
.pb-option-label { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--pb-text); }
.pb-option-note { font-size: 13px; color: var(--pb-muted); 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; color: var(--pb-accent); }
.pb-option-tag {
	align-self: flex-start; margin: 2px 0; padding: 1px 7px; border-radius: 3px;
	font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: #000; background: linear-gradient(180deg, #ffe680, #ffc400);
}
.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(255, 255, 255, .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: 8px; scrollbar-width: thin; }
.pb-summary-card {
	background: linear-gradient(180deg, #161616, #0b0b0b); color: #fff; border-radius: 8px; padding: 22px;
	border: 1px solid rgba(255, 208, 0, .55); box-shadow: 0 0 30px rgba(255, 208, 0, .08);
}
.pb-previews {
	display: grid; gap: 16px; padding: 22px 18px; border-radius: 6px;
	background: radial-gradient(circle at 50% 0%, #2b2b2b, #101010 70%);
}
.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: #9a9a9a; 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, .55); }
.pb-preview .pb-shape-drip { box-shadow: none; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .55)); }
.pb-preview .pb-lines-2 { max-width: 62%; }

.pb-breakdown { list-style: none; margin: 18px 0 0; padding: 0; font-size: 14px; color: #c3c3c3; }
.pb-breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #262626; }
.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: #c3c3c3; }
.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: #c3c3c3; 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-confirm [hidden] { display: none; }
.pb-submit { width: 100%; }
.pb-small { text-align: center; font-size: 13px; color: #9a9a9a; margin: 12px 0 0; }

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

/* Thank-you page documents box */
.pb-documents { background: #141414; color: #f2f2f2; border: 1px solid #ffd000; border-radius: 8px; padding: 22px 24px; margin: 0 0 32px; }
.pb-documents h2, .entry-content .pb-documents h2 { margin-top: 0; font-size: 28px; color: #ffd000; }

/* 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(8, 8, 8, .96); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(255, 208, 0, .35);
	}
	.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; }
}
