/*
 * WooCommerce styling. Loaded only on store pages (see inc/enqueue.php).
 *
 * This store is block-based: the catalogue grid, single product, cart and
 * checkout are all Gutenberg/Store-API blocks (`.wc-block-*`). My Account and
 * the downloads table are still classic PHP templates (`.woocommerce-*`).
 * Both naming families therefore appear below, grouped by surface.
 *
 * No PHP template overrides are shipped with this sheet — everything here is
 * presentational, so WooCommerce keeps its own markup, hooks and template
 * variables intact and stays upgrade-safe.
 *
 * ---------------------------------------------------------------------------
 * Colour and contrast
 * ---------------------------------------------------------------------------
 * All colour comes from the theme.json palette via custom properties, with one
 * documented exception (`--mts-brass-text`, below).
 *
 * Brass `--primary` (#a8712a) measures 3.78:1 on cream and 3.34:1 on sand.
 * That is below the 4.5:1 WCAG AA threshold for normal-size text, so brass is
 * used here only for rules, borders, icons and other non-text accents — never
 * to carry body copy. Where a brass-toned *text* colour is needed, the
 * darkened `--mts-brass-text` is used instead.
 */

.woocommerce,
.woocommerce-page,
.wc-block-components-main,
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
	/*
	 * Darkened brass for text. #8a5c1f measures 5.26:1 on cream (--base) and
	 * 4.65:1 on sand (--base-2) — both WCAG AA for normal text.
	 *
	 * This is the one hex in the file that is not already a palette token.
	 * It belongs in theme.json as a `primary-dark` palette entry; that file is
	 * owned by another agent, so it is defined locally here and flagged in the
	 * hand-off notes rather than added unilaterally.
	 */
	--mts-brass-text: #8a5c1f;

	/* Hairlines and panel edges, so the store reads as one system. */
	--mts-rule: 1px solid var(--wp--preset--color--base-2);
	--mts-rule-strong: 2px solid var(--wp--preset--color--contrast);

	/* Minimum comfortable hit area. WCAG 2.5.8 (AA) requires 24×24 CSS px;
	   44px is the 2.5.5 (AAA) target and is used wherever layout allows. */
	--mts-touch: 44px;
	--mts-touch-min: 24px;
}

/* ==========================================================================
   1. Accessibility foundations
   ========================================================================== */

/*
 * style.css sets a global :focus-visible ring, but it is written with :where()
 * (zero specificity) so any WooCommerce rule with a real selector overrides it.
 * Several Woo block components ship `outline: none` or restyle focus on their
 * own. These re-assert the ring at a specificity that survives, scoped to the
 * store so the rest of the site keeps the global behaviour.
 */
.woocommerce :focus-visible,
.wc-block-components-main :focus-visible,
.wc-block-components-sidebar :focus-visible,
.wp-block-woocommerce-cart :focus-visible,
.wp-block-woocommerce-checkout :focus-visible,
.woocommerce-MyAccount-navigation a:focus-visible,
.woocommerce-MyAccount-content :focus-visible,
.wc-block-components-button:focus-visible,
.wc-block-components-quantity-selector__button:focus-visible,
.wc-block-cart-item__remove-link:focus-visible,
.wc-block-components-panel__button:focus-visible {
	outline: var(--wp--custom--focus-ring--width, 3px) solid var(--wp--preset--color--accent);
	outline-offset: var(--wp--custom--focus-ring--offset, 2px);
	border-radius: 2px;
}

/*
 * The accent red ring measures 6.65:1 against cream — comfortably past the
 * 3:1 WCAG 1.4.11 minimum for non-text indicators. On a dark surface it drops
 * to 2.59:1 and fails, so dark contexts switch to Brass Light, which measures
 * 8.01:1 on Stage Black.
 *
 * Duplicated from style.css deliberately. `body.woocommerce` means
 * `.woocommerce :focus-visible` above matches dark surfaces on store pages at
 * the same (0,2,0), and later-in-file has to win. Keep the two lists identical.
 *
 * The error notice is NOT in this list. It used to be, and that was a bug: it
 * is painted on Cream (see .is-error below), where Brass Light measures
 * 2.15:1 — the override was breaking a ring that already passed at 6.65:1, on
 * the Dismiss button a customer reaches only after a checkout error.
 */
.has-surface-dark-background-color :focus-visible,
.has-contrast-background-color :focus-visible,
.is-style-stage :focus-visible,
footer.wp-block-group :focus-visible {
	outline-color: var(--wp--preset--color--primary-light);
}

/* Woo renders some controls inside elements that clip the ring. */
.wc-block-cart-item__remove-link,
.wc-block-components-quantity-selector,
.woocommerce-MyAccount-navigation li {
	overflow: visible;
}

/* Keep the ring visible in Windows High Contrast / forced-colors mode. */
@media (forced-colors: active) {
	.woocommerce :focus-visible,
	.wc-block-components-main :focus-visible {
		outline: 3px solid CanvasText;
	}
}

/* ==========================================================================
   2. Buttons
   ========================================================================== */

/*
 * theme.json's global button hover pairs cream text on brass, which measures
 * 3.78:1 — under the 4.5:1 AA threshold for the 14px uppercase button label.
 * Store buttons therefore hover to the darkened brass instead: cream on
 * #8a5c1f is 5.26:1 (AA).
 *
 * The same fix is needed site-wide in theme.json; that file is owned by
 * another agent and is flagged in the hand-off notes.
 */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .wp-element-button,
.wc-block-components-button,
.woocommerce-MyAccount-downloads-file {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	border-radius: 2px;
	transition: background-color var(--wp--custom--transition--base, 180ms),
		border-color var(--wp--custom--transition--base, 180ms),
		color var(--wp--custom--transition--base, 180ms);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .wp-element-button:hover,
.wc-block-components-button:not(:disabled):hover,
.woocommerce-MyAccount-downloads-file:hover,
.wc-block-cart__submit-container .wc-block-components-button:hover,
.wc-block-checkout__actions .wc-block-components-button:hover {
	background-color: var(--mts-brass-text);
	border-color: var(--mts-brass-text);
	color: var(--wp--preset--color--base);
}

/* Primary store actions get a full-size, unmistakable target. */
.wc-block-cart__submit-container .wc-block-components-button,
.wc-block-checkout__actions .wc-block-components-button,
.woocommerce .single_add_to_cart_button {
	min-height: var(--mts-touch);
	width: 100%;
}

/*
 * Disabled states must still be legible, not just faded out.
 *
 * WooCommerce disables the variable-product add-to-cart button with a
 * `.disabled` *class* (plus `wc-variation-selection-needed`) rather than the
 * `disabled` attribute, and fades it with `opacity: .5`. Composited over the
 * cream page that leaves cream text on rgb(134,134,133) — 3.32:1.
 *
 * Inactive controls are exempt from WCAG 1.4.3, so this is not a strict AA
 * failure, but "choose an Edition first" is the one instruction a buyer needs
 * at that moment. Dropping the opacity in favour of a solid sand/slate pair
 * takes it to 6.54:1 (AA) and keeps the disabled affordance obvious through
 * the flattened fill and the not-allowed cursor.
 */
.wc-block-components-button:disabled,
.woocommerce .button:disabled,
.woocommerce button.button.disabled,
.woocommerce button.button.alt.disabled,
.woocommerce a.button.disabled,
.woocommerce a.button.alt.disabled,
.woocommerce input.button.disabled,
.woocommerce button.single_add_to_cart_button.disabled,
.woocommerce button[aria-disabled="true"] {
	background-color: var(--wp--preset--color--base-2);
	border-color: var(--wp--preset--color--contrast-2);
	color: var(--wp--preset--color--contrast-2); /* 6.54:1 on sand — AA */
	cursor: not-allowed;
	opacity: 1; /* Opacity fading is what usually breaks contrast here. */
}

/* ==========================================================================
   3. Notices  (success / info / warning / error)
   ========================================================================== */

/*
 * WooCommerce already ships an icon in every notice banner, so status is not
 * signalled by colour alone (WCAG 1.4.1). These rules keep that icon, add a
 * 4px colour-coded edge as a second non-colour cue (position + weight), and
 * move the palette onto the brand.
 */
.wc-block-components-notice-banner,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background-color: var(--wp--preset--color--base-2);
	border: var(--mts-rule);
	border-inline-start: 4px solid var(--wp--preset--color--contrast-2);
	border-radius: 2px;
	color: var(--wp--preset--color--contrast); /* 14.44:1 on sand — AAA */
	font-size: var(--wp--preset--font-size--small);
	margin-block: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--30) !important;
}

/*
 * The background is repeated on each variant because Woo scopes its own
 * tints to two classes (`.wc-block-components-notice-banner.is-success`
 * etc.), which outranks the single-class base rule above.
 */
.wc-block-components-notice-banner.is-success,
.woocommerce-message {
	background-color: var(--wp--preset--color--base-2);
	border-inline-start-color: var(--wp--preset--color--secondary);
}

.wc-block-components-notice-banner.is-info,
.woocommerce-info {
	background-color: var(--wp--preset--color--base-2);
	border-inline-start-color: var(--wp--preset--color--primary);
}

.wc-block-components-notice-banner.is-warning {
	background-color: var(--wp--preset--color--base-2);
	border-inline-start-color: var(--wp--preset--color--primary);
}

.wc-block-components-notice-banner.is-error,
.woocommerce-error {
	background-color: var(--wp--preset--color--base);
	border-inline-start-color: var(--wp--preset--color--accent);
}

/* Icon chip: brand colour behind, cream glyph. */
.wc-block-components-notice-banner > svg {
	background-color: var(--wp--preset--color--contrast-2);
	fill: var(--wp--preset--color--base); /* cream on slate — 7.41:1, AAA */
	border-radius: 50%;
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	padding: 3px;
}

.wc-block-components-notice-banner.is-success > svg {
	background-color: var(--wp--preset--color--secondary); /* 10.58:1 — AAA */
}

.wc-block-components-notice-banner.is-info > svg {
	/* Brass is a background here, not text: cream on brass is 3.78:1, which
	   clears the 3:1 WCAG 1.4.11 bar for a non-text graphic. */
	background-color: var(--wp--preset--color--primary);
}

.wc-block-components-notice-banner.is-error > svg {
	background-color: var(--wp--preset--color--accent); /* 6.65:1 — AA */
}

.wc-block-components-notice-banner__summary {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/*
 * Woo pins the dismiss button to 16×16 with !important, which is below the
 * 24×24 minimum in WCAG 2.5.8 (AA). Matching !important is the only way to
 * win here; the glyph stays 16px while the hit area grows to 24px.
 */
.wc-block-components-notice-banner > .wc-block-components-button {
	width: var(--mts-touch-min) !important;
	height: var(--mts-touch-min) !important;
	flex: 0 0 var(--mts-touch-min) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	opacity: 1;
	color: var(--wp--preset--color--contrast) !important;
}

/* Inline "View cart" style links inside notices. */
.wc-block-components-notice-banner .wc-forward {
	color: var(--wp--preset--color--secondary) !important; /* 9.34:1 — AAA */
	opacity: 1;
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-underline-offset: 0.18em;
}

/* ==========================================================================
   4. Form fields
   ========================================================================== */

.woocommerce input.input-text,
.woocommerce textarea,
.woocommerce select,
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-block-components-select__select {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--contrast);
	background-color: #fff;
	border: 1px solid var(--wp--preset--color--contrast-2);
	border-radius: 2px;
	min-height: var(--mts-touch);
	padding: 0.6em 0.8em;
}

/*
 * Placeholder text still has to meet 4.5:1 where it carries meaning. Slate on
 * white measures 8.14:1 (AAA); the browser default grey does not qualify.
 */
.woocommerce ::placeholder,
.wc-block-components-text-input input::placeholder {
	color: var(--wp--preset--color--contrast-2);
	opacity: 1;
}

.woocommerce label,
.wc-block-components-checkout-step__title,
.wc-block-components-text-input label {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

/* Required marker: never colour-alone — the asterisk is a glyph. */
.woocommerce .required,
.wc-block-components-label__required {
	color: var(--wp--preset--color--accent); /* 6.65:1 — AA */
	text-decoration: none;
}

/*
 * Validation. WooCommerce sets role="alert" and aria-invalid on the field, so
 * errors are announced already — verified in Woo's shipped block bundle. These
 * rules only restyle: Woo's default #cc1818 is replaced with the palette's
 * accent red, and a left border adds a non-colour cue.
 */
.wc-block-components-validation-error,
.woocommerce-error li {
	color: var(--wp--preset--color--accent); /* 6.65:1 on cream — AA */
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-validation-error > p {
	gap: 0.35em;
	font-weight: 500;
}

/* Invalid fields get a heavier border as well as a colour change. */
.woocommerce input[aria-invalid="true"],
.wc-block-components-text-input.has-error input,
input[aria-invalid="true"] {
	border-color: var(--wp--preset--color--accent);
	border-width: 2px;
}

/* ==========================================================================
   5. Catalogue — layout, browse, filter, search, product cards
   ==========================================================================

   The shop, the product-category archives and the product search results all
   render templates/{archive-product,taxonomy-product_cat,product-search-
   results}.html, which share one structure:

     main.mts-shop
       .mts-shop-header            title + intro / term description
       .mts-shop-layout            core/columns, wide
         .mts-shop-layout__aside   aside.mts-shop-sidebar
           .mts-shop-panel--search core/search scoped to post_type=product
           .mts-shop-panel--browse woocommerce/product-categories
           .mts-shop-filters       woocommerce/product-filters + children
         .mts-shop-layout__main    .mts-shop-results
           .mts-shop-toolbar       results count + catalog sorting
           .mts-shop-collection    woocommerce/product-collection

   Everything below styles WooCommerce's own block output. Where a Woo block
   exposes CSS custom properties for theming (the filter checkboxes and chips
   do) those are set rather than overriding the block's internals, so the
   store survives a WooCommerce upgrade.
   ========================================================================== */

.woocommerce-breadcrumb {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	padding-block: var(--wp--preset--spacing--20);
}

/* --------------------------------------------------------------------------
   5.1 Page frame
   -------------------------------------------------------------------------- */

/*
 * The shop opens the same way every other section page does: title,
 * standfirst, brass rule, then a generous gap before the content. The store
 * previously had its own treatment — a 4rem brass sweep drawn as a ::after on
 * the title, a 52ch intro, and a 36px gap — which is why it read as a
 * different site. It now uses the real separator block and the shared measure.
 */
.mts-shop-header {
	margin-block-end: var(--wp--preset--spacing--60);
}

.mts-shop-header__title {
	margin-block-end: 0;
}

/*
 * The intro sits on both a paragraph (shop, search) and a term-description
 * wrapper div (category archives), so the measure is set on the container and
 * the margin is collapsed off any paragraph inside it.
 */
/*
 * Measure comes from .mts-section-intro, shared with every other section, and
 * the gap under the title matches the block gap those pages get by default —
 * it was spacing--30 (24px) against 36px everywhere else.
 */
.mts-shop-header__intro {
	margin-block-start: var(--wp--preset--spacing--40);
	margin-block-end: 0;
}

/*
 * On a category archive the intro is a term-description block, which blocks.css
 * styles as muted Slate at medium size — correct for a term description sitting
 * in a listing, wrong here where it is the page's standfirst and has to match
 * the one on /shop/ and every section page. blocks.css loads first, so equal
 * specificity is enough.
 */
.mts-shop-header__intro.wp-block-term-description {
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--contrast);
}

.mts-shop-header__intro > p:last-child {
	margin-block-end: 0;
}

.mts-shop-layout {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--50);
	margin-block-start: var(--wp--preset--spacing--40);
}

/* --------------------------------------------------------------------------
   5.2 Sidebar — search, browse, filters
   -------------------------------------------------------------------------- */

.mts-shop-sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.mts-shop-panel,
.mts-shop-filters {
	background-color: #fff;
	border: var(--mts-rule);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--30);
}

/*
 * Below 601px the Product Filters block collapses to a single "Filter
 * products" button and moves its contents into a fixed overlay, so the panel
 * chrome would be a box around a button. Panel styling therefore only applies
 * once the filters are actually inline. The breakpoint matches WooCommerce's
 * own (product-filters-style.css).
 */
@media (max-width: 600px) {
	.mts-shop-filters {
		background: none;
		border: 0;
		padding: 0;
	}
}

/*
 * 601px to 781px is a trap between two breakpoints that belong to different
 * owners. Core stacks `wp:columns` at max-width: 781px, and stacking order is
 * source order, so the sidebar lands above the grid. WooCommerce only collapses
 * the filters into its "Filter products" overlay at max-width: 600px. Between
 * the two the columns are stacked AND the filter panel is fully expanded, so
 * search, every category, every filter group and the clear button all render
 * full-width before the first product — which is iPad portrait at 768px and
 * landscape phones.
 *
 * Laying the panels out in a grid keeps everything above the results, where a
 * shop sidebar belongs, while roughly halving the height it costs. Extending
 * Woo's overlay to 781px is not available to CSS — that behaviour is driven by
 * the Interactivity API, not a media query — and stripping the panel chrome at
 * this width (the tempting one-line change) would leave the filters expanded
 * and unstyled, which is worse than the problem.
 *
 * A <details> collapse would beat both, and wants a template change rather than
 * a stylesheet.
 */
/*
 * The aside carries a blockGap, and WordPress's flow layout implements that as
 * `> * + * { margin-block-start: … }` on every child but the first. That margin
 * stacks on top of the grid's own `gap`, so rows were spaced by gap + margin
 * rather than by gap. Same bug content.css already documents for `.mts-index`.
 *
 * Unscoped, because the previous flex column had the identical doubling at all
 * widths. Class doubled to outrank core's (0,1,0) container selector without
 * !important.
 */
.mts-shop-sidebar.mts-shop-sidebar > * {
	margin-block: 0;
}

@media (min-width: 601px) and (max-width: 781px) {
	.mts-shop-sidebar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--30);
		align-items: start;
	}

	/* Search spans the row: it is the fastest route to a product. */
	.mts-shop-panel--search {
		grid-column: 1 / -1;
	}
}

.mts-shop-panel__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast); /* 17.96:1 on white — AAA */
	margin: 0 0 var(--wp--preset--spacing--20);
	padding-block-end: 0.5rem;
	border-block-end: 2px solid var(--wp--preset--color--primary);
}

/* Search --------------------------------------------------------------- */

/*
 * Scoped tightly to the shop sidebar. assets/css/forms.css owns form controls
 * generally; it is not loaded on catalogue pages, and this class exists so the
 * two sheets cannot collide if that ever changes.
 */
.mts-shop-search .wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--contrast-2);
	border-radius: 2px;
	background-color: #fff;
	padding: 0;
	overflow: hidden;
}

.mts-shop-search .wp-block-search__input {
	border: 0;
	background: transparent;
	min-height: var(--mts-touch);
	padding-inline: 0.75rem;
	/*
	 * Never below 16px. iOS Safari zooms the page when a control smaller than
	 * that takes focus, and does not zoom back out — so searching the shop on
	 * an iPhone left the visitor magnified into the results they had just asked
	 * for, having to pinch out to read them. This was the only input in the
	 * theme under 16px; every field in forms.css already uses the 17px token.
	 */
	font-size: max(1rem, var(--wp--preset--font-size--small));
	color: var(--wp--preset--color--contrast);
}

/* Placeholder text is real text: slate on white is 8.14:1 — AAA. */
.mts-shop-search .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--contrast-2);
	opacity: 1;
}

/* Icon-only submit. core/search sets aria-label from buttonText, so the
   accessible name is "Search"; 44×44 clears WCAG 2.5.8 comfortably. */
.mts-shop-search .wp-block-search__button {
	min-width: var(--mts-touch);
	min-height: var(--mts-touch);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base); /* 16.35:1 — AAA */
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mts-shop-search .wp-block-search__button:hover,
.mts-shop-search .wp-block-search__button:focus {
	background-color: var(--mts-brass-text); /* cream on #8a5c1f — 5.26:1 AA */
}

.mts-shop-search .wp-block-search__button svg {
	fill: currentColor;
	width: 22px;
	height: 22px;
}

/* Category navigation --------------------------------------------------- */

.mts-shop-cats .wc-block-product-categories-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wc-block-product-categories-list-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	border-block-end: var(--mts-rule);
}

.wc-block-product-categories-list--depth-0 > .wc-block-product-categories-list-item:last-child {
	border-block-end: 0;
}

.mts-shop-cats .wc-block-product-categories-list-item > a {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-height: var(--mts-touch);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.02em;
	text-decoration: none;
	color: var(--wp--preset--color--contrast); /* 17.96:1 — AAA */
}

.mts-shop-cats .wc-block-product-categories-list-item > a:hover,
.mts-shop-cats .wc-block-product-categories-list-item > a:focus-visible {
	color: var(--mts-brass-text); /* 5.78:1 on white — AA */
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wc-block-product-categories-list-item-count {
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--contrast-2); /* 8.14:1 — AAA */
}

/* Children sit under a brass hairline rather than a bullet. */
.mts-shop-cats .wc-block-product-categories-list--depth-1 {
	flex-basis: 100%;
	margin: 0 0 0 0.25rem;
	padding-inline-start: 0.75rem;
	border-inline-start: 2px solid var(--wp--preset--color--base-2);
}

.mts-shop-cats .wc-block-product-categories-list--depth-1 .wc-block-product-categories-list-item:last-child {
	border-block-end: 0;
}

/* Filters --------------------------------------------------------------- */

/*
 * WooCommerce's filter blocks expose custom properties for their option
 * controls. Setting those keeps the checkbox and chip internals owned by
 * WooCommerce — and keeps assets/css/forms.css, which owns form controls
 * elsewhere on the site, out of the picture entirely.
 *
 * Checked mark: ink on white, 17.96:1. Box border: slate on white, 8.14:1 —
 * far past the 3:1 WCAG 1.4.11 floor for a non-text control boundary.
 */
.wc-block-product-filters {
	--wc-product-filters-background-color: var(--wp--preset--color--base);
	--wc-product-filters-text-color: var(--wp--preset--color--contrast);
	--wc-product-filter-checkbox-list-option-element: #fff;
	--wc-product-filter-checkbox-list-option-element-border: var(--wp--preset--color--contrast-2);
	--wc-product-filter-checkbox-list-option-element-selected: var(--wp--preset--color--contrast);
	--wc-product-filter-checkbox-list-label-element: var(--wp--preset--color--contrast);
	--wc-product-filter-removable-chips-background: var(--wp--preset--color--base-2);
	--wc-product-filter-removable-chips-border: var(--wp--preset--color--contrast-2);
	--wc-product-filter-removable-chips-text: var(--wp--preset--color--contrast);
	--wc-product-filter-block-spacing: var(--wp--preset--spacing--30);
	display: flex;
	width: 100%;
}

.mts-shop-filters h3 {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--contrast);
	padding-block-end: 0.4rem;
	border-block-end: var(--mts-rule);
}

/*
 * The clickable target is the whole label, not the 1em box, so the row is
 * padded out to the 44px AAA target rather than the 24px AA floor.
 */
.wc-block-product-filter-checkbox-list__label {
	min-height: var(--mts-touch);
	width: 100%;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.wc-block-product-filter-checkbox-list__item + .wc-block-product-filter-checkbox-list__item {
	border-block-start: var(--mts-rule);
}

.wc-block-product-filter-checkbox-list__text-wrapper {
	font-size: 1em;
}

.wc-block-product-filter-checkbox-list__count {
	color: var(--wp--preset--color--contrast-2); /* 8.14:1 — AAA */
	font-variant-numeric: tabular-nums;
}

.wc-block-product-filter-checkbox-list__show-more-button {
	min-height: var(--mts-touch-min);
	color: var(--mts-brass-text); /* 5.78:1 — AA */
	font-family: var(--wp--preset--font-family--display);
}

/* Active-filter chips. */
.wc-block-product-filter-removable-chips__item {
	min-height: 2rem;
	font-family: var(--wp--preset--font-family--display);
	letter-spacing: 0.02em;
}

/* Woo renders the × at icon size; pad it out to the AA target. */
.wc-block-product-filter-removable-chips__remove {
	min-width: var(--mts-touch-min);
	min-height: var(--mts-touch-min);
	justify-content: center;
}

/*
 * "Clear filters".
 *
 * WooCommerce's clear-button block renders nothing unless its saved content
 * contains an `a.wp-block-button__link`, which it rewrites into a <button>
 * and wires to actions.removeAll. The templates therefore nest a core/button
 * inside it — a bare self-closing block comment renders an empty div.
 *
 * It only appears once at least one filter is active.
 */
.wp-block-woocommerce-product-filter-clear-button .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--20);
}

.wp-block-woocommerce-product-filter-clear-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--mts-touch);
	background-color: transparent;
	border: 2px solid var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast); /* 17.96:1 on white — AAA */
}

.wp-block-woocommerce-product-filter-clear-button .wp-block-button__link:hover,
.wp-block-woocommerce-product-filter-clear-button .wp-block-button__link:focus {
	background-color: var(--mts-brass-text);
	border-color: var(--mts-brass-text);
	color: var(--wp--preset--color--base); /* 5.26:1 — AA */
}

/*
 * WooCommerce sets the checkbox focus outline with a selector specific enough
 * (0,2,1) to beat the store-wide ring in section 1, which leaves a 3px ink
 * outline instead of the accent red used everywhere else. Ink is perfectly
 * visible — 17.96:1 — but the ring should be recognisable as the same ring,
 * so it is re-asserted here at (0,3,1).
 *
 * Accent red measures 7.31:1 on white, far past the 3:1 WCAG 1.4.11 floor.
 */
.mts-shop-filters input[type="checkbox"].wc-block-product-filter-checkbox-list__input:focus-visible {
	outline: var(--wp--custom--focus-ring--width, 3px) solid var(--wp--preset--color--accent);
	outline-offset: var(--wp--custom--focus-ring--offset, 2px);
}

/*
 * Small-screen drawer trigger. WooCommerce ships it as a bare text button;
 * this makes it a full-width, 44px-high control that reads as the primary way
 * into the filters on a phone.
 */
.wc-block-product-filters__open-overlay {
	width: 100%;
	min-height: var(--mts-touch);
	justify-content: center;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast); /* 16.35:1 on cream — AAA */
}

.wc-block-product-filters__close-overlay {
	min-width: var(--mts-touch);
	min-height: var(--mts-touch);
	justify-content: center;
}

/* --------------------------------------------------------------------------
   5.3 Results column
   -------------------------------------------------------------------------- */

.mts-shop-toolbar {
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	padding-block-end: 0.75rem;
	margin-block-end: var(--wp--preset--spacing--40);
	border-block-end: var(--mts-rule-strong);
}

.woocommerce-result-count,
.woocommerce-ordering select {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}

.mts-shop-toolbar .woocommerce-result-count,
.mts-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

.woocommerce-ordering select {
	min-height: var(--mts-touch);
}

/*
 * WooCommerce's grid drops to a 150px minimum column, which turns a card with
 * a long joke for a title into a column of single words. 15rem keeps three
 * columns on a desktop sidebar layout and folds to two, then one, cleanly.
 */
.mts-shop-collection .wc-block-product-template__responsive {
	gap: var(--wp--preset--spacing--40);
}

.mts-shop-collection .wc-block-product-template__responsive.columns-3 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.mts-shop-empty {
	background-color: var(--wp--preset--color--base-2);
	border: var(--mts-rule);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--40);
	text-align: center;
}

.mts-shop-pagination {
	margin-block-start: var(--wp--preset--spacing--50);
	padding-block-start: var(--wp--preset--spacing--30);
	border-block-start: var(--mts-rule);
	gap: 0.35rem;
}

.mts-shop-pagination .page-numbers,
.mts-shop-pagination .wp-block-query-pagination-previous,
.mts-shop-pagination .wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--mts-touch);
	min-height: var(--mts-touch);
	padding-inline: 0.6rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	color: var(--wp--preset--color--contrast); /* 16.35:1 — AAA */
	border-block-end: 3px solid transparent;
}

.mts-shop-pagination a:hover {
	color: var(--mts-brass-text); /* 5.26:1 on cream — AA */
	border-block-end-color: var(--wp--preset--color--primary);
}

/* Current page is marked by weight and a rule, never by colour alone. */
.mts-shop-pagination .page-numbers.current {
	font-weight: 700;
	border-block-end-color: var(--wp--preset--color--primary);
}

/* --------------------------------------------------------------------------
   5.4 Product cards
   --------------------------------------------------------------------------

   The catalogue is rendered by the Product Collection block, which emits
   `ul.wc-block-product-template > li.wc-block-product` — not the classic
   `ul.products > li.product`. The classic selectors are kept alongside so the
   styling survives if a shortcode loop is ever used next to the block grid.

   The card is a flex column with the image full-bleed at the top and the
   price pushed to the bottom with `margin-block-start: auto`, so a two-line
   joke and a three-word title still line their prices and buttons up across
   the row.
   -------------------------------------------------------------------------- */

.woocommerce ul.products li.product,
.wc-block-product,
.wc-block-grid__product,
.wp-block-post.product {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: #fff;
	border: var(--mts-rule);
	border-radius: 3px;
	padding: 0;
	overflow: hidden;
	transition: box-shadow var(--wp--custom--transition--base, 180ms),
		border-color var(--wp--custom--transition--base, 180ms);
}

.wc-block-product > *,
.wc-block-grid__product > * {
	padding-inline: var(--wp--preset--spacing--30);
}

.woocommerce ul.products li.product:hover,
.wc-block-product:hover,
.wc-block-grid__product:hover,
.wc-block-product:focus-within {
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--lifted);
}

/* Image ---------------------------------------------------------------- */

.wc-block-product .wc-block-components-product-image {
	padding: 0;
	margin: 0;
	overflow: hidden;
	background-color: var(--wp--preset--color--base-2);
	border-block-end: var(--mts-rule);
}

.wc-block-product .wc-block-components-product-image a {
	display: block;
}

.wc-block-product .wc-block-components-product-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 400ms cubic-bezier(0.2, 0, 0.2, 1);
}

.wc-block-product:hover .wc-block-components-product-image img {
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.wc-block-product .wc-block-components-product-image img,
	.wc-block-product:hover .wc-block-components-product-image img {
		transition: none;
		transform: none;
	}
}

/*
 * Branded, type-aware placeholders (see inc/shop.php) are square art on a
 * sand ground, so they want the tile behind them but not the extra border a
 * bare WooCommerce placeholder needs — the card already supplies an edge.
 */
.woocommerce-placeholder,
.wc-block-components-product-image img[src*="woocommerce-placeholder"] {
	background-color: var(--wp--preset--color--base-2);
	border: var(--mts-rule);
	border-radius: 2px;
}

.wc-block-product .woocommerce-placeholder,
.wc-block-product .wc-block-components-product-image img[src*="woocommerce-placeholder"] {
	border: 0;
	border-radius: 0;
}

/* Sale badge sits over the image rather than pushing the title down. */
.wc-block-product .wc-block-components-product-image {
	position: relative;
}

.wc-block-product .wc-block-components-product-image__inner-container {
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-start: 0.5rem;
	pointer-events: none;
}

/* Title ---------------------------------------------------------------- */

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-grid__product-title,
.wp-block-post-title {
	font-family: var(--wp--preset--font-family--display);
	line-height: 1.2;
}

/*
 * Titles here are one-liners, some of them long ("There's Nothing Alternative
 * About Being a Nose Picker"). `overflow-wrap: anywhere` stops a single long
 * word blowing the grid column out, and the display face is left in sentence
 * case — uppercasing a joke this long is unreadable.
 */
.wc-block-product .wp-block-post-title {
	margin-block: var(--wp--preset--spacing--30) 0.5rem;
	font-weight: 500;
	letter-spacing: 0;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.wc-block-product .wp-block-post-title a {
	color: var(--wp--preset--color--contrast); /* 17.96:1 on white — AAA */
	text-decoration: none;
}

.wc-block-product .wp-block-post-title a:hover,
.wc-block-product .wp-block-post-title a:focus-visible {
	color: var(--mts-brass-text); /* 5.78:1 on white — AA */
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Price ---------------------------------------------------------------- */

/*
 * `margin-block-start: auto` is what keeps the prices and buttons on a shared
 * baseline across a row of cards whose titles wrap to different heights.
 */
.wc-block-product .wp-block-woocommerce-product-price {
	margin-block-start: auto;
	padding-block-start: 0.75rem;
}

.wc-block-product .wp-block-woocommerce-product-price::before {
	content: "";
	display: block;
	width: 2.25rem;
	height: 2px;
	margin-block-end: 0.6rem;
	background: var(--wp--preset--gradient--brass-sweep);
}

.wc-block-product .wc-block-components-product-price {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	color: var(--wp--preset--color--contrast); /* 17.96:1 — AAA */
}

/*
 * WooCommerce's own related-products and cross-sell templates centre the card
 * text; the shop templates in this theme do not. Both emit `li.wc-block-
 * product`, so the alignment is normalised on the card itself rather than
 * left to differ depending on which template happened to render it.
 */
.wc-block-product .wp-block-post-title,
.wc-block-product .wc-block-components-product-price,
.wc-block-product .wc-block-components-product-summary {
	text-align: left;
}

/* Button --------------------------------------------------------------- */

.wc-block-product .wc-block-components-product-button {
	margin-block: var(--wp--preset--spacing--30);
}

.wc-block-product .wc-block-components-product-button .wp-block-button__link,
.wc-block-product .wc-block-components-product-button .add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--mts-touch);
}

/* The "View cart" link Woo appends after an add-to-cart. */
.wc-block-product .added_to_cart {
	display: inline-flex;
	align-items: center;
	min-height: var(--mts-touch-min);
	margin-block-start: 0.5rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	color: var(--mts-brass-text); /* 5.78:1 — AA */
}

.woocommerce ul.products li.product .price,
.wp-block-woocommerce-product-price .woocommerce-Price-amount {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--contrast); /* 16.35:1 — AAA */
}

/* Struck-through original price needs a text cue, not just a line. */
.woocommerce del,
.wc-block-components-product-price del {
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	opacity: 1;
}

.woocommerce ins,
.wc-block-components-product-price ins {
	text-decoration: none;
	font-weight: 600;
}

/* Sale badge: ink on Brass Light measures 7.61:1 (AAA). */
.woocommerce span.onsale,
.wc-block-components-product-sale-badge {
	background-color: var(--wp--preset--color--primary-light);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-radius: 2px;
	padding: 0.25em 0.7em;
	min-height: 0;
}

/* ==========================================================================
   6. Single product
   ========================================================================== */

.woocommerce-product-gallery {
	border: var(--mts-rule);
	border-radius: 3px;
	background-color: #fff;
	padding: var(--wp--preset--spacing--20);
}

.woocommerce div.product .product_title,
.wp-block-woocommerce-product-title {
	margin-block-end: var(--wp--preset--spacing--20);
}

/*
 * Scoped to the single-product body class: the same
 * `.wp-block-woocommerce-product-price` class is used by every card in the
 * catalogue grid, so an unscoped rule would blow the grid prices up to
 * x-large and repeat the brass rule under all twenty of them.
 */
.woocommerce div.product p.price,
.single-product .wp-block-woocommerce-product-price {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--contrast);
	margin-block: var(--wp--preset--spacing--20);
}

/* Brass rule under the price — decorative, so contrast rules do not apply. */
.single-product .wp-block-woocommerce-product-price::after {
	content: "";
	display: block;
	width: 3.5rem;
	height: 3px;
	margin-block-start: var(--wp--preset--spacing--20);
	background: var(--wp--preset--gradient--brass-sweep);
}

/*
 * The rule above is scoped by body class, and the Related Products block puts
 * a whole grid of `.wp-block-woocommerce-product-price` on the same page — so
 * every related card was getting the single-product flourish underneath its
 * price on top of the card's own rule above it. Cards opt out.
 */
.single-product .wc-block-product .wp-block-woocommerce-product-price::after {
	content: none;
}

/* Quantity input + add-to-cart sit on one baseline. */
.woocommerce div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	align-items: stretch;
	margin-block: var(--wp--preset--spacing--30);
}

.woocommerce .quantity .qty {
	min-height: var(--mts-touch);
	min-width: 4.5rem;
	text-align: center;
	font-family: var(--wp--preset--font-family--display);
	border: 1px solid var(--wp--preset--color--contrast-2);
}

.woocommerce div.product form.cart .single_add_to_cart_button {
	flex: 1 1 12rem;
	width: auto;
}

/* Product tabs. WooCommerce supplies role="tablist"/"tab" and aria-selected,
   so only the presentation is restyled here. */
.woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	margin: 0 0 var(--wp--preset--spacing--30);
	padding: 0;
	list-style: none;
	border-bottom: var(--mts-rule);
}

.woocommerce-tabs ul.tabs li {
	margin: 0;
}

.woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 0.75em 1em;
	min-height: var(--mts-touch);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	border-bottom: 3px solid transparent;
}

/* Active tab is marked by weight + a brass underline, not colour alone. */
.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a[aria-selected="true"] {
	color: var(--wp--preset--color--contrast); /* 16.35:1 — AAA */
	font-weight: 600;
	border-bottom-color: var(--wp--preset--color--primary);
}

.woocommerce-Tabs-panel {
	padding-block: var(--wp--preset--spacing--20);
}

/* Related / upsell sections. */
.related > h2,
.upsells > h2,
.wp-block-woocommerce-related-products h2 {
	font-size: var(--wp--preset--font-size--large);
	padding-block-end: var(--wp--preset--spacing--20);
	border-bottom: 2px solid var(--wp--preset--color--primary);
	margin-block-end: var(--wp--preset--spacing--30);
}

/* ==========================================================================
   7. Cart (block)
   ========================================================================== */

.wc-block-cart-items__header {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast); /* 16.35:1 — AAA */
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}

.wc-block-cart-items__row {
	border-bottom: var(--mts-rule);
}

.wc-block-cart-item__image img {
	border: var(--mts-rule);
	border-radius: 2px;
	background-color: var(--wp--preset--color--base-2);
}

.wc-block-components-product-name {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--contrast);
	text-underline-offset: 0.18em;
	/* Standalone link: pad to a comfortable target rather than a 20px strip. */
	display: inline-block;
	padding-block: 0.2em;
}

.wc-block-components-product-metadata {
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	font-size: var(--wp--preset--font-size--small);
}

/* Quantity stepper: Woo ships 30×27 buttons; raised past the 24px AA floor
   and given real separation so the two arrows are not easily mis-tapped. */
.wc-block-components-quantity-selector {
	border: 1px solid var(--wp--preset--color--contrast-2);
	border-radius: 2px;
	max-width: 8rem;
}

/*
 * 36px clears the 24px AA floor, but +/- are adjacent targets on the most
 * tapped control in the cart. Give them the full 44px comfort target at phone
 * widths, where mis-tapping costs the customer an unwanted extra item, and
 * widen the wrapper so the three cells still fit.
 */
@media (max-width: 600px) {
	.wc-block-components-quantity-selector {
		max-width: 10rem;
	}

	.wc-block-components-quantity-selector__button {
		min-width: var(--mts-touch);
		min-height: var(--mts-touch);
	}
}

.wc-block-components-quantity-selector__button {
	min-width: 2.25rem;
	min-height: 2.25rem;
	font-size: 1.1rem;
	color: var(--wp--preset--color--contrast);
	background: transparent;
}

.wc-block-components-quantity-selector__button:not(:disabled):hover {
	background-color: var(--wp--preset--color--base-2);
}

.wc-block-components-quantity-selector__input {
	font-family: var(--wp--preset--font-family--display);
	min-height: 2.25rem;
	color: var(--wp--preset--color--contrast);
}

/* Remove control: Woo renders it at exactly 24×24 (the AA floor). Padding
   lifts it to 32px without moving the layout. */
.wc-block-cart-item__remove-link {
	min-width: 2rem;
	min-height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--contrast-2);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.wc-block-cart-item__remove-link:hover {
	color: var(--wp--preset--color--accent); /* 6.65:1 — AA */
}

/* Totals panel. */
.wc-block-components-sidebar .wc-block-components-totals-wrapper,
.wp-block-woocommerce-cart-order-summary-block {
	border-top: var(--mts-rule);
}

.wc-block-components-totals-item__label {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-totals-item__value {
	font-family: var(--wp--preset--font-family--display);
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-totals-item__description,
.wc-block-components-totals-shipping__via {
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-totals-footer-item {
	border-top: 2px solid var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--large);
}

/* Coupon disclosure. */
.wc-block-components-panel__button {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--contrast);
	min-height: var(--mts-touch);
}

/* ==========================================================================
   8. Checkout (block)
   ========================================================================== */

.wc-block-components-title,
.wc-block-components-checkout-step__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--contrast);
}

.wc-block-components-checkout-step {
	padding-block-end: var(--wp--preset--spacing--30);
}

.wc-block-components-checkout-step__description {
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	font-size: var(--wp--preset--font-size--small);
}

/* Order summary rail reads as a distinct panel. */
.wp-block-woocommerce-checkout-order-summary-block {
	background-color: var(--wp--preset--color--base-2);
	border: var(--mts-rule);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--30);
}

/* Shipping / payment option rows: selected state uses border weight plus the
   native radio, so selection is never conveyed by colour alone. */
.wc-block-components-radio-control__option,
.wc-block-components-radio-control-accordion-option {
	border: var(--mts-rule);
	border-radius: 2px;
	margin-block-end: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--20);
	min-height: var(--mts-touch);
}

.wc-block-components-radio-control__option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option:has(input:checked) {
	border: 2px solid var(--wp--preset--color--contrast);
	background-color: #fff;
}

.wc-block-components-radio-control__label {
	font-family: var(--wp--preset--font-family--display);
	letter-spacing: 0.02em;
}

.wc-block-components-radio-control__secondary-label {
	color: var(--wp--preset--color--contrast-2);
}

/*
 * Target size (WCAG 2.5.8, AA — 24×24 minimum).
 *
 * Woo's checkbox and radio inputs both render at 20×20. For the radio that is
 * fine: the whole `__option` row is the activation target and measures
 * 328×64 at 360px wide. The checkbox is not — its wrapping <label> collapses
 * to the height of the 20px box, so the entire target is 20px tall.
 *
 * Growing the label rather than the input keeps Woo's checkmark SVG aligned
 * with the box while lifting the real activation target past 24px.
 */
.wc-block-components-checkbox,
.woocommerce-form-login__rememberme,
.wc-block-components-checkbox label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	min-height: var(--mts-touch-min);
}

/*
 * The "+ Add apartment, suite, etc." control is a span with role="button" and
 * tabindex="0" — correctly exposed to assistive tech, but only 20px tall.
 */
.wc-block-components-address-form__address_2-toggle,
.wc-block-components-address-card__edit {
	display: inline-flex;
	align-items: center;
	min-height: var(--mts-touch-min);
	padding-block: 0.2em;
	color: var(--wp--preset--color--secondary); /* 10.58:1 — AAA */
	text-underline-offset: 0.18em;
}

/* The licence-signature field added by mts-secure-documents sits in the
   "Additional order information" step and inherits the field styling above;
   this only gives it room to breathe. */
.wc-block-components-address-form,
.wc-block-checkout__additional-fields {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   9. My Account
   ========================================================================== */

.woocommerce-account .woocommerce {
	display: grid;
	grid-template-columns: minmax(12rem, 1fr) 3fr;
	gap: var(--wp--preset--spacing--50);
	align-items: start;
}

.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: var(--mts-rule);
}

.woocommerce-MyAccount-navigation li {
	margin: 0;
	border-bottom: var(--mts-rule);
}

.woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 0.9em 0.75em;
	min-height: var(--mts-touch);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	border-inline-start: 3px solid transparent;
	transition: background-color var(--wp--custom--transition--base, 180ms);
}

.woocommerce-MyAccount-navigation li a:hover {
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
}

/*
 * Current page is signalled three ways — weight, a brass edge, and a tinted
 * background — so it does not depend on colour perception. WooCommerce also
 * emits aria-current="page", which is what assistive tech actually reads.
 */
.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li a[aria-current="page"] {
	background-color: var(--wp--preset--color--base-2);
	border-inline-start-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--contrast); /* 14.44:1 on sand — AAA */
	font-weight: 600;
}

.woocommerce-MyAccount-content > h2:first-child {
	margin-block-start: 0;
}

/* Login / register forms. */
.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce-ResetPassword {
	background-color: #fff;
	border: var(--mts-rule);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--40);
	max-width: 32rem;
}

.woocommerce-form-login .form-row,
.woocommerce-form-register .form-row {
	margin-block-end: var(--wp--preset--spacing--30);
}

.woocommerce-form-login label,
.woocommerce-form-register label {
	display: block;
	margin-block-end: 0.35em;
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
}

.woocommerce-form-login input.input-text,
.woocommerce-form-register input.input-text {
	width: 100%;
}

.woocommerce-form-login__rememberme {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: var(--mts-touch);
}

/* "Lost your password?" must not be a low-contrast afterthought. */
.woocommerce-LostPassword a {
	color: var(--wp--preset--color--secondary); /* 10.58:1 — AAA */
	text-underline-offset: 0.18em;
}

/* Addresses / account details. */
.woocommerce-Address,
.woocommerce-order-details,
.woocommerce-customer-details {
	background-color: #fff;
	border: var(--mts-rule);
	border-radius: 3px;
	padding: var(--wp--preset--spacing--30);
}

.woocommerce-Address-title h3,
.woocommerce-column__title {
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* ==========================================================================
   10. Store tables — orders, downloads, order details
   ========================================================================== */

.woocommerce table.shop_table,
.woocommerce-orders-table,
.woocommerce-table--order-downloads {
	width: 100%;
	border-collapse: collapse;
	border: var(--mts-rule);
	background-color: #fff;
	font-size: var(--wp--preset--font-size--small);
}

.woocommerce table.shop_table th {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-align: start;
	color: var(--wp--preset--color--contrast); /* 14.44:1 on sand — AAA */
	background-color: var(--wp--preset--color--base-2);
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	padding: 0.85em 1em;
}

.woocommerce table.shop_table td {
	padding: 0.85em 1em;
	border-bottom: var(--mts-rule);
	vertical-align: middle;
}

.woocommerce table.shop_table tr:last-child td {
	border-bottom: 0;
}

/* Order status pill — text label carries the meaning, colour only supports. */
.woocommerce-orders-table__cell-order-status {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--contrast);
}

/* --------------------------------------------------------------------------
   Downloads — the store's primary product surface
   -------------------------------------------------------------------------- */

.woocommerce-order-downloads,
.digital-downloads {
	margin-block-start: var(--wp--preset--spacing--30);
}

.woocommerce-order-downloads__title {
	font-size: var(--wp--preset--font-size--large);
	padding-block-end: var(--wp--preset--spacing--20);
	border-bottom: 2px solid var(--wp--preset--color--primary);
}

/* The download action is the most important control on the account area, so
   it is a full button rather than a bare link. */
.woocommerce-MyAccount-downloads-file {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: var(--mts-touch);
	padding: 0.7em 1.25em;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base); /* 16.35:1 — AAA */
	border: 2px solid var(--wp--preset--color--contrast);
}

/* Downward-arrow affordance; aria-hidden by virtue of being generated
   content, so it adds no noise for screen readers. */
.woocommerce-MyAccount-downloads-file::before {
	content: "\2193";
	font-size: 1.1em;
	line-height: 1;
}

.woocommerce-table--order-downloads .download-remaining,
.woocommerce-table--order-downloads .download-expires {
	color: var(--wp--preset--color--contrast-2); /* 7.41:1 — AAA */
	white-space: nowrap;
}

/* ==========================================================================
   11. Order received / thank you
   ========================================================================== */

.woocommerce-order .woocommerce-thankyou-order-received {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.15;
	color: var(--wp--preset--color--contrast);
	margin-block-end: var(--wp--preset--spacing--30);
}

.woocommerce-order-overview,
.woocommerce-thankyou-order-details {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	list-style: none;
	margin: 0 0 var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--30);
	background-color: var(--wp--preset--color--base-2);
	border: var(--mts-rule);
	border-radius: 3px;
}

.woocommerce-order-overview li {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--contrast-2); /* 6.54:1 on sand — AA */
}

.woocommerce-order-overview li strong {
	display: block;
	margin-block-start: 0.35em;
	font-size: var(--wp--preset--font-size--medium);
	text-transform: none;
	letter-spacing: 0;
	color: var(--wp--preset--color--contrast); /* 14.44:1 — AAA */
}

/* ==========================================================================
   12. Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.woocommerce-account .woocommerce {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--30);
	}
}

@media (max-width: 781px) {
	/*
	 * Woo's `shop_table_responsive` tables are unusable on narrow screens —
	 * four columns squeezed into 360px. Every cell already carries a
	 * `data-title` attribute, so each row can be re-flowed into a labelled
	 * card without touching the markup or losing the header semantics.
	 */
	.woocommerce table.shop_table_responsive,
	.woocommerce table.shop_table_responsive tbody,
	.woocommerce table.shop_table_responsive tr,
	.woocommerce table.shop_table_responsive td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	/*
	 * Visually hidden rather than removed.
	 *
	 * WooCommerce's own woocommerce-smallscreen.css sets
	 * `shop_table_responsive thead { display: none }` at this breakpoint,
	 * which deletes the header cells from the accessibility tree — screen
	 * reader users navigating the table then lose the column headers that
	 * give each value meaning. Matching that rule's specificity is not
	 * enough because it lands later in the cascade, so !important is used
	 * deliberately and narrowly here to keep the headers exposed while the
	 * visible labels are rebuilt from data-title below.
	 */
	.woocommerce table.shop_table_responsive thead {
		display: table-header-group !important;
		border: 0;
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		width: 1px;
		white-space: nowrap;
	}

	.woocommerce table.shop_table_responsive tr {
		margin-block-end: var(--wp--preset--spacing--30);
		border: var(--mts-rule);
		border-radius: 3px;
		padding: var(--wp--preset--spacing--20);
		background-color: #fff;
	}

	.woocommerce table.shop_table_responsive td {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;
		gap: var(--wp--preset--spacing--20);
		padding: 0.6em 0;
		border-bottom: var(--mts-rule);
		text-align: end;
	}

	.woocommerce table.shop_table_responsive td:last-child {
		border-bottom: 0;
	}

	/* The column label, rebuilt from data-title. */
	.woocommerce table.shop_table_responsive td::before {
		content: attr(data-title) ":";
		font-family: var(--wp--preset--font-family--display);
		font-size: var(--wp--preset--font-size--small);
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: var(--wp--preset--color--contrast-2);
		text-align: start;
		flex: 0 0 auto;
	}

	/* The download button gets its own full-width row inside the card. */
	.woocommerce-table--order-downloads td.download-file {
		justify-content: stretch;
	}

	/* box-sizing is explicit here: Woo's .button resets it in places, and a
	   content-box button at width:100% pushed the row 31px past a 360px
	   viewport before this was pinned down. */
	.woocommerce-table--order-downloads td.download-file .woocommerce-MyAccount-downloads-file {
		width: 100%;
		box-sizing: border-box;
		justify-content: center;
	}
}

@media (max-width: 600px) {
	.woocommerce div.product form.cart {
		flex-direction: column;
		align-items: stretch;
	}

	.woocommerce div.product form.cart .single_add_to_cart_button {
		width: 100%;
	}

	.woocommerce .quantity .qty {
		width: 100%;
	}

	/* Cart rows stack; the stepper and remove control stay side by side. */
	.wc-block-cart-items__header {
		display: none;
	}

	.wc-block-cart-item__wrap {
		display: flex;
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
	}

	.woocommerce-tabs ul.tabs {
		gap: 0;
	}

	.woocommerce-tabs ul.tabs li a {
		padding-inline: 0.75em;
	}

	.woocommerce-order-overview,
	.woocommerce-thankyou-order-details {
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
	}
}
