/* woo_personalize panel on the product page (front.php prints it inside .single_variation_wrap).
   Colours are theme variables only: tools/dark/gen.mjs does not read this file, and it does not
   need to — every variable used here is redefined by css/dark.css. */

.jk-pz[hidden] { display: none !important; }
.jk-pz {
	container-type: inline-size;
	margin: 0 0 20px;
	padding: 20px;
	border-radius: var(--jk-r-panel);
	background: var(--jk-soft);
}
/* Side by side: heading over the fields, the preview centred beside both. Stacked (below):
   heading, preview, fields — the heading names the whole panel, so it comes first.
   The left column stops at 264px: 12 x "W" in the pill font (147px) + its 84px padding = 231px,
   plus ~33px spare. A wider pill only stretched the empty space after the text. The preview keeps
   to the right edge, so the panel's padding stays 20px on every side. */
.jk-pz__in {
	display: grid;
	grid-template-columns: minmax(0, 264px) auto;
	justify-content: space-between;
	grid-template-areas: "title pv" "fields pv";
	align-items: center;
	gap: 12px 20px;
}
.jk-pz__title { grid-area: title; align-self: end; }
.jk-pz__fields { grid-area: fields; align-self: start; }
.jk-pz__pv { grid-area: pv; }

.jk-pz__fields {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
/* Same type as the variation labels above (`th.label label`, measured 2026-12-02: JetBrains Mono
   15px/21px, 500, upper case, --jk-muted). margin needs !important: the theme gives every <p> in
   the form a 15px bottom margin !important. */
form.cart .jk-pz p.jk-pz__title {
	margin: 0 !important;
	padding: 0;
	font-family: var(--jk-font-mono);
	font-size: 15px;
	font-weight: 500;
	line-height: 21px;
	letter-spacing: normal;
	text-transform: uppercase;
	color: var(--jk-muted);
}

.jk-pz__row { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.jk-pz__label {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.jk-pz__field { position: relative; }
/* Selector carries the form + type so it outranks the theme's generic text-input rules. The
   background also needs !important + more weight than the theme's
   `html:root:root input:not(…)x4 { background: var(--jk-field-bg) !important }` (0,6,2): the approved
   look is a WHITE pill (--jk-tile: white, dark tile in dark mode), not the grey field face. */
html:root:root form.cart .jk-pz input.jk-pz__input.jk-pz__input.jk-pz__input[type="text"] { background: var(--jk-tile) !important; }
form.cart .jk-pz input.jk-pz__input[type="text"] {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0 64px 0 20px;
	border: 0;
	border-radius: var(--jk-r-pill, 999px);
	background: var(--jk-tile);
	box-shadow: var(--jk-nm-sunk);
	font-family: var(--jk-pz-font, var(--jk-font-mono));
	font-size: 18px;
	font-weight: 700;
	line-height: 48px;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--jk-ink);
	outline: none;
}
form.cart .jk-pz input.jk-pz__input[type="text"]::placeholder {
	font-family: var(--jk-font-mono);
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: var(--jk-muted);
	opacity: 1;
}
/* Focus: the site's own ring (outline 2px --jk-red, offset 3px) stays as everywhere else.
   Error: a 2px --jk-red ring ON the pill. A field with an error is also the one we focus, and the
   two red rings 3px apart read as one doubled line, so the outline steps aside while the error
   ring shows (still a clear focus mark: the ring + the caret). */
form.cart .jk-pz input.jk-pz__input[type="text"][aria-invalid="true"] {
	box-shadow: var(--jk-nm-sunk), 0 0 0 2px var(--jk-red);
	outline: none !important;
}

.jk-pz__count {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--jk-font-mono);
	font-size: 13px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--jk-muted);
	pointer-events: none;
}

/* margin needs !important: the theme gives every <p> in the form a 15px bottom margin !important. */
form.cart .jk-pz p.jk-pz__err {
	margin: 0 !important;
	padding: 0 20px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--jk-red-text, var(--jk-red));
}
.jk-pz__err[hidden] { display: none !important; }

/* Same width as the fields above it (it sits in their column); `pretty` keeps the last line from
   being one word. */
form.cart .jk-pz p.jk-pz__note {
	margin: 0 !important;
	font-size: 15px;
	line-height: 1.5;
	color: var(--jk-muted);
	text-wrap: pretty;
}

.jk-pz__pv {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
form.cart .jk-pz .jk-pz__cap {
	margin: 0;
	font-family: var(--jk-font-mono);
	font-size: 13px;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--jk-muted);
}

/* Preview on top, centred and bigger, fields below at full width: on phones, AND whenever the
   panel itself is too narrow for fields beside a 190px circle. The test is the panel's width, not
   the screen's: at 1024px the summary column is narrower than on a 481px phone. Measured
   2026-12-02: 12 x "W" in the pill font is 147px + 84px padding = 231px field, + 20px gap + 190px
   circle = 441px of content. The 1440px layout has 452px (side by side, 35px spare in the field);
   481px and 1024px screens have 401px and 363px, and their field scrolled before this rule. */
@container (max-width: 444px) {
	/* Full width here: the preview above is centred, and a 264px column under it would sit off to
	   the left with a ragged gap on the right. */
	.jk-pz__in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "pv" "fields"; }
	/* 12px row gap + 8px = 20px between the preview block and the fields it belongs under. */
	.jk-pz__pv { margin-bottom: 8px; }
	.jk-pz__pv .jk-pz-tv { --jk-pz-size: 220px; }
}
@media (max-width: 480px) {
	.jk-pz { padding: 20px 16px; }
}
