/**
 * ZAI COFFEE â€” Single product
 * -----------------------------------------------------------------------------
 * Product detail page only. Loaded conditionally (see inc/assets.php).
 *
 * The layout is produced by re-ordering WooCommerce's native summary hooks, so
 * every selector here styles markup WooCommerce itself emits. Nothing in this
 * file depends on a template override.
 *
 * All values resolve through tokens from 01-tokens.css.
 *
 * @package zaicoffeetheme
 * @since   1.2.0
 */

/* ==========================================================================
   1. Shell and two-column composition
   -----------------------------------------------------------------------------
   Phase 8.1 â€” the owner's screenshot showed a SMALL gallery and a NARROW summary
   with a lot of dead space. The cause was the parent, not the children:
   `div.product` had no max-width of its own (it inherited a narrow container) and
   the tracks were 11fr/9fr from only 1024px up, so at 1440px the summary column
   ended up around 380px and the gallery was capped by the container.

   FIX at the PARENT level:
     - A premium product container up to 1440px, centred.
     - `minmax(0, 1.1fr) minmax(0, 0.9fr)` => â‰ˆ55% gallery / â‰ˆ45% summary.
     - Gap scales 64 â†’ 88px with the viewport.
     - The summary gets an explicit `min-width` floor on large desktops so it can
       never be squeezed below a comfortable reading measure.
     - WooCommerce's floated, percentage-width children are neutralised.

   Every track uses `minmax(0, â€¦)` so a long word, a variation table or a price row
   can never force the grid wider than the viewport.
   ========================================================================== */

div.product {
	/* Slightly wider than the standard container: a product page earns it. */
	max-width: min(1440px, 100%);
	margin-inline: auto;
	padding-block: var(--zai-space-7) 0;
	min-width: 0;
}

/*
 * PHASE 8.2 â€” the gallery/summary pair never actually adopted the theme grid.
 *
 * Measured on /urun/brezilya-turk-kahvesi/ at a 1440px viewport: the gallery
 * stage was only ~276px wide while ~400px of the row sat empty. WooCommerce's
 * own woocommerce-layout.css declares
 *
 *   .woocommerce div.product div.images  { float:left;  width:48% }
 *   .woocommerce div.product div.summary { float:right; width:48% }
 *
 * Those percentage widths are what the browser was honouring, so the pair
 * rendered as two floated half-boxes inside the grid container instead of as
 * two grid tracks. The gallery was then further narrowed by object-fit:cover on
 * a 4:5 stage, making the illustrated package look small.
 *
 * These resets are declared at the SAME specificity WooCommerce uses
 * (.woocommerce div.product div.images => 0,3,2) but load later, so no
 * !important is needed and none is used.
 */
.woocommerce div.product div.images,
.woocommerce-page div.product div.images,
.woocommerce #content div.product div.images,
.woocommerce-page #content div.product div.images,
div.product div.images {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	min-width: 0;
}

.woocommerce div.product div.summary,
.woocommerce-page div.product div.summary,
.woocommerce #content div.product div.summary,
.woocommerce-page #content div.product div.summary,
div.product div.summary {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	min-width: 0;
}

/*
 * PHASE 8.2 â€” the two-column split starts at 1024px, not 768px.
 *
 * At 768px a 50/50 split left the gallery with ~336px and the summary with the
 * same, which re-created the "small image / narrow summary" complaint at tablet
 * width. Below 1024px the pair now stacks: gallery first, information
 * underneath, exactly as the mobile requirement specifies.
 */
@media (min-width: 1024px) {
	div.product {
		display: grid;
		/*
		 * PHASE 9 â€” a closer split than 1.1fr / 0.9fr.
		 *
		 * The purchase column no longer holds the ten-row specification panel
		 * (it moved into the "ÃœrÃ¼n Ã–zellikleri" tab), so it no longer needs the
		 * extra width that panel demanded to stay readable. ~51% / ~49% keeps
		 * the packaging large while letting the purchase information breathe
		 * instead of wrapping.
		 */
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
		/* 40 â†’ 56px. Tighter than Phase 8.1's 64 â†’ 88px. */
		gap: clamp(2.5rem, 3.4vw, 3.5rem);
		align-items: start;
	}

	/* Gallery left, summary right. */
	div.product div.images {
		grid-column: 1;
		grid-row: 1;
	}

	div.product div.summary {
		grid-column: 2;
		grid-row: 1;
		/*
		 * A reading-width floor so the summary can never be squeezed into the
		 * narrow column that produced the owner's "unbalanced gallery and
		 * information columns" screenshot.
		 */
		min-width: 22rem;
	}

	/*
	 * PHASE 9.1 â€” the summary spans BOTH left-column rows.
	 *
	 * This is what lets the green highlights plate sit directly beneath the
	 * gallery instead of beneath the entire two-column section. With the summary
	 * confined to row 1, row 1's height would be max(gallery, summary) â€” and the
	 * summary is the taller of the two, so the plate would start below the
	 * summary's bottom edge and leave a tall empty band under the image (the very
	 * defect Phase 9 removed).
	 *
	 * Spanning instead makes the row heights depend on the LEFT column alone:
	 *   row 1 = gallery height, row 2 = plate height.
	 * The summary then flows down both rows at its own natural height. Measured on
	 * this catalogue the summary (â‰ˆ880px) is shorter than gallery + plate
	 * (â‰ˆ670 + 280 = 950px), so there is no spanning overflow to distribute and the
	 * plate lands immediately under the image. If a future product has a much
	 * longer summary, the surplus is shared between the two rows rather than
	 * dumped into a single gap.
	 */
	div.product div.summary {
		grid-row: 1 / span 2;
	}

	/* Tabs and cross-sells span the full width below the pair. */
	div.product .woocommerce-tabs,
	div.product .related,
	div.product .up-sells,
	div.product .zai-single__cross-sells {
		grid-column: 1 / -1;
	}
}

/* Very wide screens: keep the pair from over-stretching on a 1728px display. */
@media (min-width: 1600px) {
	div.product {
		grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
	}
}

/* ==========================================================================
   1b. Single product breadcrumb
   -----------------------------------------------------------------------------
   The trail is rendered by the SAME shared component the shop archive uses
   (zai_the_woocommerce_breadcrumbs() in inc/woocommerce/breadcrumbs.php), so
   font family, font size, muted colour, hover behaviour and semantic
   accessibility come from the component in 06-site.css and are identical by
   construction.

   Only TWO things are declared here, and only for the product modifier:

     1. The hairline separator. 10-shop.css owns the `.zai-breadcrumbs__sep`
        geometry, but that sheet is gated to product archives and is not loaded
        on a product page, so the span would collapse to zero width and the
        crumbs would run together.

     2. The vertical rhythm. The product page carries no `.zai-shop` padding
        (that sheet is archive-only), so the trail needs the same 40px measured
        from the header that the shop gets for free. The bottom gap is
        deliberately 0: `div.product` already opens with `--zai-space-7` of its
        own padding, and adding a margin here would stack a second gap â€”
        exactly the artificial spacing this correction removes.
   ========================================================================== */

.zai-breadcrumbs--product {
	margin-block: var(--zai-space-7) 0;
}

/* WooCommerce emits this delimiter span between trail items. */
.zai-breadcrumbs--product .zai-breadcrumbs__sep {
	display: inline-block;
	width: 0.75rem;
	height: 1px;
	background-color: var(--zai-border-color-strong);
	vertical-align: middle;
}

/* ==========================================================================
   2. Gallery
   -----------------------------------------------------------------------------
   Native WooCommerce markup. Slider, zoom and lightbox are enabled through
   add_theme_support in inc/theme-setup.php, so WooCommerce's own scripts stay
   in charge of behaviour â€” only presentation is styled here.
   ========================================================================== */

div.product div.images {
	position: relative;
}

/*
 * PHASE 8.8 â€” NATURAL STAGE HEIGHT.
 *
 * The stage previously carried `aspect-ratio: var(--zai-ratio-product)` (4:5),
 * and every level below it forced `height: 100%` with `object-fit: contain`.
 * Any attachment whose own ratio is not exactly 4:5 was therefore letterboxed
 * inside that fixed-height surface, which is what produced the empty horizontal
 * bands above and below the package.
 *
 * The stage now has no height of its own. It is a plain clipped surface whose
 * height is derived from the image it contains: no padding, no margin, no
 * spacer, no fixed height and no registered ratio.
 */
div.product div.images .woocommerce-product-gallery__wrapper {
	position: relative;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: var(--zai-radius);
}

/*
 * PHASE 9 â€” A LARGER STAGE, STILL UNCROPPED.
 *
 * The packaging is 1199Ã—1312 (ratio â‰ˆ0.914), so in a ~51% column the image is
 * roughly as tall as it is wide and the gallery column ends far above the
 * purchase column. Two rules keep the pair balanced without touching the
 * image itself:
 *
 *   1. The stage keeps its natural height â€” `height: auto` everywhere below,
 *      no `aspect-ratio`, no `object-fit`, so nothing is ever cropped,
 *      letterboxed or stretched.
 *   2. On wide viewports the stage is capped at 34rem and centred, which stops
 *      a 1728px display from producing a 700px-tall image next to a 500px
 *      purchase panel. The cap only ever SHRINKS the column, so the natural
 *      ratio is preserved at every size.
 */
div.product div.images .woocommerce-product-gallery__image {
	overflow: hidden;
	width: 100%;
	height: auto;
}

div.product div.images .woocommerce-product-gallery__image > a {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * PHASE 8.8 â€” NATURAL FIT.
 *
 * Phase 8.6 kept the complete composition visible with `object-fit: contain`,
 * but the stage still imposed the 4:5 `--zai-ratio-product` box, so any image
 * that was not exactly 4:5 was letterboxed and the empty surface appeared as
 * horizontal bands above and below the product.
 *
 * The image now defines the height of the gallery instead of being forced into
 * a ratio: `width: 100%` + `height: auto` + `display: block` keeps the source
 * aspect ratio, never crops and never stretches, and needs no `object-fit`.
 * The ORIGINAL attachment is untouched and is still what the zoom and PhotoSwipe
 * handlers open (they read `data-large_image`).
 */
:root {
	--zai-gallery-image-zoom: 1;
}

div.product div.images img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	/* Natural size: the custom property resolves to 1 (see above). */
	transform: scale(var(--zai-gallery-image-zoom));
	transform-origin: center center;
	image-rendering: auto;
	backface-visibility: hidden;
}


/*
 * `flex-viewport` (the slider wrapper FlexSlider injects) must not collapse the
 * stage. It takes its height from the slide it holds â€” no registered ratio, so
 * it can never be taller than the image.
 */
div.product div.images .flex-viewport {
	overflow: hidden;
	height: auto;
}

/*
 * IMPORTANT: the zoom must apply ONLY to the main single-product stage.
 * WooCommerce reuses `.woocommerce-product-gallery__image` inside the lightbox
 * (PhotoSwipe) and the carousel thumbs; those must show the unmodified image.
 */
.pswp img,
div.product div.images .flex-control-thumbs img,
.zai-product-card__image {
	transform: none;
}

/*
 * Accessibility: honour a reduced-motion preference by keeping the crop static.
 * The zoom itself is not motion, but the hover transition on the stage is
 * irrelevant here, so nothing animates.
 */
@media (prefers-reduced-motion: reduce) {
	div.product div.images img {
		transition: none;
	}
}

/* Thumbnails: one row that scrolls horizontally instead of wrapping. */
div.product div.images .flex-control-thumbs {
	display: flex;
	gap: var(--zai-space-2);
	margin: var(--zai-space-3) 0 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: thin;
}

div.product div.images .flex-control-thumbs li {
	float: none;
	flex: 0 0 auto;
	width: 5rem;
	margin: 0;
}

div.product div.images .flex-control-thumbs img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border: var(--zai-border-width) solid transparent;
	border-radius: var(--zai-radius);
	opacity: 0.65;
	cursor: pointer;
	transition: opacity var(--zai-dur-fast) var(--zai-ease);
}

div.product div.images .flex-control-thumbs img:hover,
div.product div.images .flex-control-thumbs img.flex-active {
	opacity: 1;
	border-color: var(--zai-ink);
}

/* Sale flash anchored like the archive card badge. */
div.product div.images .onsale {
	position: absolute;
	inset-block-start: var(--zai-space-3);
	inset-inline-start: var(--zai-space-3);
	z-index: var(--zai-z-raised);
}

/* ==========================================================================
   3. Summary typography
   ========================================================================== */

.zai-single__category {
	margin: 0 0 var(--zai-space-2);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-medium);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
}

.zai-single__category a {
	color: var(--zai-text-subtle);
	text-decoration: none;
}

.zai-single__category a:hover {
	color: var(--zai-green);
}

div.product .product_title {
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-display);
	font-size: var(--zai-fs-h2);
	font-weight: var(--zai-fw-light);
	line-height: var(--zai-lh-tight);
	letter-spacing: var(--zai-ls-tighter);
	color: var(--zai-ink);
	text-wrap: balance;
}

div.product .summary .price {
	display: block;
	margin: 0 0 var(--zai-space-5);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-lg);
	font-weight: var(--zai-fw-medium);
	font-variant-numeric: tabular-nums;
	color: var(--zai-ink);
}

div.product .summary .price del {
	color: var(--zai-text-subtle);
	font-weight: var(--zai-fw-regular);
	text-decoration-thickness: 1px;
}

div.product .summary .price ins {
	color: var(--zai-green);
	font-weight: var(--zai-fw-semibold);
	text-decoration: none;
}

div.product .woocommerce-product-details__short-description {
	margin-block-end: var(--zai-space-5);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-base);
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text-muted);
}

div.product .woocommerce-product-details__short-description p:last-child {
	margin-block-end: 0;
}

/* ==========================================================================
   3b. Coffee profile panel â€” "Kahve Profili"
   -----------------------------------------------------------------------------
   Three equal cards mirroring the ZAI packaging treatment: altitude (mountain),
   tasting profile (coffee bean), drinking experience (coffee cup).

   The card count comes from REAL data, so the grid adapts: a 2-card set renders
   two-up, a 3-card set renders three-up. No empty cell is ever produced, and a
   product without sufficient attributes renders no panel at all.
   ========================================================================== */

.zai-profile {
	/* PHASE 9: 24px â†’ 20px, and the inner panel is now compact. */
	margin-block: var(--zai-space-5);
	padding-block-start: var(--zai-space-4);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color);
}

/*
 * PHASE 9 â€” COMPACT PROFILE CARDS.
 *
 * The panel sits in the purchase column, between the short description and the
 * add-to-cart block, so its height is decision-relevant. The cards keep the
 * packaging treatment (icon, caps label, value) but shed the vertical padding
 * that made three small facts occupy a tall band: 16px â†’ 12px block padding,
 * a 44px icon well and a tighter gap.
 */
.zai-profile__title {
	margin: 0 0 var(--zai-space-2);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-semibold);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	color: var(--zai-text-subtle);
}

.zai-profile__grid {
	display: grid;
	gap: var(--zai-space-2);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Three cards share one row once there is room for three readable columns. */
@media (min-width: 480px) {
	.zai-profile__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	/* A two-card set stays two-up; three columns would leave a gap. */
	.zai-profile--2 .zai-profile__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/*
 * PHASE 9.1 â€” A REFINED TASTING PANEL.
 *
 * The cards previously set every value at --zai-fs-sm (15px) with weight 500 in
 * full Anthracite. For a one-line value like "YumuÅŸak" that reads fine, but the
 * tasting-note card holds a long comma-separated list â€” in this catalogue up to
 * 75 characters, e.g. "KÄ±rmÄ±zÄ± Meyve, Tropikal Meyve, Kakao, Bal Karamel,
 * Åeftali (TaÅŸ Meyve)" â€” and at 15px/500/dark it turned into a heavy block of
 * text that overpowered the panel.
 *
 * The value type is therefore reduced to a tasting-menu register: 13.5px at
 * weight 400, a 1.5 line-height and the muted body colour, with the three cards
 * still sharing equal height and a common baseline.
 */
.zai-profile__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--zai-space-1);
	min-width: 0;
	padding: var(--zai-space-3) var(--zai-space-2);
	/* LÃ¼letaÅŸÄ± surface with a hairline border: premium, not boxy. */
	background-color: var(--zai-surface);
	border: var(--zai-border-width) solid var(--zai-border-color);
	border-radius: var(--zai-radius);
	text-align: center;
	/* Equal heights without a fixed one, so a longer note grows all three. */
	height: 100%;
}

.zai-profile__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	/* PHASE 9: 44px â†’ 32px well, so three cards fit comfortably in one row. */
	color: var(--zai-green);
}

/* 22px: still reads as a symbol rather than a bullet at the compact size. */
.zai-profile__icon svg {
	width: 22px;
	height: 22px;
}

.zai-profile__label {
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-semibold);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	color: var(--zai-text-subtle);
}

.zai-profile__value {
	font-family: var(--zai-font-body);
	/*
	 * 13.5px on desktop (13.12 â†’ 13.5 across the clamp range), the requested
	 * 13â€“14px band. Weight 400 and the muted body colour keep a long tasting
	 * list quiet; the line-height gives it room to breathe without adding
	 * height to a one-line value.
	 */
	font-size: clamp(0.8125rem, 0.79rem + 0.1vw, 0.84375rem);
	font-weight: var(--zai-fw-regular);
	line-height: 1.5;
	color: var(--zai-text-muted);
	overflow-wrap: anywhere;
	/* Keep the note off the card's own edges once it wraps to three lines. */
	padding-inline: 2px;
}

/* ==========================================================================
   4. Specification panel â€” "ÃœrÃ¼n Ã–zellikleri"
   -----------------------------------------------------------------------------
   A two-column definition list with a consistent label column so values align
   down the panel. Long values wrap inside their own column; nothing is clipped.
   ========================================================================== */

.zai-spec {
	margin-block: var(--zai-space-6) 0;
	padding-block-start: var(--zai-space-5);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color);
}

.zai-spec__title {
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-display);
	font-size: var(--zai-fs-h4);
	font-weight: var(--zai-fw-regular);
	line-height: var(--zai-lh-snug);
	letter-spacing: var(--zai-ls-tight);
	color: var(--zai-ink);
}

.zai-spec__list {
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	line-height: var(--zai-lh-normal);
}

.zai-spec__row {
	display: grid;
	grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr);
	gap: var(--zai-space-4);
	padding-block: var(--zai-space-3);
	border-block-end: var(--zai-border-width) solid var(--zai-border-color);
}

.zai-spec__row:first-child {
	padding-block-start: 0;
}

.zai-spec__row:last-child {
	padding-block-end: 0;
	border-block-end: 0;
}

.zai-spec__label {
	margin: 0;
	font-weight: var(--zai-fw-medium);
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text-subtle);
}

.zai-spec__value {
	margin: 0;
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text);
	overflow-wrap: anywhere;
}

/* Narrow screens: stack label above value so neither column is crushed. */
@media (max-width: 479px) {
	.zai-spec__row {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--zai-space-1);
	}
}

/* ==========================================================================
   4b. Product highlights plate â€” "Ã–ne Ã‡Ä±kan Ã–zellikler"
   -----------------------------------------------------------------------------
   PHASE 9.1. A solid ZAI Green specification plate, printed by
   zai_single_highlights() on `woocommerce_after_single_product_summary` at
   priority 5 â€” after the summary closes, before the tabs.

   PLACEMENT, AND WHY IT NEEDS NO EXTRA COLUMN
   On desktop `div.product` is a CSS Grid, and the existing rule
   `div.product .woocommerce-tabs, .related, .up-sells { grid-column: 1 / -1 }`
   makes every later child span the FULL width in an implicitly created row. If
   this plate were left unplaced it would therefore appear UNDER THE ENTIRE
   two-column section. Placing it explicitly at `grid-column: 1 / grid-row: 2`
   makes it a sibling of the gallery in column 1, immediately below it, instead
   of a full-width band. Because it shares the gallery's grid column it is
   aligned to the gallery's edges by construction.
   ========================================================================== */

.zai-highlights {
	/* Mobile: a normal block in document order, after the purchase area. */
	margin-block-start: var(--zai-space-6);
	padding: var(--zai-space-5);
	background-color: var(--zai-green);
	/* LÃ¼letaÅŸÄ± type on green: 4.85:1, AA for this text size. */
	color: var(--zai-surface);
	border-radius: var(--zai-radius);
	/* No shadow, no gradient: a plate, not a card. */
}

@media (min-width: 1024px) {
	.zai-highlights {
		/*
		 * Column 1, second row â€” directly beneath the gallery, never beneath
		 * the whole section. `align-self: start` stops it stretching to the
		 * row height set by the taller purchase column.
		 */
		grid-column: 1;
		grid-row: 2;
		align-self: start;
		/* The grid gap already separates it from the gallery above. */
		margin-block-start: 0;
	}
}

.zai-highlights__title {
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-semibold);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	/*
	 * Full LÃ¼letaÅŸÄ±, NOT a reduced opacity. Measured: LÃ¼letaÅŸÄ± at 82% over ZAI
	 * Green is 3.86:1 and at 72% only 3.35:1 â€” both below the 4.5:1 minimum. The
	 * eyebrow is ~11px, so it needs the full 4.85:1 that solid LÃ¼letaÅŸÄ± on ZAI
	 * Green already provides. Emphasis is carried by weight and letter-spacing
	 * instead of by dimming the colour.
	 */
	color: var(--zai-surface);
}

.zai-highlights__list {
	margin: 0;
}

/*
 * Rows, not a boxed table: a low-contrast hairline between rows only. The
 * separator is drawn on all but the last row so the plate has no trailing rule
 * above its own bottom edge.
 */
.zai-highlights__row {
	display: grid;
	grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
	gap: var(--zai-space-3);
	padding-block: var(--zai-space-3);
	border-block-start: 1px solid rgba(243, 240, 236, 0.18);
}

/* The first row needs no rule above it: the heading already separates it. */
.zai-highlights__row:first-child {
	padding-block-start: 0;
	border-block-start: 0;
}

.zai-highlights__row:last-child {
	padding-block-end: 0;
}

.zai-highlights__label {
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-xs);
	font-weight: var(--zai-fw-regular);
	letter-spacing: 0.02em;
	line-height: 1.45;
	/*
	 * Solid LÃ¼letaÅŸÄ± â€” 4.85:1 on ZAI Green. Deliberately NOT dimmed: measured,
	 * the same colour at 72% opacity drops to 3.35:1, which fails WCAG AA for text
	 * at this size. The label is separated from its value by weight (400 vs 500)
	 * and by the row's column position, not by lightness.
	 */
	color: var(--zai-surface);
}

.zai-highlights__value {
	margin: 0;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	line-height: 1.45;
	color: var(--zai-surface);
	overflow-wrap: anywhere;
}

/* Narrow screens: stack the label above the value, never squeeze two columns. */
@media (max-width: 599px) {
	.zai-highlights {
		padding: var(--zai-space-4);
	}

	.zai-highlights__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
		padding-block: var(--zai-space-3);
	}
}

/* ==========================================================================
   5. Stock, variations and purchase form
   ========================================================================== */

div.product .stock {
	display: inline-flex;
	align-items: center;
	gap: var(--zai-space-2);
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	color: var(--zai-green);
}

div.product .stock.out-of-stock {
	color: var(--zai-error);
}

/* Variation form: one row per attribute, label above control. */
div.product form.cart .variations {
	width: 100%;
	margin-block-end: var(--zai-space-4);
	border: 0;
}

div.product form.cart .variations tr {
	display: block;
	margin-block-end: var(--zai-space-3);
}

div.product form.cart .variations th,
div.product form.cart .variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	text-align: start;
}

div.product form.cart .variations th.label label {
	display: block;
	margin-block-end: var(--zai-space-2);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	color: var(--zai-ink);
}

/*
 * PHASE 8.6 â€” VARIATION SELECTOR PRESENTATION
 * -----------------------------------------------------------------------------
 * The owner's screenshot showed a small `gr` label above a default
 * browser-styled select. The LABEL text (`Paket Boyutu`) and the OPTION text
 * (`250 g`, `500 g`, `1.000 g`) are applied in PHP, because they are WooCommerce
 * filters, not CSS. This block covers the visual treatment only.
 *
 * A real native <select> is kept on purpose: it is keyboard operable, works with
 * screen readers, respects the platform picker on mobile and keeps WooCommerce's
 * own variation JavaScript and reset behaviour intact. `appearance: none` is
 * paired with an explicit visible chevron below, so the affordance is never
 * lost â€” and the chevron is decorative, so the control remains accessible.
 *
 * Height: shares the purchase panel's control height (48px) so the no-JavaScript
 * fallback matches the pills, quantity field and CTA that replace it. It is still
 * comfortably above the 44px touch-target minimum.
 */
div.product form.cart .variations select {
	width: 100%;
	min-height: var(--zai-purchase-control-height, 3.25rem);
	/* Extra inline-end padding reserves room for the chevron. */
	padding: var(--zai-space-3) calc(var(--zai-space-4) + 1.25rem) var(--zai-space-3) var(--zai-space-4);
	/* LÃ¼letaÅŸÄ±-tinted surface, so the field reads as premium rather than default. */
	background-color: var(--zai-surface);
	border: var(--zai-border-width) solid var(--zai-border-color-strong);
	border-radius: var(--zai-radius);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-base);
	font-weight: var(--zai-fw-medium);
	line-height: var(--zai-lh-snug);
	color: var(--zai-text);
	/* Native chrome off; the chevron below replaces it. */
	-webkit-appearance: none;
	appearance: none;
	/*
	 * ZAI Green chevron, matching the `chevron-down` icon in the theme's icon set
	 * (inc/template-tags.php). Encoded so no extra request is made.
	 */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23447350' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.2 9.4 5.8 5.8 5.8-5.8'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--zai-space-4) center;
	background-size: 1.125rem 1.125rem;
	cursor: pointer;
	transition:
		border-color var(--zai-dur-fast) var(--zai-ease),
		background-color var(--zai-dur-fast) var(--zai-ease);
}

/* Clear hover state. */
div.product form.cart .variations select:hover {
	border-color: var(--zai-ink);
	background-color: var(--zai-bg);
}

/* ZAI Green focus ring, always visible for keyboard users. */
div.product form.cart .variations select:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
	border-color: var(--zai-green);
}

/* The placeholder option stays muted so a real choice is visibly distinct. */
div.product form.cart .variations select option[value=""] {
	color: var(--zai-text-subtle);
}

/* Reset-variations link. */
div.product form.cart .reset_variations {
	display: inline-block;
	margin-block-start: var(--zai-space-2);
	font-size: var(--zai-fs-xs);
	color: var(--zai-text-subtle);
}

div.product form.cart .reset_variations:hover {
	color: var(--zai-green);
}

/*
 * PHASE 8.6 â€” selected-variation feedback.
 *
 * WooCommerce injects `.woocommerce-variation` (price, availability and any
 * variation image) only once a choice is made. It previously sat flush against
 * the quantity row with no separation. The values themselves are WooCommerce's
 * own â€” nothing is calculated or invented here.
 */
div.product form.cart .woocommerce-variation {
	margin-block-end: var(--zai-space-4);
}

/*
 * PHASE 9 â€” no space reserved for nothing.
 *
 * `woocommerce_single_variation()` prints `.woocommerce-variation` EMPTY until a
 * customer chooses an option (it is the live region WooCommerce fills in). The
 * 16px bottom margin above therefore reserved a gap for an empty box on first
 * paint. `:empty` removes it while keeping the margin for the real, filled
 * state â€” no JavaScript and no effect on the markup WooCommerce writes into.
 */
div.product form.cart .woocommerce-variation:empty {
	display: none;
	margin-block-end: 0;
}

div.product form.cart .woocommerce-variation > .woocommerce-variation-availability .stock {
	margin-block-end: 0;
}

/* A variation image, when one is configured, is shown compactly. */
div.product form.cart .woocommerce-variation-image {
	max-width: 6rem;
	margin-block-end: var(--zai-space-3);
}

div.product form.cart .woocommerce-variation-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--zai-radius);
}


/*
 * PHASE 9.2 â€” COMPACT, BALANCED PURCHASE PANEL
 * -----------------------------------------------------------------------------
 * Two defects drove this rewrite, both measured in a headless browser at 1440px
 * against the live page:
 *
 *   1. The package options and the buy row were 97px apart. Three separate rules
 *      were each supplying the same space and stacking: the form's 12px flex
 *      row-gap, WooCommerce's `.variations { margin-bottom: 1em }` (15px), and a
 *      20px `margin-block-start` on the buy row. The `<th class="label">` inside
 *      the size table also duplicated the "PAKET BOYUTU" caption, costing a
 *      further ~29px, and the `visibility: hidden` reset link still reserved
 *      ~21px of layout.
 *
 *   2. The Add to Cart button filled only 69â€“80% of its row. `form.cart` is a
 *      flex row whose children are `table.variations` and
 *      `.single_variation_wrap`. Only `.variations` and
 *      `.woocommerce-variation-add-to-cart` carried a flex rule, so
 *      `.single_variation_wrap` â€” the wrapper that actually holds the buy row â€”
 *      sized itself to its content instead of filling the form.
 */
.zai-purchase {
	display: block;
	/* 52px: package options, quantity and CTA all share one height. */
	--zai-purchase-control-height: 3.25rem;
	/* 24px panel padding, inside the requested 22â€“26px band. */
	margin-block-start: var(--zai-space-4);
	padding: var(--zai-space-5);
	background-color: var(--zai-surface);
	border: var(--zai-border-width) solid var(--zai-border-color);
	border-radius: var(--zai-radius);
	/* Content-driven height only: no min-height anywhere in this component. */
}

/*
 * The header row: "PAKET BOYUTU" left, "3 PAKET SEÃ‡ENEÄÄ°" right.
 *
 * Printed by zai_purchase_block_open() OUTSIDE the form, from the product's real
 * attribute label and real option count.
 */
.zai-purchase__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--zai-space-3);
	margin: 0 0 12px;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-semibold);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	line-height: 1.4;
}

.zai-purchase__label {
	color: var(--zai-ink);
}

/* The count is secondary: muted, same size, never competing with the label. */
.zai-purchase__count {
	font-weight: var(--zai-fw-medium);
	letter-spacing: var(--zai-ls-wide);
	color: var(--zai-text-subtle);
	white-space: nowrap;
}

/*
 * Inside the panel the form carries no spacing of its own.
 *
 * `gap: 0` is essential, not cosmetic. The form's 12px row-gap was applying
 * BETWEEN `.variations` and `.single_variation_wrap`, on top of both elements'
 * own margins, so the space from the package options to the buy row measured
 * 45px. Only the form's ROW gap is removed; the buy row keeps its own `gap` for
 * the horizontal space between the quantity field and the button.
 *
 * SELECTOR ORDER MATTERS HERE. `.zai-purchase` is the form's PARENT, so it must
 * come BEFORE `form.cart` in the selector. Writing `div.product form.cart
 * .zai-purchase …` describes the opposite relationship and silently matches
 * nothing — which is exactly the mistake this comment exists to prevent.
 *
 * Specificity (0,3,2) beats the theme's `div.product form.cart` (0,2,2).
 */
div.product .zai-purchase form.cart {
	margin-block-start: 0;
	margin-block-end: 0;
	gap: 0;
}

/*
 * The size table contributes no spacing either.
 *
 * WooCommerce's `.variations { margin-bottom: 1em }` was never overridden (15px),
 * and the cell's own block padding made the row 60px around a 52px pill. Both are
 * neutralised so the ONLY vertical gap in this region is the one declared on
 * `.single_variation_wrap` below.
 *
 * (0,4,2) and (0,5,3) respectively, against the theme's (0,3,2) and (0,3,3).
 */
div.product .zai-purchase form.cart .variations {
	margin-block-end: 0;
}

div.product .zai-purchase form.cart .variations td.value {
	padding-block: 0;
}

/*
 * The size row must not add a trailing margin either: the theme's existing
 * `variations tr { display: block; margin-block-end: var(--zai-space-3) }`
 * otherwise leaves a 12px band under the package options, which would become a
 * second gap before the divider.
 */
div.product .zai-purchase form.cart .variations tr {
	margin-block-end: 0;
}

/*
 * The pill row.
 *
 * The pills are 52px as specified; the row measures 60px because the item is a
 * flex container that adds 8px of breathing room around its control. That is
 * intentional — it keeps the pills off the cell edges — and it is NOT influenced
 * by the radios: measured in the browser, hiding them entirely leaves the row at
 * 60px.
 *
 * `align-items: center` on both the row and the item guarantees the three pills
 * share one baseline even when one label wraps.
 */
.zai-purchase .zai-sizes[data-zai-sizes-enhanced] .zai-sizes__pills {
	align-items: center;
}

.zai-purchase .zai-sizes[data-zai-sizes-enhanced] .zai-sizes__item {
	align-items: center;
}

/*
 * ONE gap, and the divider, between the package options and the action row.
 *
 *   package options â†’ 18px â†’ divider â†’ 18px â†’ action row
 *
 * `flex: 1 0 100%` is the rule that was missing: without it the buy row shrank to
 * its content width and left dead space on the right of the panel.
 */
.zai-purchase .single_variation_wrap {
	flex: 1 0 100%;
	margin-block-start: 18px;
	padding-block-start: 18px;
	border-block-start: var(--zai-border-width) solid var(--zai-border-color-strong);
}

/*
 * The live region WooCommerce fills in once a size is chosen. It must not add a
 * second gap of its own, and when empty it must not reserve space at all.
 */
.zai-purchase .woocommerce-variation {
	margin-block-end: 0;
}

.zai-purchase .woocommerce-variation:empty {
	display: none;
	margin: 0;
}

/*
 * The buy row. Its own vertical margin is deliberately zero: the spacing is owned
 * by `.single_variation_wrap` above, so there is exactly one gap and no
 * possibility of two stacking again.
 */
.zai-purchase .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--zai-space-3);
	margin-block-start: 0;
	padding-block-start: 0;
}

/*
 * WooCommerce's own `<th class="label">` still printed "PAKET BOYUTU" INSIDE the
 * size table â€” a duplicate of the panel header printed above it, costing ~29px.
 * Hidden with the clip technique rather than `display: none`, so the
 * `for`/`id` association survives for assistive technology while the duplicate
 * costs zero layout.
 */
.zai-purchase .variations th.label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * The reset link is kept â€” it is the only way to clear a selection â€” but pulled
 * out of flow and parked at the top-right of the size group, so it is available
 * the moment WooCommerce reveals it without ever occupying the space between the
 * package options and the divider.
 */
.zai-purchase .variations .reset_variations {
	position: absolute;
	inset-block-start: 0;
	inset-inline-end: 0;
	margin: 0;
	font-size: var(--zai-fs-xs);
	line-height: 1.2;
}


/*
 * PHASE 9 â€” the inline AJAX error now lands INSIDE the panel.
 *
 * `showProductError()` inserts `.woocommerce-error.zai-ajax-error` as the first
 * child of the form's parent, which the purchase panel became. The global
 * `.woocommerce-error` styling supplies the surface and the text label; only the
 * vertical rhythm needs adjusting so the panel's own padding is not doubled.
 */
.zai-purchase > .woocommerce-error {
	margin-block: 0 var(--zai-space-4);
}

/*
 * Quantity + add-to-cart sit on one line and share a baseline.
 *
 * WooCommerce renders `form.cart` as a plain block, so the quantity wrapper and
 * the submit button each became inline-block and wrapped onto separate lines
 * whenever the container was narrower than the two together. Making the form a
 * wrapping flex row keeps them aligned and still lets them stack on very narrow
 * screens.
 */
div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--zai-space-3);
	margin-block-start: var(--zai-space-5);
}

/* Variation selects must stay full width inside the flex row. */
div.product form.cart .variations {
	flex: 1 0 100%;
	margin-block-end: 0;
}

div.product form.cart .woocommerce-variation,
div.product form.cart .woocommerce-variation-add-to-cart {
	flex: 1 0 100%;
}

div.product form.cart .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--zai-space-3);
}

/* Quantity + button sit on one line. */
div.product form.cart .quantity {
	display: inline-flex;
	flex: 0 0 auto;
	margin: 0;
}

div.product form.cart div.quantity .qty {
	/* 84px: inside the requested 84â€“96px band, comfortably tappable. */
	width: 5.25rem;
	/* Shares the panel's control height so all three controls align. */
	min-height: var(--zai-purchase-control-height, 3.25rem);
	padding: 0 var(--zai-space-2);
	background-color: var(--zai-bg);
	border: var(--zai-border-width) solid var(--zai-border-color-strong);
	border-radius: var(--zai-radius);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-base);
	font-weight: var(--zai-fw-medium);
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: var(--zai-text);
}

div.product form.cart div.quantity .qty:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
	border-color: var(--zai-green);
}

div.product form.cart .single_add_to_cart_button {
	min-height: var(--zai-purchase-control-height, 3.25rem);
	padding-inline: var(--zai-space-5);
}

/*
 * The primary purchase action is the decision point of the page, so it is a
 * full-width brand button beside the quantity selector rather than a
 * content-width control.
 *
 * `.button.alt` is included because WooCommerce applies `alt` to the single
 * add-to-cart control; both clase names must be covered so the brand colour can
 * never be lost to a WooCommerce specificity change.
 */
.zai-has-woocommerce div.product form.cart .single_add_to_cart_button,
.zai-has-woocommerce div.product form.cart button.button.alt,
.zai-has-woocommerce div.product form.cart .button.alt {
	/*
	 * PHASE 9.2 â€” `flex: 1 1 0` with a zero basis, not `1 1 auto`.
	 *
	 * Measured: with `auto` the button kept its intrinsic content width and only
	 * reached 80% of the row, leaving dead space on the right. A zero basis makes
	 * it absorb exactly the space the quantity field does not use, which is what
	 * "fills the remaining horizontal space" means.
	 */
	flex: 1 1 0;
	width: auto;
	min-width: 9rem;
	/* Matches the pill and quantity controls exactly, so the row is aligned. */
	min-height: var(--zai-purchase-control-height, 3.25rem);
	padding: 0 var(--zai-space-5);
	background-color: var(--zai-green);
	border: var(--zai-border-width) solid var(--zai-green);
	border-radius: var(--zai-radius);
	color: var(--zai-text-inverse);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-semibold);
	line-height: var(--zai-lh-normal);
	letter-spacing: var(--zai-ls-wide);
	text-align: center;
	text-decoration: none;
	text-shadow: none;
	white-space: normal;
	cursor: pointer;
	transition:
		background-color var(--zai-dur-fast) var(--zai-ease),
		border-color var(--zai-dur-fast) var(--zai-ease);
}

.zai-has-woocommerce div.product form.cart .single_add_to_cart_button:hover,
.zai-has-woocommerce div.product form.cart button.button.alt:hover,
.zai-has-woocommerce div.product form.cart .button.alt:hover {
	background-color: var(--zai-green-hover);
	border-color: var(--zai-green-hover);
	color: var(--zai-text-inverse);
}

/* Mobile: the action owns the full row so it is never a narrow strip. */
@media (max-width: 767px) {
	.zai-has-woocommerce div.product form.cart .single_add_to_cart_button,
	.zai-has-woocommerce div.product form.cart button.button.alt {
		flex: 1 0 100%;
		width: 100%;
		min-width: 0;
	}
}

/*
 * WooCommerce hard-codes its own palette on these controls through
 * `.woocommerce`-prefixed selectors in woocommerce.css, e.g.
 *   .woocommerce div.product p.price          (0,2,2)
 *   .woocommerce button.button.alt            (0,3,1)
 * Both outrank the plain `div.product â€¦` selectors below, which is why the
 * product page rendered an olive price and a purple add-to-cart button instead
 * of Anthracite and ZAI Green.
 *
 * The `.woocommerce` prefix restores brand colours without !important, and the
 * rules are kept narrow so nothing else on the page can be affected.
 */

.woocommerce div.product .summary .price,
.woocommerce div.product p.price {
	color: var(--zai-ink);
}

.woocommerce div.product .summary .price del {
	color: var(--zai-text-subtle);
}

.woocommerce div.product .summary .price ins,
.woocommerce div.product p.price ins {
	color: var(--zai-green);
	text-decoration: none;
}

/*
 * Add-to-cart: brand green, never WooCommerce purple.
 *
 * PHASE 9.1 â€” the height and padding here must stay in step with the block above,
 * because this `.woocommerce`-prefixed selector set (0,3,1 / 0,3,2) outranks the
 * `.zai-has-woocommerce` one (0,3,1 but later source order is not guaranteed once
 * WooCommerce's own stylesheet loads after the theme). Declaring the SAME values
 * in both places means the button cannot drift out of alignment with the pill and
 * quantity controls regardless of which rule wins.
 */
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce div.product form.cart button.button.alt,
.woocommerce div.product form.cart .button.alt {
	background-color: var(--zai-green);
	border: var(--zai-border-width) solid var(--zai-green);
	border-radius: var(--zai-radius);
	color: var(--zai-text-inverse);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-semibold);
	letter-spacing: var(--zai-ls-wide);
	min-height: var(--zai-purchase-control-height, 3.25rem);
	padding: 0 var(--zai-space-5);
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.woocommerce div.product form.cart button.button.alt:hover {
	background-color: var(--zai-green-hover);
	border-color: var(--zai-green-hover);
	color: var(--zai-text-inverse);
}

.woocommerce div.product form.cart .single_add_to_cart_button:focus-visible,
.woocommerce div.product form.cart button.button.alt:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

.woocommerce div.product form.cart .single_add_to_cart_button:disabled,
.woocommerce div.product form.cart .single_add_to_cart_button.disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

div.product form.cart .woocommerce-variation-price {
	margin-block-end: var(--zai-space-3);
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   5b. Package-size pills
   --------------------------------------------------------------------------
   PHASE 9. Server-rendered next to the native variation <select>, which stays
   the single source of truth. Everything here is presentation.

   THE CSS-ONLY FALLBACK
   `.zai-sizes__pills` is hidden and the select is shown until JavaScript sets
   `data-zai-sizes-enhanced` on the wrapper. With JS unavailable the customer
   sees the original 56px styled select â€” fully functional, because it is the
   real WooCommerce control. No script is required for the page to be usable.

   The radios are real, labelled form controls, so arrow-key navigation, Space
   to select, screen-reader announcements and the browser's focus ring are the
   native behaviours rather than re-implementations. They carry no `name` that
   WooCommerce submits â€” see zai_render_package_size_control().
   ========================================================================== */

.zai-sizes {
	display: block;
	width: 100%;
	/* Containing block for the visually collapsed select below. */
	position: relative;
}

/* Fallback state: pills hidden, native select visible. */
.zai-sizes__pills {
	display: none;
}

/* Enhanced state: pills visible, select becomes the invisible proxy. */
.zai-sizes[data-zai-sizes-enhanced] .zai-sizes__pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--zai-space-2);
	margin: 0;
	padding: 0;
}

/*
 * The select is collapsed visually but NOT removed from the form.
 *
 * `display: none` would stop it being submitted and would take it out of the
 * accessibility tree, so it is clipped to a single pixel instead: WooCommerce
 * keeps full control of its value and options, and the form still posts it.
 *
 * SPECIFICITY â€” the reason for the long selector.
 * The established rule `div.product form.cart .variations select` scores
 * (0,4,2): one element + four classes/elements before `select`. A shorter
 * selector such as `.zai-sizes[...] select[name^=...]` scores only (0,3,1) and
 * therefore LOSES â€” the select would keep `width: 100%`, its 56px height and its
 * chevron, and would sit visibly on top of the pills. Repeating the `div.product
 * form.cart` prefix raises this to (0,5,3), which wins on merit with no
 * `!important`, matching the convention used throughout this file.
 */
div.product form.cart .zai-sizes[data-zai-sizes-enhanced] select[name^="attribute_"] {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	width: 1px;
	min-height: 0;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	background-image: none;
	/* Never a tab stop: the pills are the keyboard control (see below). */
	opacity: 0;
	pointer-events: none;
}

.zai-sizes__item {
	display: flex;
	flex: 1 1 0;
	min-width: 0;
}

/*
 * The radio stays in the DOM, focusable, and out of the layout.
 *
 * WHY NOT THE VISUAL-CLIP TECHNIQUE: measured, it failed. A clipped radio still
 * contributed a line box and the pill row stayed 60px around 52px pills, because
 * WooCommerce's own radio styling overrides the `width`/`height` declared here.
 *
 * WHY NOT `display: none`: that would remove the radio from the accessibility tree
 * AND make `:focus-visible` unreachable, so the keyboard focus ring on the pill
 * could never appear.
 *
 * The combination that satisfies both: `appearance: none` discards the UA radio
 * box (so the declared size actually holds), and `position: absolute` against the
 * `position: relative` `.zai-sizes` takes it fully out of flow. It remains
 * focusable, keeps its accessible name from the `<label for>`, keeps its checked
 * state, and still fires `change` — the only event the module listens for.
 */
.zai-sizes__input {
	position: absolute;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

/*
 * PHASE 9.1 â€” PREMIUM PACKAGE BUTTONS.
 *
 * Unselected: warm white on the LÃ¼letaÅŸÄ± panel with a single hairline. Selected:
 * ZAI Green with warm-white text, so the chosen size reads instantly without a
 * badge, a tick or a shadow. All three pills share the panel's control height and
 * split the row evenly (`flex: 1 1 0` on the item), so they are identical widths
 * at any container size.
 */
.zai-sizes__pill {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	/* Shares the panel's control height: pills, quantity and CTA all align. */
	min-height: var(--zai-purchase-control-height, 3.25rem);
	padding: 0 var(--zai-space-2);
	background-color: var(--zai-bg);
	border: var(--zai-border-width) solid var(--zai-border-color-strong);
	border-radius: var(--zai-radius);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	line-height: 1;
	letter-spacing: 0.01em;
	text-align: center;
	white-space: nowrap;
	color: var(--zai-ink);
	cursor: pointer;
	user-select: none;
	transition:
		background-color var(--zai-dur-fast) var(--zai-ease),
		border-color var(--zai-dur-fast) var(--zai-ease),
		color var(--zai-dur-fast) var(--zai-ease);
}

.zai-sizes__pill:hover {
	border-color: var(--zai-ink);
}

/* Selected: filled ZAI Green, warm-white label. */
.zai-sizes__input:checked + .zai-sizes__pill {
	background-color: var(--zai-green);
	border-color: var(--zai-green);
	color: var(--zai-surface);
	font-weight: var(--zai-fw-semibold);
}

/* Keep the filled state on hover rather than reverting to the outline. */
.zai-sizes__input:checked + .zai-sizes__pill:hover {
	background-color: var(--zai-green-hover);
	border-color: var(--zai-green-hover);
	color: var(--zai-surface);
}

/* Unavailable: flagged by the module from WooCommerce's own option state. */
.zai-sizes__pill[data-zai-size-unavailable] {
	opacity: 0.4;
	cursor: not-allowed;
	text-decoration: line-through;
}

.zai-sizes__pill[data-zai-size-unavailable]:hover {
	border-color: var(--zai-border-color-strong);
}

/* Keyboard focus always visible, and only for keyboard users. */
.zai-sizes__input:focus-visible + .zai-sizes__pill {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

/*
 * The focus ring is ZAI Green, which would vanish against the green filled state.
 * Inside the panel the ring is drawn in Anthracite instead, on the selected pill
 * only, so a keyboard user can always see where they are.
 */
.zai-purchase .zai-sizes__input:checked:focus-visible + .zai-sizes__pill {
	outline-color: var(--zai-ink);
}

/* ==========================================================================
   6. Product meta
   ========================================================================== */

div.product .product_meta {
	margin-block-start: var(--zai-space-5);
	padding-block-start: var(--zai-space-4);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-xs);
	line-height: var(--zai-lh-normal);
	color: var(--zai-text-subtle);
}

div.product .product_meta > span {
	display: block;
	margin-block-end: var(--zai-space-1);
}

div.product .product_meta a {
	color: var(--zai-green);
	text-decoration: none;
}

div.product .product_meta a:hover {
	text-decoration: underline;
}


/* ==========================================================================
   7. Tabs
   -----------------------------------------------------------------------------
   Native WooCommerce tab markup is kept so review submission keeps working.
   Only presentation changes; on narrow screens the tab list wraps rather than
   turning into an accordion, which avoids adding JavaScript.

   PHASE 9 â€” TIGHTER INFORMATION RHYTHM, AND THE SPECIFICATION TAB
   The specification panel now lives here instead of inside the purchase column,
   so this area carries real content and no longer needs the generous 64px + 32px
   opening that previously separated two thin blocks. Measured before: 96px of
   chrome above the tabs plus 72px above the related section, on top of the 40px
   the product container and the breadcrumb already contribute.
   ========================================================================== */

div.product .woocommerce-tabs {
	/* 32 â†’ 48px, adaptive; was a flat 64px. */
	margin-block-start: clamp(2rem, 3vw, 3rem);
	/* 16 â†’ 24px; was a flat 32px. */
	padding-block-start: clamp(1rem, 1.6vw, 1.5rem);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color);
}

div.product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--zai-space-2) var(--zai-space-5);
	margin: 0 0 var(--zai-space-5);
	padding: 0;
	border: 0;
	list-style: none;
}

div.product .woocommerce-tabs ul.tabs::before,
div.product .woocommerce-tabs ul.tabs::after {
	display: none;
}

div.product .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}

div.product .woocommerce-tabs ul.tabs li::before,
div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

div.product .woocommerce-tabs ul.tabs li a {
	display: inline-flex;
	align-items: center;
	min-height: var(--zai-touch-target);
	padding: 0 0 var(--zai-space-2);
	border-block-end: var(--zai-border-width-strong) solid transparent;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	letter-spacing: var(--zai-ls-wide);
	color: var(--zai-text-muted);
	text-decoration: none;
}

div.product .woocommerce-tabs ul.tabs li a:hover {
	color: var(--zai-green);
}

div.product .woocommerce-tabs ul.tabs li a:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--zai-ink);
	border-block-end-color: var(--zai-green);
}

div.product .woocommerce-tabs .panel {
	margin: 0;
	padding: 0;
	max-width: 72ch;
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-base);
	line-height: var(--zai-lh-relaxed);
	color: var(--zai-text-muted);
}

/*
 * PHASE 9 â€” SCOPED, OR IT HIDES THE WRONG HEADING.
 *
 * This rule exists because WooCommerce prints the tab title a second time as an
 * <h2> inside the description panel ("Description"). It was written as
 * `.panel > h2:first-child`, which is a wildcard across every panel â€” so on the
 * new specification tab it would have hidden the panel's own heading, and it
 * would hide any heading an editor legitimately places first in their copy.
 *
 * It is now limited to the description panel, which is the only panel that
 * duplicates its tab label.
 */
div.product .woocommerce-tabs .woocommerce-Tabs-panel--description > h2:first-child {
	display: none;
}

/*
 * The specification panel keeps its two-column definition list, but it now has
 * the full content width instead of a ~45% column, so the label column can be a
 * little wider and the rows read as a table rather than as wrapped prose.
 *
 * The 72ch prose measure above is deliberately overridden for THIS panel only: a
 * definition list of short label/value pairs is scanned, not read, so it wants
 * the width while the description tab keeps its comfortable measure.
 */
div.product .woocommerce-tabs .woocommerce-Tabs-panel--zai_specifications {
	max-width: 56rem;
}

div.product .woocommerce-tabs .panel .zai-spec {
	margin-block: 0;
	padding-block-start: 0;
	border-block-start: 0;
}

div.product .woocommerce-tabs .panel .zai-spec__row {
	grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
	/* A little more air per row now that the panel is full width. */
	padding-block: var(--zai-space-3);
}

/* ==========================================================================
   8. Related products â€” compact horizontal carousel
   --------------------------------------------------------------------------
   PHASE 8.6. Three defects combined on this page and produced the owner's
   screenshot (blank first slot, cards shifted right, a second row, dead height):

     1. inc/woocommerce/archive.php returns `<ul class="products
        zai-product-grid">` for EVERY loop, including WooCommerce's related loop.
     2. The rule that neutralises WooCommerce's clearfix pseudo-items lives in
        10-shop.css, which inc/assets.php enqueues ONLY on shop archives. On a
        single product page `.woocommerce ul.products::before { content:" ";
        display:table }` was therefore still active.
     3. The grid previously declared here turned that pseudo-element into a real
        GRID ITEM. It took cell 1 and pushed every card one track right â€” the
        blank first slot. Three cards plus the pseudo-item is four items in a
        three-column grid, so the last card wrapped onto a second row â€” the extra
        row and the dead height.

   This was never a data problem. WooCommerce returned three valid, published,
   visible products, each with an image. No product is hidden here: the
   pseudo-element is removed and the track is a single row.

   Implementation: one row, native horizontal scrolling, CSS scroll-snap, no
   carousel framework, no cloned slides, no duplicated products. Arrows are
   added by assets/js/woocommerce.js as progressive enhancement.
   ========================================================================== */

/*
 * The wrapper is a grouping element only (hooked at priorities 14 / 25). It used
 * to add its own 64px margin, 32px padding and a hairline, and the .related
 * section inside it added the same again â€” a double separator plus ~96px of
 * dead vertical space. `display: contents` removes the wrapper's box entirely,
 * so an EMPTY wrapper also stops reserving space at the end of the page.
 */
.zai-single__cross-sells {
	display: contents;
}

/* The real separator belongs to the sections themselves, once. */
div.product .related,
div.product .up-sells {
	min-width: 0;
	/* 32 â†’ 40px; was a flat 48px, on top of 24px of padding. */
	margin-block-start: clamp(2rem, 2.6vw, 2.5rem);
	padding-block-start: clamp(1rem, 1.6vw, 1.5rem);
	border-block-start: var(--zai-border-width) solid var(--zai-border-color);
}

/*
 * Heading and controls share one row: the heading sits on the left, the arrows
 * on the right. The track below spans both columns.
 */
div.product .related,
div.product .up-sells {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	column-gap: var(--zai-space-4);
}

/* A small editorial heading, not a second page title. */
div.product .related > h2,
div.product .up-sells > h2 {
	grid-column: 1;
	margin: 0 0 var(--zai-space-4);
	font-family: var(--zai-font-display);
	font-size: var(--zai-fs-h4);
	font-weight: var(--zai-fw-light);
	line-height: var(--zai-lh-tight);
	letter-spacing: var(--zai-ls-tight);
	color: var(--zai-ink);
}

/* --- Arrow controls (injected by JS; the section works without them) ------ */

.zai-related__nav {
	grid-column: 2;
	grid-row: 1;
	display: none;
	gap: var(--zai-space-2);
	margin-block-end: var(--zai-space-4);
}

/* Only shown once JS has confirmed the track can actually move. */
.zai-related__nav[data-zai-carousel-ready] {
	display: flex;
}

.zai-related__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--zai-touch-target);
	height: var(--zai-touch-target);
	padding: 0;
	background-color: var(--zai-bg);
	border: var(--zai-border-width) solid var(--zai-border-color-strong);
	border-radius: var(--zai-radius-pill);
	color: var(--zai-ink);
	cursor: pointer;
	transition:
		background-color var(--zai-dur-fast) var(--zai-ease),
		border-color var(--zai-dur-fast) var(--zai-ease),
		color var(--zai-dur-fast) var(--zai-ease);
}

.zai-related__arrow:hover:not(:disabled) {
	background-color: var(--zai-green);
	border-color: var(--zai-green);
	color: var(--zai-text-inverse);
}

.zai-related__arrow:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

/* Movement unavailable at this end of the track. */
.zai-related__arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.zai-related__arrow svg {
	width: 1.125rem;
	height: 1.125rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.zai-related__arrow[data-zai-carousel-prev] svg {
	transform: rotate(180deg);
}


/*
 * THE FIX FOR THE BLANK FIRST SLOT.
 *
 * `.woocommerce ul.products::before` / `::after` are WooCommerce's float
 * clearfix (`content:" "; display:table`). As flex/grid children they are real
 * boxes that occupy a slot. They are removed here at the same specificity
 * WooCommerce and 10-shop.css use, on selectors that load on this page, so the
 * fix does not depend on 10-shop.css being enqueued. No `!important` is needed.
 */
div.product .related ul.products::before,
div.product .related ul.products::after,
div.product .up-sells ul.products::before,
div.product .up-sells ul.products::after {
	content: none;
	display: none;
}

/*
 * ONE ROW. A horizontal flex track (not a grid) keeps every card on a single
 * line by construction, so a second row is geometrically impossible.
 *
 * `overflow-x: auto` gives native scrolling: touch, trackpad, shift+wheel and
 * the keyboard (the track is focusable via tabindex added by JS) all work with
 * no library. `scroll-snap-type: x mandatory` aligns cards after a swipe.
 * `overscroll-behavior-x: contain` stops the rubber-band from chaining to the
 * body, so the CAROUSEL scrolls and the PAGE never does.
 */
div.product .related ul.products,
div.product .up-sells ul.products {
	grid-column: 1 / -1;
	grid-row: 2;
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: var(--zai-space-4);
	width: 100%;
	/* Both bounds are enforced: no page-level horizontal overflow. */
	max-width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0 0 var(--zai-space-3);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	list-style: none;
	/* Refined but still visible scrollbar (see ::-webkit-scrollbar below). */
	scrollbar-width: thin;
	scrollbar-color: var(--zai-border-color-strong) transparent;
}

/* The track takes focus so arrow-key and shift-wheel scrolling stay reachable. */
div.product .related ul.products:focus-visible,
div.product .up-sells ul.products:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

/* Firefox / standards scrollbar refinement (does not disable keyboard use). */
div.product .related ul.products::-webkit-scrollbar,
div.product .up-sells ul.products::-webkit-scrollbar {
	height: 6px;
}

div.product .related ul.products::-webkit-scrollbar-track,
div.product .up-sells ul.products::-webkit-scrollbar-track {
	background-color: transparent;
}

div.product .related ul.products::-webkit-scrollbar-thumb,
div.product .up-sells ul.products::-webkit-scrollbar-thumb {
	background-color: var(--zai-border-color-strong);
	border-radius: var(--zai-radius-pill);
}

/*
 * CARD WIDTH â€” a fixed fraction of the track, so the same three cards are always
 * visible on desktop regardless of how many products WooCommerce returns.
 *
 * Mobile is deliberately 1.13 cards wide: one full card plus a partial next one
 * signals that the row scrolls. Tablet shows two. Desktop shows three.
 */
div.product .related ul.products > li,
div.product .up-sells ul.products > li {
	/* Overrides WooCommerce's floats and percentage widths. */
	float: none;
	flex: 0 0 auto;
	width: calc((100% - (var(--zai-space-4) * 0.13)) / 1.13);
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	list-style: none;
}

@media (min-width: 768px) {
	div.product .related ul.products > li,
	div.product .up-sells ul.products > li {
		/* Two visible cards, with the third peeking to invite a swipe. */
		width: calc((100% - var(--zai-space-4)) / 2 - 1.5rem);
	}
}

@media (min-width: 1024px) {
	div.product .related ul.products > li,
	div.product .up-sells ul.products > li {
		/* Exactly three visible cards: 3 cards + 2 gaps = 100%. */
		width: calc((100% - (var(--zai-space-4) * 2)) / 3);
	}
}

/* --- 8b. Compact related-product card ------------------------------------
   ROOT CAUSE
   ----------
   `.zai-product-card` is styled only in 09-home.css (front page) and, scoped
   under `ul.zai-product-grid`, in 10-shop.css (shop archives). Neither sheet is
   enqueued on a single product page, so the related cards rendered as bare,
   unstyled markup. Rather than load a whole stylesheet for three cards, the
   compact presentation is declared here, scoped to the related section ONLY.

   These rules intentionally do not touch the global shop grid or the homepage
   cards: every selector is prefixed with the related track.
   ------------------------------------------------------------------------ */

div.product .related ul.products .zai-product-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
}

/* 4:5 as specified â€” but noticeably smaller than the main gallery stage. */
div.product .related ul.products .zai-product-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 4 / 5;
	background-color: var(--zai-surface);
	border-radius: var(--zai-radius);
	text-decoration: none;
}

div.product .related ul.products .zai-product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--zai-dur-slow) var(--zai-ease);
}

div.product .related ul.products .zai-product-card:hover .zai-product-card__image,
div.product .related ul.products .zai-product-card:focus-within .zai-product-card__image {
	transform: scale(1.03);
}

div.product .related ul.products .zai-product-card__noimage {
	display: block;
	width: 100%;
	height: 100%;
	background-color: var(--zai-surface-deep);
}

div.product .related ul.products .zai-product-card__flag {
	position: absolute;
	inset-block-start: var(--zai-space-2);
	inset-inline-start: var(--zai-space-2);
}

div.product .related ul.products .zai-product-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding-block-start: var(--zai-space-3);
}

div.product .related ul.products .zai-product-card__category {
	margin: 0 0 var(--zai-space-1);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-eyebrow);
	font-weight: var(--zai-fw-medium);
	letter-spacing: var(--zai-ls-caps);
	text-transform: uppercase;
	color: var(--zai-text-subtle);
}

/* Compact type step: below the standard card's h5 so three fit comfortably. */
div.product .related ul.products .zai-product-card__title {
	margin: 0 0 var(--zai-space-2);
	font-family: var(--zai-font-display);
	font-size: var(--zai-fs-base);
	font-weight: var(--zai-fw-regular);
	line-height: var(--zai-lh-snug);
	letter-spacing: var(--zai-ls-tight);
}

div.product .related ul.products .zai-product-card__link {
	color: var(--zai-ink);
	text-decoration: none;
}

div.product .related ul.products .zai-product-card__link:hover {
	color: var(--zai-green);
}

div.product .related ul.products .zai-product-card__link:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

div.product .related ul.products .zai-product-card__price {
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-sm);
	font-weight: var(--zai-fw-medium);
	font-variant-numeric: tabular-nums;
	color: var(--zai-text);
}

div.product .related ul.products .zai-product-card__price del {
	color: var(--zai-text-subtle);
	text-decoration-thickness: 1px;
}

div.product .related ul.products .zai-product-card__price ins {
	color: var(--zai-green);
	text-decoration: none;
	font-weight: var(--zai-fw-semibold);
}

/* One-line price range so a compact card keeps a predictable height. */
div.product .related ul.products .zai-product-card__price .woocommerce-Price-amount {
	white-space: nowrap;
}

/* The purchase action sits at the bottom of every card, aligned across the row. */
div.product .related ul.products .zai-product-card__actions {
	margin-block-start: auto;
	padding-block-start: var(--zai-space-3);
}

div.product .related ul.products .zai-product-card__action {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--zai-control-height-sm);
	padding: var(--zai-space-2) var(--zai-space-3);
	background-color: transparent;
	border: var(--zai-border-width) solid var(--zai-border-color-strong);
	border-radius: var(--zai-radius);
	font-family: var(--zai-font-body);
	font-size: var(--zai-fs-xs);
	font-weight: var(--zai-fw-semibold);
	line-height: var(--zai-lh-normal);
	letter-spacing: var(--zai-ls-wide);
	text-align: center;
	text-decoration: none;
	white-space: normal;
	overflow-wrap: anywhere;
	color: var(--zai-ink);
	cursor: pointer;
	transition:
		background-color var(--zai-dur-fast) var(--zai-ease),
		border-color var(--zai-dur-fast) var(--zai-ease),
		color var(--zai-dur-fast) var(--zai-ease);
}

div.product .related ul.products .zai-product-card__action:hover {
	background-color: var(--zai-ink);
	border-color: var(--zai-ink);
	color: var(--zai-text-inverse);
}

div.product .related ul.products .zai-product-card__action:focus-visible {
	outline: var(--zai-focus-width) solid var(--zai-focus-color);
	outline-offset: var(--zai-focus-offset);
}

div.product .related ul.products .zai-product-card__action--add {
	background-color: var(--zai-green);
	border-color: var(--zai-green);
	color: var(--zai-text-inverse);
}

div.product .related ul.products .zai-product-card__action--add:hover {
	background-color: var(--zai-green-hover);
	border-color: var(--zai-green-hover);
	color: var(--zai-text-inverse);
}

/* Cross-sells kept as a list when they are rendered outside a carousel track. */
.zai-single__cross-sells ul.products {
	display: grid;
	gap: var(--zai-grid-gap);
	grid-template-columns: minmax(0, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

.zai-single__cross-sells ul.products > li {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
}


/* ==========================================================================
   8b. Responsive refinements
   -----------------------------------------------------------------------------
   PHASE 9. The two-column split stays at 1024px (Phase 8.2 established that
   below it a 50/50 split squeezes both halves). What changes here is the rhythm
   and the purchase panel's internal layout at each width.

   Bracket 1 â€” < 768px (phones)
     Gallery first, then title, price, description, profile, purchase panel.
     The primary action owns the full row; quantity sits above it so the tap
     target is never a narrow strip beside a stepper.
     The purchase panel drops its horizontal padding to 16px so a 360px screen
     keeps a usable measure and never overflows horizontally.

   Bracket 2 â€” 768â€“1023px (tablets)
     Everything is full width. Quantity and the action return to one row, which
     is comfortable at this measure and keeps the panel from growing tall.

   Bracket 3 â€” â‰¥ 1024px (desktop)
     The pair is side by side; the panel keeps quantity + action on one row.
   ========================================================================== */

@media (max-width: 767px) {
	/*
	 * The panel's own padding is reduced, but its border and surface are kept so
	 * it still reads as one purchase block rather than as loose controls.
	 */
	.zai-purchase {
		margin-block-start: var(--zai-space-4);
		padding: var(--zai-space-4);
	}

	/* Quantity above the button, both full width: no narrow tap targets. */
	div.product form.cart .quantity {
		flex: 1 0 100%;
	}

	div.product form.cart div.quantity .qty {
		width: 100%;
		max-width: 8rem;
	}

	/*
	 * The specification panel's label column collapses to a stacked label above
	 * the value, which is already the rule at <480px; reasserted here so a long
	 * attribute name can never crush the value column on a large phone.
	 */
	div.product .woocommerce-tabs .panel .zai-spec__row {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--zai-space-1);
	}

	/* The tab list scrolls instead of wrapping into three short rows. */
	div.product .woocommerce-tabs ul.tabs {
		gap: var(--zai-space-2) var(--zai-space-4);
	}

	/*
	 * PHASE 9.1 â€” the green highlights plate.
	 *
	 * On mobile `div.product` is block flow, so the plate keeps its natural
	 * document position: after the summary (image â†’ information â†’ purchase
	 * controls) and before the tabs. It is explicitly NOT placed between the
	 * image and the purchase controls. Only its top margin is trimmed here, so
	 * it reads as the start of the lower information area rather than as a
	 * detached card.
	 */
	.zai-highlights {
		margin-block-start: var(--zai-space-5);
		padding: var(--zai-space-4);
	}
}

@media (min-width: 768px) {
	/* Quantity + action share one row from tablet up. */
	div.product form.cart .quantity {
		flex: 0 0 auto;
	}
}

/*
 * Very wide screens: keep the gallery from towering over the purchase column.
 * The cap only shrinks the stage, so the natural aspect ratio is preserved and
 * the packaging is never cropped or letterboxed.
 */
@media (min-width: 1600px) {
	div.product div.images {
		max-width: 34rem;
		margin-inline: auto;
	}
}

/* ==========================================================================
   9. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	div.product div.images .flex-control-thumbs img {
		transition: none;
	}

	/* PHASE 9 â€” the pill hover/selected transitions are decorative. */
	.zai-sizes__pill {
		transition: none;
	}
}

