/**
 * Shop pages — /shop/ and its child "product" pages.
 *
 * Plain WordPress pages built from core blocks, laid out like a
 * Shopify/WooCommerce product page (gallery + buy box, accordion
 * details, inline inquiry form) without any commerce plugin. Each
 * component is opted into with an "Additional CSS class" set on the
 * block in the editor, so nothing else on the site is affected.
 * Colors/fonts come from theme.json presets only.
 */

/* /shop/ page title, sized like the homepage "Projects" heading. */
.shop-hub-title {
	font-size: clamp(3.5rem, 10vw, 6rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1;
}

/* /shop/ header row: title left, intro right, both resting on the
   bottom edge so the product grid starts high on the page. */
.shop-hub-head .shop-hub-title,
.shop-hub-head .shop-lede {
	margin-bottom: 0;
}

.shop-hub-head .shop-lede {
	max-width: 34ch;
	margin-left: auto;
	margin-right: 0;
}

@media (max-width: 781px) {
	.shop-hub-head .shop-lede {
		margin-left: 0;
	}
}

/* Product cards: equal weight. Two equal columns (one on phones), every
   photo in the same 4:3 frame, like the "Featured products, 2 columns"
   and "Services, 3 columns" patterns. Portrait photos crop into that
   frame; each product page can set its own focal point
   (`_shop_card_focal` meta, see functions.php) so the whole piece stays
   in view. */
.shop-grid .wp-block-post-featured-image img {
	aspect-ratio: 4 / 3 !important;
}

@media (min-width: 782px) {
	.shop-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}
}

.shop-grid .wp-block-post-title {
	margin-top: var(--wp--preset--spacing--20);
}

/* Short screens (small laptops, browser windows with toolbars): the title
   also scales with viewport height and the header tightens, so the
   product photos start high on the page. */
.is-shop .shop-hub-head .shop-hub-title {
	font-size: clamp(3rem, min(10vw, 14vh), 6rem);
}

@media (min-width: 782px) and (max-height: 760px) {
	.is-shop .wp-block-post-content > .wp-block-group:first-child {
		padding-top: var(--wp--preset--spacing--30) !important;
		padding-bottom: var(--wp--preset--spacing--30) !important;
	}
}

/* Breadcrumb ("Shop / Walnut Farmhouse Table"). */
.shop-breadcrumb {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--accent-4);
}

.shop-breadcrumb a {
	color: inherit;
}

/* Status pill: "Available · 1 of 1". Swap the class to .is-sold when it sells. */
.shop-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	width: fit-content;
	padding: 0.35em 0.9em;
	border-radius: 9999px;
	background: color-mix(in srgb, #1b6e3a 12%, var(--wp--preset--color--base));
	color: #1b6e3a; /* same success tone as the contact form; 6.3:1 on white */
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.shop-badge::before {
	content: "";
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: currentColor;
}

.shop-badge.is-sold {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 8%, var(--wp--preset--color--base));
	color: var(--wp--preset--color--contrast);
}

/* Thumbnails stay one row of four on phones (core drops to two columns),
   so the title and CTA aren't pushed far below the main photo. */
@media (max-width: 599px) {
	.shop-thumbs.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: calc(25% - var(--wp--style--unstable-gallery-gap, 16px) * 0.75);
	}
}

/* Buy box: sticks beside the gallery on wide screens. */
@media (min-width: 782px) {
	.shop-buybox {
		position: sticky;
		top: var(--wp--preset--spacing--40);
	}
}

.shop-price {
	margin: 0;
}

/* Spec list in the buy box and details: checkmark bullets. */
.shop-checklist {
	padding-left: 0;
	list-style: none;
}

.shop-checklist li {
	position: relative;
	padding-left: 1.75em;
}

.shop-checklist li + li {
	margin-top: 0.4em;
}

.shop-checklist li::before {
	content: "✓";
	position: absolute;
	left: 0;
	font-weight: 700;
}

/* Accordion (core/details), Shopify "collapsible tab" style. */
.shop-accordion .wp-block-details {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
	padding-block: var(--wp--preset--spacing--30);
	margin-block-start: 0;
}

.shop-accordion .wp-block-details:first-child {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
}

.shop-accordion summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.shop-accordion summary::-webkit-details-marker {
	display: none;
}

/* Taken out of flow so the hover underline doesn't run under the icon. */
.shop-accordion summary::after {
	content: "+";
	position: absolute;
	top: 50%;
	right: 0.5rem;
	translate: 0 -50%;
	font-size: 1.5em;
	font-weight: 300;
	line-height: 1;
	transition: transform 0.3s ease;
}

/* Open: the plus turns into a close ×. */
.shop-accordion details[open] summary::after {
	transform: rotate(45deg);
}

.shop-accordion summary:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

/* Focus: the whole row lights up in the brand yellow, like the BUY
   buttons. A click leaves the soft wash on the row you just opened;
   keyboard focus adds the site's 2px contrast ring. The row bleeds
   0.5rem past the text so the wash has room without shifting anything. */
.shop-accordion summary {
	position: relative;
	margin-inline: -0.5rem;
	padding: 0.375rem 2.5rem 0.375rem 0.5rem;
	border-radius: 2px;
	transition: background-color 0.2s ease;
}

.shop-accordion summary:focus {
	outline: none;
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-1) 35%, transparent);
}

.shop-accordion summary:focus-visible {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-1) 55%, transparent);
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
	text-decoration: none;
}

.shop-accordion summary:focus-visible::after {
	font-weight: 400;
}

/* Open and close: the panel slides to its height and fades. Browsers
   without ::details-content get a fade-in on open instead. */
.shop-accordion .wp-block-details {
	interpolate-size: allow-keywords;
}

.shop-accordion .wp-block-details::details-content {
	block-size: 0;
	overflow: hidden;
	opacity: 0;
	transition: block-size 0.3s ease, opacity 0.3s ease, content-visibility 0.3s allow-discrete;
}

.shop-accordion .wp-block-details[open]::details-content {
	block-size: auto;
	opacity: 1;
}

@supports not selector(::details-content) {
	.shop-accordion details[open] > :not(summary) {
		animation: shop-accordion-open 0.3s ease-out;
	}
}

@keyframes shop-accordion-open {
	from {
		opacity: 0;
		transform: translateY(-0.25rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.shop-accordion summary,
	.shop-accordion summary::after,
	.shop-accordion .wp-block-details::details-content {
		transition: none;
	}

	.shop-accordion details[open] > :not(summary) {
		animation: none;
	}
}

/* Numbered "How buying works" steps. */
.shop-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.875rem;
	font-weight: 500;
}

/* Inquiry form: style the select the base contact-form.css doesn't cover. */
.shop-inquiry .wpcf7 select {
	box-sizing: border-box;
	width: 100%;
	min-height: 3.5rem;
	padding: 1rem;
	border: 0;
	border-bottom: 1px solid var(--cf-line);
	border-radius: var(--cf-radius) var(--cf-radius) 0 0;
	background: var(--cf-surface);
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: 1rem;
}

.shop-inquiry .wpcf7 textarea {
	min-height: 7rem;
	height: 8rem;
}

/* Anchor targets clear the top of the viewport a little. */
#inquire,
#how-buying-works {
	scroll-margin-top: var(--wp--preset--spacing--40);
}

/* Sections focused by assets/js/shop-anchor-scroll.js after a "#" link
   scroll: no focus ring on a whole section. */
.is-shop [tabindex="-1"]:focus {
	outline: none;
}

/* Sticky "Ask about it" bar on phones, like a mobile add-to-cart bar. */
.shop-sticky-cta {
	display: none;
}

@media (max-width: 781px) {
	.shop-sticky-cta {
		position: fixed;
		inset: auto 0 0 0;
		z-index: 50;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		margin: 0 !important;
		padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
		background: var(--wp--preset--color--base);
		border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
	}

	.shop-sticky-cta p {
		margin: 0;
		font-size: var(--wp--preset--font-size--small);
		line-height: 1.3;
	}

	.shop-sticky-cta .wp-block-buttons {
		flex-shrink: 0;
	}

	.shop-sticky-cta .wp-block-button__link {
		padding: 0.75em 1.25em;
		font-size: var(--wp--preset--font-size--small);
		white-space: nowrap;
	}

	body:has(.shop-sticky-cta) {
		padding-bottom: 5rem;
	}
}


/* ------------------------------------------------------------------
 * Shop typography
 *
 * Two voices, both already in the brand:
 *   Manrope   — display and reading. Display set heavy and tight, reading
 *               text one step up from the theme's 300 weight for contrast.
 *   Fira Code — the label voice (the logo/hero face): eyebrows, breadcrumb,
 *               badge, spec labels, numbers, captions, form labels. Always
 *               small, uppercase and tracked out.
 * Scoped to body.is-shop (set in functions.php) so no other page changes.
 * ------------------------------------------------------------------ */
.is-shop {
	--shop-mono: var(--wp--preset--font-family--fira-code);
	--shop-muted: var(--wp--preset--color--accent-4);
	--shop-rule: color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
}

.is-shop main {
	font-weight: 400;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
}

.is-shop main p,
.is-shop main li {
	text-wrap: pretty;
}

.is-shop main :is(h1, h2, h3) {
	text-wrap: balance;
	font-feature-settings: "kern", "liga";
}

/* Label voice ------------------------------------------------------ */
.shop-eyebrow,
.shop-breadcrumb,
.shop-index,
.shop-specs strong,
.is-shop .wp-element-caption,
.is-shop .shop-inquiry .wpcf7 label,
.shop-sticky-cta span {
	font-family: var(--shop-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.shop-eyebrow {
	margin-bottom: 0.75rem !important;
	color: var(--shop-muted);
}

/* Eyebrow sits tight to its heading. */
.shop-eyebrow + .wp-block-heading {
	margin-top: 0 !important;
}

/* Breadcrumb spans the wide grid so it lines up with the gallery edge. */
.is-shop .shop-breadcrumb {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-bottom: var(--wp--preset--spacing--30);
}

.shop-breadcrumb a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.is-shop .wp-element-caption {
	margin-top: 0.75rem;
	color: var(--shop-muted);
	text-align: left;
}

.shop-index {
	margin-bottom: 0.5rem !important;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--shop-rule);
	color: var(--shop-muted);
}

/* Display ---------------------------------------------------------- */
.is-shop .shop-title {
	font-size: clamp(2.5rem, 1.6rem + 2.6vw, 3.75rem);
	font-weight: 600;
	line-height: 1.02;
	letter-spacing: -0.035em;
}

.is-shop .shop-hub-title {
	letter-spacing: -0.04em;
}

.is-shop .shop-h2 {
	font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.is-shop .shop-h3 {
	font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.shop-card-title a {
	text-decoration: none;
}

.shop-card-title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* Reading ---------------------------------------------------------- */
.is-shop .shop-subline {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	color: var(--shop-muted);
	font-variant-numeric: tabular-nums;
}

.is-shop .shop-lede {
	max-width: 38ch;
	font-size: clamp(1.125rem, 1rem + 0.35vw, 1.3125rem);
	line-height: 1.5;
}

.is-shop .shop-accordion .wp-block-details p,
.is-shop .shop-accordion .wp-block-details li,
.shop-checklist li,
.is-shop .is-style-section-1 .wp-block-column > p:not([class]) {
	font-size: 1.0625rem;
	line-height: 1.6;
}

.is-shop .shop-accordion summary {
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.shop-textlink {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

/* Price: label over a confident line, note in the muted tone. */
.shop-price-block > * {
	margin-block: 0;
}

.shop-price-block .shop-eyebrow {
	margin-bottom: 0.25rem !important;
}

.is-shop .shop-price {
	font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

/* Reassurance line under the purchase form's BUY button. */
.shop-inquiry .shop-form-note {
	margin-top: 0.75rem;
	color: var(--shop-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* A real number reads bigger than the "Contact for pricing" line. */
.is-shop .shop-price.is-amount {
	width: fit-content;
	/* Brand-yellow highlighter swipe, same yellow as the BUY button. */
	padding: 0.05em 0.25em;
	margin-inline-start: -0.25em;
	background: linear-gradient(104deg, transparent 0.15em, var(--wp--preset--color--accent-1) 0.15em, var(--wp--preset--color--accent-1) calc(100% - 0.15em), transparent calc(100% - 0.15em)) 0 70% / 100% 62% no-repeat;
	font-size: clamp(1.875rem, 1.6rem + 1.1vw, 2.5rem);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.shop-note {
	margin-top: 0.35rem !important;
	font-size: var(--wp--preset--font-size--small);
	color: var(--shop-muted);
}

/* Spec sheet: mono label column, value column, hairline rules between
   rows only. */
.shop-specs {
	margin: 0;
	padding: 0;
	list-style: none;
	font-variant-numeric: tabular-nums;
}

.shop-specs li {
	display: grid;
	grid-template-columns: 7.5rem 1fr;
	gap: 1rem;
	align-items: baseline;
	padding-block: 0.7rem;
	font-size: 1rem;
	line-height: 1.45;
}

.shop-specs li + li {
	border-top: 1px solid var(--shop-rule);
}

.shop-specs strong {
	color: var(--shop-muted);
}

@media (max-width: 599px) {
	.shop-specs li {
		grid-template-columns: 5.75rem 1fr;
		gap: 0.75rem;
	}
}

/* Buttons and form ------------------------------------------------- */
.is-shop main .wp-block-button__link {
	font-weight: 600;
	letter-spacing: 0.01em;
}

.is-shop .shop-inquiry .wpcf7 label {
	color: var(--shop-muted);
}

/* Fields sit inside the mono labels; keep what people type in Manrope. */
.is-shop .shop-inquiry .wpcf7 :is(input, textarea, select) {
	font-family: var(--wp--preset--font-family--manrope);
	letter-spacing: normal;
	text-transform: none;
}

.is-shop .shop-inquiry .wpcf7 input[type="submit"] {
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* Sticky bar: item name strong, price line in the label voice. */
.shop-sticky-cta strong {
	font-weight: 600;
	letter-spacing: -0.01em;
}

.shop-sticky-cta span {
	color: var(--shop-muted);
	font-size: 0.6875rem;
}

/* Hub grid card titles: same mono uppercase as the homepage cards, tracked tighter. */
.is-shop .wp-block-post-title {
	letter-spacing: 0.02em;
	line-height: 1.2;
}

/* ------------------------------------------------------------------
 * Layout B (comparison): TT5 "Grid with categories" style. The intro is
 * the first cell of a three-column grid and the product cards fill the
 * rest, so products start at the top of the page. The Query and Post
 * Template wrappers use `display: contents`, which makes each product
 * card a direct grid item beside the intro; more products wrap into
 * rows of three. One column on phones.
 * ------------------------------------------------------------------ */
.shop-intro-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
}

.shop-intro-grid > * {
	margin-block: 0 !important;
}

.shop-intro-cell .shop-hub-title {
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--30);
}

.shop-intro-cell .shop-lede {
	max-width: 30ch;
}

@media (min-width: 782px) {
	.shop-intro-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		align-items: start;
	}

	.shop-intro-grid > .wp-block-query,
	.shop-intro-grid .wp-block-post-template.is-layout-grid {
		display: contents;
	}

	/* Intro cell: vertically centered against the product cards in its row. */
	.shop-intro-cell {
		align-self: center;
		padding-right: var(--wp--preset--spacing--30);
	}
}

/* "How buying works": number, headline and text stacked and centered. */
.shop-steps .shop-step-number {
	display: flex;
	margin-inline: auto;
	margin-bottom: var(--wp--preset--spacing--20);
}

.shop-steps .wp-block-heading {
	margin-bottom: 0.5rem;
}

/* Step copy is written to run two lines; balance keeps them even. */
.shop-steps .wp-block-column > p:not(.shop-step-number) {
	max-width: 26ch;
	margin-inline: auto;
	text-wrap: balance;
}

/* More room between a section heading and its columns ("How buying
   works", "Handmade furniture, straight from the maker"). */
.is-shop .shop-h2:has(+ .shop-steps),
.is-shop .shop-h2:has(+ .shop-trust) {
	margin-bottom: var(--wp--preset--spacing--60);
}

/* Full-width sections sit flush (no default block gap between them), so
   each section's own padding sets its spacing: top and bottom stay equal,
   and no white strip shows above the tinted sections. */
.is-shop .wp-block-post-content > .alignfull {
	margin-block-start: 0;
}

/* ------------------------------------------------------------------
 * Product card CTA ("View details" in the /shop/ grid)
 *
 * A filled pill in the site's action yellow (same as Contact and "Ask if
 * it's available"), sized for touch. The whole card is one click target:
 * the CTA's ::before stretches over the card, so hovering anywhere on it
 * zooms the photo, darkens the button and nudges its arrow.
 * ------------------------------------------------------------------ */
.shop-grid .wp-block-post-template > li {
	position: relative;
}

.shop-grid .wp-block-read-more {
	position: static;
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.6em;
	box-sizing: border-box;
	min-height: 3rem;
	margin-top: var(--wp--preset--spacing--20);
	padding: 0.85em 1.6em;
	border-radius: 9999px;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.shop-grid .wp-block-read-more::after {
	content: "→";
	transition: transform 0.2s ease;
}

/* Stretched link: the card's whole area clicks through to the product. */
.shop-grid .wp-block-read-more::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.shop-grid li:hover .wp-block-read-more,
.shop-grid .wp-block-read-more:focus-visible {
	background: color-mix(in srgb, var(--wp--preset--color--accent-1) 85%, black);
	box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--wp--preset--color--contrast) 45%, transparent);
}

.shop-grid li:hover .wp-block-read-more::after,
.shop-grid .wp-block-read-more:focus-visible::after {
	transform: translateX(0.3em);
}

.shop-grid .wp-block-read-more:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
}

/* The stretched link covers the photo, so the zoom keys off the card. */
.shop-grid li:hover .is-style-zoom-hover img {
	transform: scale(1.05);
}

.shop-grid li:hover .wp-block-post-title a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
	.shop-grid .wp-block-read-more::after {
		transition: none;
	}

	.shop-grid li:hover .wp-block-read-more::after,
	.shop-grid li:hover .is-style-zoom-hover img {
		transform: none;
	}
}

/* ------------------------------------------------------------------
 * /shop/ product section: wider stage + card footer row
 *
 * The intro + product grid breaks out of the 1340px wide size: full width
 * (inside the page gutter) on laptops, capped at 1920px on big monitors,
 * so the product photos get more room. Under each photo the title (~60%)
 * and the "View details" button (~40%) share one row; on a narrow card
 * the button wraps under the title.
 * ------------------------------------------------------------------ */
.is-shop .wp-block-group.shop-intro-grid.alignwide {
	max-width: min(1920px, 100%) !important;
}

.shop-card-foot {
	width: 100%;
	margin-top: var(--wp--preset--spacing--20);
	row-gap: var(--wp--preset--spacing--20);
	column-gap: var(--wp--preset--spacing--30);
}

/* Title takes whatever the button leaves (about 60% on laptop and up) and
   scales with the window so "WALNUT FARMHOUSE" fits on one line beside
   the button from ~1280px up. Below that, the button wraps under. */
.shop-card-foot .wp-block-post-title {
	flex: 1 1 0;
	min-width: 11rem;
	margin: 0 !important;
	font-size: clamp(1.125rem, 0.25rem + 1.1vw, 1.5rem) !important;
}

.shop-card-foot .wp-block-read-more {
	flex: 0 0 auto;
	align-self: center;
	margin: 0 !important;
}

/* ------------------------------------------------------------------
 * Product photo carousel + lightbox (assets/js/shop-gallery.js)
 *
 * The gallery column (Column block, class "shop-gallery") is a main
 * Image block and a Gallery block in the editor; the script rebuilds it
 * as a swipeable carousel with a thumbnail strip, and each slide opens a
 * full-screen lightbox. Both tracks are scroll-snap rows.
 * ------------------------------------------------------------------ */
.shop-carousel {
	--shop-thumb-gap: 0.5rem;
}

.shop-carousel__stage,
.shop-lightbox__stage {
	position: relative;
}

.shop-carousel__track,
.shop-lightbox__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.shop-carousel__track::-webkit-scrollbar,
.shop-lightbox__track::-webkit-scrollbar,
.shop-carousel__thumbs::-webkit-scrollbar,
.shop-lightbox__thumbs::-webkit-scrollbar {
	display: none;
}

.shop-carousel__slide,
.shop-lightbox__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/* Every slide in the same 4:5 frame as the old main photo. */
.shop-carousel__open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 5%, var(--wp--preset--color--base));
	cursor: zoom-in;
}

/* On short screens the frame gets shorter (cropping a little more) so the
   thumbnail strip still shows above the fold beside the buy box. Stacked
   on tablets, it stops at about two-thirds of the screen so the title
   isn't pushed far down. */
.shop-carousel__open img {
	display: block;
	width: 100%;
	height: auto;
	max-height: max(20rem, calc(100svh - 17rem));
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

@media (max-width: 781px) {
	.shop-carousel__open img {
		max-height: max(20rem, 65svh);
	}
}

.shop-carousel__open:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: -4px;
}

/* Round arrow buttons over the photo. */
.shop-carousel__nav,
.shop-lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--wp--preset--color--contrast) 40%, transparent);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.shop-carousel__nav.is-prev,
.shop-lightbox__nav.is-prev {
	left: 0.75rem;
}

.shop-carousel__nav.is-next,
.shop-lightbox__nav.is-next {
	right: 0.75rem;
}

.shop-carousel__nav:hover,
.shop-lightbox__nav:hover {
	background: var(--wp--preset--color--base);
}

.shop-carousel__nav:disabled,
.shop-lightbox__nav:disabled {
	opacity: 0;
	pointer-events: none;
}

.shop-carousel__nav:focus-visible,
.shop-lightbox__nav:focus-visible,
.shop-lightbox__close:focus-visible,
.shop-carousel__thumb:focus-visible,
.shop-lightbox__thumb:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

/* On mouse devices the inline arrows appear on hover; touch swipes. */
@media (hover: hover) and (pointer: fine) {
	.shop-carousel__nav {
		opacity: 0;
	}

	.shop-carousel__stage:hover .shop-carousel__nav:not(:disabled),
	.shop-carousel__nav:focus-visible {
		opacity: 1;
	}
}

/* "2 / 5" counter and the expand hint, as small pills on the photo. */
.shop-carousel__count,
.shop-carousel__hint {
	position: absolute;
	bottom: 0.75rem;
	margin: 0;
	padding: 0.35em 0.75em;
	border-radius: 9999px;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	color: var(--wp--preset--color--contrast);
	pointer-events: none;
}

.shop-carousel__count {
	left: 0.75rem;
}

.shop-carousel__hint {
	right: 0.75rem;
	display: grid;
	place-items: center;
	padding: 0.45em;
}

.shop-carousel__count,
.shop-lightbox__count {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	font-variant-numeric: tabular-nums;
}

.is-shop .shop-carousel__caption {
	min-height: 1.4em;
}

.is-shop .shop-carousel__caption:empty {
	visibility: hidden;
}

/* Thumbnail strip: five across up to 5rem each, scrolls sideways when
   there are more. */
.shop-carousel__thumbs,
.shop-lightbox__thumbs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: min(calc((100% - 4 * var(--shop-thumb-gap, 0.5rem)) / 5), 5rem);
	gap: var(--shop-thumb-gap, 0.5rem);
	overflow-x: auto;
	scrollbar-width: none;
}

.shop-carousel__thumbs {
	margin-top: var(--wp--preset--spacing--20);
	padding: 3px; /* room for the active outline */
}

.shop-carousel__thumb,
.shop-lightbox__thumb {
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.shop-carousel__thumb img,
.shop-lightbox__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
}

.shop-carousel__thumb:hover,
.shop-lightbox__thumb:hover,
.shop-carousel__thumb[aria-current="true"],
.shop-lightbox__thumb[aria-current="true"] {
	opacity: 1;
}

.shop-carousel__thumb[aria-current="true"],
.shop-lightbox__thumb[aria-current="true"] {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 1px;
}

/* Lightbox: full screen on the page background, photo fitted whole,
   thumbnails along the bottom. */
.shop-lightbox {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.shop-lightbox[open] {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	animation: shop-lightbox-fade-in 0.25s ease-out;
}

.shop-lightbox::backdrop {
	background: var(--wp--preset--color--base);
}

.shop-lightbox[open]::backdrop {
	animation: shop-lightbox-fade-in 0.25s ease-out;
}

/* Closing: shop-gallery.js adds this class, waits for the animation to
   end, then calls dialog.close(). */
.shop-lightbox.is-closing,
.shop-lightbox.is-closing::backdrop {
	animation: shop-lightbox-fade-out 0.2s ease-in forwards;
}

@keyframes shop-lightbox-fade-in {
	from {
		opacity: 0;
	}
}

@keyframes shop-lightbox-fade-out {
	to {
		opacity: 0;
	}
}

html:has(.shop-lightbox[open]) {
	overflow: hidden;
}

.shop-lightbox__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0.75rem 0.75rem var(--wp--preset--spacing--30);
}

.shop-lightbox__count {
	margin: 0;
}

.shop-lightbox__close {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	cursor: pointer;
}

.shop-lightbox__close:hover {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
}

.shop-lightbox__stage,
.shop-lightbox__track {
	min-height: 0;
	height: 100%;
}

.shop-lightbox__slide {
	display: flex;
	box-sizing: border-box;
	padding: 0 var(--wp--preset--spacing--50);
}

/* The image box fills the slide; object-fit shows the whole photo. */
.shop-lightbox__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.shop-lightbox__thumbs {
	--shop-thumb-gap: 0.5rem;
	grid-auto-columns: 4.5rem;
	justify-content: center;
	padding: 1rem var(--wp--preset--spacing--30) calc(1rem + env(safe-area-inset-bottom));
}

@media (max-width: 781px) {
	.shop-lightbox__slide {
		padding: 0;
	}

	.shop-lightbox__nav {
		display: none;
	}

	.shop-lightbox__thumbs {
		grid-auto-columns: 3.5rem;
		justify-content: start;
	}
}

/* Phones turned sideways: the photo gets the height; swipe, arrows and
   the counter still step through. */
@media (max-height: 500px) {
	.shop-lightbox__bar {
		padding-block: 0.25rem;
	}

	.shop-lightbox__thumbs {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shop-carousel__nav,
	.shop-lightbox__nav,
	.shop-carousel__thumb,
	.shop-lightbox__thumb {
		transition: none;
	}

	.shop-lightbox[open],
	.shop-lightbox[open]::backdrop,
	.shop-lightbox.is-closing,
	.shop-lightbox.is-closing::backdrop {
		animation: none;
	}
}

/* ------------------------------------------------------------------
 * Highlights: headings share one row height, so every description
 * starts on the same line even when one heading wraps to two lines.
 * Each column spans three rows of the parent grid (index, heading,
 * text) and reuses those rows through subgrid. Phones stack as before.
 * ------------------------------------------------------------------ */
@media (min-width: 782px) {
	.is-shop .wp-block-columns:has(> .wp-block-column > .shop-index:first-child) {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		grid-template-rows: auto auto 1fr;
		row-gap: 0;
	}

	.is-shop .wp-block-columns:has(> .wp-block-column > .shop-index:first-child) > .wp-block-column {
		display: grid;
		grid-row: span 3;
		grid-template-rows: subgrid;
		row-gap: 0;
		align-content: start;
	}
}

/* ------------------------------------------------------------------
 * Buy box price: "PRICE" label and the amount share one row, the label
 * centered on the amount; the note under them keeps its own line. Phones keep
 * the stacked label-over-price layout.
 * ------------------------------------------------------------------ */
@media (min-width: 782px) {
	.shop-buybox .shop-price-block {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		column-gap: 1.25rem;
	}

	.shop-buybox .shop-price-block .shop-eyebrow {
		margin-bottom: 0 !important;
	}

	.shop-buybox .shop-price-block .shop-note {
		flex-basis: 100%;
	}
}
