/* ===========================================================================
   XOR webshop
   ---------------------------------------------------------------------------
   Everything theme.json cannot express. Tokens — palette, type scale, spacing,
   the button element — come from theme.json and are kept in step with the main
   site by `npm run shop:tokens`; nothing here redefines a colour literally
   except where a value is genuinely local (a shadow alpha, a gradient stop).

   What this file deliberately does NOT carry, and why:

     - no scanline texture (main site: body::before, z-index 9)
     - no rolling hum bar (main site: html:has(body.home)::before)

   The main site already restricts the hum bar to its front page, reasoning that
   a band sweeping across a paragraph someone is reading is tiring and every
   other page exists to be read. A shop is nothing but pages that exist to be
   read and acted on — price, stock, variant, total — so the effect has nowhere
   to earn its place, and texture over product photography misrepresents the
   finish a customer is choosing between. The vignette stays: it is a static
   darkening, not motion, and it keeps the screen feeling at the page edges.

   WooCommerce's own stylesheets are dequeued in functions.php, so the plain
   WooCommerce class names below are being styled from nothing rather than
   fought with.
   =========================================================================== */

/* --- the one kept CRT element ------------------------------------------- */

body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 8;
	background: radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .5) 100%);
}

/* --- header -------------------------------------------------------------- */

/* Core gives sticky elements z-index 10; the vignette sits at 8, so the header
   needs to clear both it and anything that scrolls under it. */
.xor-header.is-position-sticky { z-index: 40; }
.wp-block-template-part:has(> .xor-header) { display: contents; }

.xor-brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	font-weight: 700;
	font-size: 17px;
	letter-spacing: .16em;
	color: var(--wp--preset--color--green);
	text-decoration: none;
}
.xor-brand:hover { text-decoration: none; }
.xor-brand__mark {
	display: block;
	width: 26px;
	height: 26px;
	flex: none;
	/* Dimmer than the wordmark, so it reads as a mark rather than a second
	   bright element competing with the name. */
	color: var(--wp--preset--color--green-dim);
	transition: color .16s;
}
.xor-brand:hover .xor-brand__mark { color: var(--wp--preset--color--green); }
.xor-brand__text > span { color: var(--wp--preset--color--muted); font-weight: 400; }

.xor-headright.wp-block-group { gap: 22px; align-items: center; }

/* The logo leads to the shop's own front page, as a logo does wherever you
   are; the menu's "xor.eu" is the way out to the main site, and the arrow
   says so before the click. Same mark as main.css uses for external links. */
.xor-external .wp-block-navigation-item__label::after,
a.xor-external::after { content: " ↗"; font-size: .8em; opacity: .7; }

/* --- the catalogue ------------------------------------------------------- */

.woocommerce-products-header { display: none; }

/* The result count and the sort control share a line above the grid. */
.woocommerce-result-count,
.woocommerce-ordering {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin: 0;
}
.woocommerce-ordering select,
.wc-block-catalog-sorting select,
.woocommerce select,
.xor-vat select,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="password"],
.woocommerce input[type="number"],
.woocommerce textarea {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 0;
	padding: .55rem .7rem;
}

/* The native select keeps a light system arrow and a light popup gutter even
   with a dark background set, so draw our own and give it room. The room is
   the 2rem on the right, and only selects get it: on the inputs it pushed a
   centred quantity off-centre. */
.woocommerce-ordering select,
.wc-block-catalog-sorting select,
.woocommerce select,
.xor-vat select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--wp--preset--color--green-dim) 50%),
	                  linear-gradient(135deg, var(--wp--preset--color--green-dim) 50%, transparent 50%);
	background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 2rem;
}
.woocommerce-ordering select:focus-visible,
.woocommerce select:focus-visible,
.xor-vat select:focus-visible,
.woocommerce input:focus-visible,
.woocommerce textarea:focus-visible {
	outline: 1px solid var(--wp--preset--color--green);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--green-dim);
}

/* The catalogue grid.
   WooCommerce renders this through the Product Collection block, so the markup
   is `li.wc-block-product` inside `.wc-block-product-template` — not the
   classic `ul.products li.product`. Both are listed where a rule serves both,
   because cart, checkout and account still emit the classic markup. */
.wc-block-product-template,
ul.products {
	list-style: none;
	margin: 2.2rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

/* Card language lifted from the main site's .xor-card so the two read as one
   company: hairline border, the same panel gradient, a green-dim hover. */
li.wc-block-product,
ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--wp--preset--color--line);
	background: linear-gradient(170deg, var(--wp--preset--color--panel), var(--wp--preset--color--base-2));
	overflow: hidden;
	transition: border-color .16s, box-shadow .16s;
	text-align: center;
	padding: 0 0 16px;
	margin: 0;
}
li.wc-block-product:hover,
ul.products li.product:hover {
	border-color: var(--wp--preset--color--green-dim);
	box-shadow: 0 0 42px -18px rgba(51, 255, 102, .42);
}

/* The photo sits on its own slightly raised panel, as on the main site's
   product cards. The square ratio and `object-fit: contain` are set on the
   block in templates/archive-product.html, because WooCommerce writes them
   inline where a stylesheet cannot reach them without !important. */
.wc-block-components-product-image,
ul.products li.product > a:first-of-type {
	display: block;
	margin: 0 0 2px;
	padding: 18px;
	background: linear-gradient(170deg, var(--wp--preset--color--raise), #070c08);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.wc-block-components-product-image img,
ul.products li.product img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

li.wc-block-product .wp-block-post-title,
ul.products li.product .woocommerce-loop-product__title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: .04em;
	padding: 0 16px;
}
li.wc-block-product .wp-block-post-title a,
ul.products li.product .woocommerce-loop-product__title a {
	color: var(--wp--preset--color--green);
	text-decoration: none;
}
li.wc-block-product .wp-block-post-title a:hover { text-decoration: underline; }

/* The tagline under the name (functions.php). Secondary, so not full contrast,
   but mixed from contrast rather than taken from muted: about 8:1 on the card,
   where muted only just clears AA. */
li.wc-block-product .xor-tagline {
	margin: .3rem 0 0;
	padding: 0 16px;
	font-size: var(--wp--preset--font-size--tiny);
	line-height: 1.45;
	text-align: center;
	color: color-mix(in srgb, var(--wp--preset--color--contrast) 70%, var(--wp--preset--color--panel));
}

/* Prices are contrast, never muted: muted green on near-black does not clear
   WCAG AA at this size, and a price is the one number on the page a customer
   must be able to read without effort. */
.wp-block-woocommerce-product-price,
ul.products li.product .price {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	padding: 0 16px;
}
.wp-block-woocommerce-product-price del,
ul.products li.product .price del {
	color: var(--wp--preset--color--muted);
	margin-right: .5em;
}
.wp-block-woocommerce-product-price ins,
ul.products li.product .price ins {
	text-decoration: none;
	color: var(--wp--preset--color--green);
}

/* The button sits on the bottom edge of the card whatever the title wrapped
   to, so a row of cards has its actions on one line. */
li.wc-block-product .wp-block-woocommerce-product-button,
ul.products li.product .button {
	margin-top: auto;
	padding: 0 16px;
}

/* Buttons.

   Two separate problems. WooCommerce's cart and account pages emit plain
   `.button` anchors that never carry `.wp-element-button`, so theme.json's
   button element never reaches them. And the Product Collection button *does*
   carry `.wp-element-button`, but WooCommerce's block stylesheet — which is
   structural and so is not dequeued — sets `border: none` on it, which beat
   theme.json and left the add-to-cart buttons as bare green text. Its selector
   carries three classes, so matching it takes all three — a shorter one loses
   on specificity however late it is loaded. */
.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button,
.wc-block-components-product-button .wp-block-button__link {
	border: 1px solid var(--wp--preset--color--green-dim);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--green);
}
.wp-block-button.wc-block-components-product-button .wc-block-components-product-button__button:hover,
.wc-block-components-product-button .wp-block-button__link:hover {
	background: var(--wp--preset--color--green);
	color: #03110a;
	border-color: var(--wp--preset--color--green);
	box-shadow: 0 0 20px rgba(51, 255, 102, .35);
}

/* Buttons: the same shape as theme.json's button element, applied to the plain
   anchors and inputs WooCommerce emits, which never carry .wp-element-button. */
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.wc-block-components-button {
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: .08em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	padding: .75rem 1.25rem;
	border-radius: 0;
	border: 1px solid var(--wp--preset--color--green-dim);
	background: transparent;
	color: var(--wp--preset--color--green);
	transition: background-color .16s, color .16s, border-color .16s, box-shadow .16s;
}
.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button:hover,
.wc-block-components-button:hover {
	background: var(--wp--preset--color--green);
	color: #03110a;
	border-color: var(--wp--preset--color--green);
	box-shadow: 0 0 20px rgba(51, 255, 102, .35);
}
.woocommerce .button:disabled,
.woocommerce .button.disabled {
	opacity: .45;
	cursor: not-allowed;
	box-shadow: none;
	background: transparent;
	color: var(--wp--preset--color--green);
}

/* --- single product ------------------------------------------------------ */

/* No grid here on purpose. The block template lays the page out with a
   wp:columns, and `div.product` is only a flow-layout group wrapping the lot.
   An earlier version of this file carried the classic-markup rule
   `div.product { display: grid; grid-template-columns: 5fr 7fr }`, which with
   no `.summary` element to fill the second column dropped every child into the
   first and squeezed the whole page into 533px. */

.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	max-height: 560px;
	object-fit: contain;
	background: linear-gradient(170deg, var(--wp--preset--color--raise), #070c08);
	border: 1px solid var(--wp--preset--color--line);
	padding: 24px;
	box-sizing: border-box;
}
.woocommerce-product-gallery .flex-control-thumbs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 0;
	padding: 0;
}
.woocommerce-product-gallery .flex-control-thumbs li { width: 74px; }
.woocommerce-product-gallery .flex-control-thumbs img {
	width: 100%;
	height: 74px;
	object-fit: contain;
	padding: 6px;
	box-sizing: border-box;
	background: var(--wp--preset--color--raise);
	border: 1px solid var(--wp--preset--color--line);
	cursor: pointer;
}
.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover {
	border-color: var(--wp--preset--color--green-dim);
}

/* Description / Additional information. The block carries is-style-minimal,
   but the stylesheet that renders that as plain headings is one of the two
   dequeued in functions.php, so the tab list is still in the markup and the
   tab script still hides the inactive panel. Styling the tabs is therefore the
   honest option — hiding the list would hide the panel switcher and leave
   "Additional information", which is where weight and dimensions live,
   unreachable. */
.woocommerce-tabs ul.wc-tabs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 1.6rem;
	padding: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.woocommerce-tabs ul.wc-tabs li { margin: 0; }
.woocommerce-tabs ul.wc-tabs li a {
	display: block;
	padding: .7rem 1.1rem;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}
.woocommerce-tabs ul.wc-tabs li a:hover { color: var(--wp--preset--color--green); }
.woocommerce-tabs ul.wc-tabs li.active a {
	color: var(--wp--preset--color--green);
	border-bottom-color: var(--wp--preset--color--green);
}
/* The panel repeats the tab name as an <h2>; one of the two is redundant. */
.woocommerce-tabs .woocommerce-Tabs-panel > h2:first-child { display: none; }

.woocommerce div.product .product_title {
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--green);
	margin: 0 0 .4em;
}
.wp-block-woocommerce-product-price,
.woocommerce div.product p.price {
	color: var(--wp--preset--color--contrast);
}

/* Stock state. Green when it ships, amber when it does not — amber is already
   the main site's "pay attention to this" colour. */
.woocommerce div.product .stock {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--green);
	margin: 0 0 1rem;
}
.woocommerce div.product .stock.out-of-stock { color: var(--wp--preset--color--amber); }

/* Variation pickers. Styled like the main site's colourway buttons rather than
   left as browser selects, because colour is the choice customers get wrong. */
.woocommerce div.product form.cart .variations {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1rem;
}
.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td {
	text-align: left;
	padding: 6px 0;
	vertical-align: middle;
}
.woocommerce div.product form.cart .variations th {
	width: 7.5rem;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: .08em;
	/* Form labels are contrast, not muted — same AA reasoning as prices. */
	color: var(--wp--preset--color--contrast);
}
/* Wide enough for "Choose an option" plus the arrow gutter.

   WooCommerce ships a third stylesheet, woocommerce-blocktheme.css, which is
   not dequeued because unlike the other two it is written against the theme's
   own tokens and does useful structural work. It does set
   `.woocommerce div.product form.cart table.variations td select` to
   `min-width: 70%` with a padding that leaves no room for the arrow drawn
   above, so this match its selector exactly — anything shorter loses. */
.woocommerce div.product form.cart table.variations td select {
	min-width: 15rem;
	padding: .55rem 2rem .55rem .7rem;
	height: auto;
}

.woocommerce div.product form.cart .reset_variations {
	font-size: var(--wp--preset--font-size--tiny);
	color: var(--wp--preset--color--muted);
	text-transform: uppercase;
	letter-spacing: .08em;
}
.woocommerce div.product form.cart .single_variation .price {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--contrast);
}

.woocommerce div.product form.cart { display: block; }
.woocommerce div.product form.cart .quantity { display: inline-block; margin-right: 10px; }
.woocommerce div.product form.cart .quantity input {
	width: 5rem;
	text-align: center;
}

.woocommerce .product_meta {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}
.woocommerce .product_meta .sku { color: var(--wp--preset--color--contrast); }

/* Spec tables, matching the main site's .xor-specs. */
.xor-specs {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
	margin: 1.2rem 0;
}
.xor-specs th,
.xor-specs td {
	text-align: left;
	padding: 7px 10px;
	border: 1px solid var(--wp--preset--color--line);
}
.xor-specs th {
	width: 38%;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
	background: var(--wp--preset--color--panel);
}
.xor-specs td { color: var(--wp--preset--color--contrast); }

/* --- the shop's own pages ------------------------------------------------ */

/* Shipping, returns and terms are prose, and prose set across 1140px is hard
   to read. The measure is applied to the direct children only, and the scoping
   matters: a max-width narrower than the layout's content size gets centred by
   core's constrained layout, which reads as a stray indent rather than a
   column. The main site's .xor-prose carries the same rule for the same
   reason. */
.page .wp-block-post-content > p,
.page .wp-block-post-content > ul,
.page .wp-block-post-content > ol,
.page .wp-block-post-content > h2,
.page .wp-block-post-content > h3,
.page .wp-block-post-content > figure.wp-block-table { max-width: 68ch; }

/* On a page the table is the rates: what a destination costs is read as a
   price, so neither column is muted. */
.page .wp-block-post-content .xor-specs { font-size: inherit; }
.page .wp-block-post-content .xor-specs th { width: 72%; color: var(--wp--preset--color--contrast); }

.page .wp-block-post-content > h2 { margin-top: 2.2rem; }
.page .wp-block-post-content > h3 { margin-top: 1.6rem; margin-bottom: .3rem; }
/* Text links only. Cart and checkout are pages too, and this outranked the
   buttons' own hover colour: "Proceed to checkout" stayed green on its green
   hover fill and vanished. */
.page .wp-block-post-content a:not(.wc-block-components-button):not(.wp-element-button):not(.button) {
	color: var(--wp--preset--color--green);
}

/* --- notices ------------------------------------------------------------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border: 1px solid var(--wp--preset--color--green-dim);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--contrast);
	padding: .9rem 1.1rem;
	margin: 0 0 1.4rem;
	font-size: var(--wp--preset--font-size--small);
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
}
.woocommerce-error,
/* Each state class sets its own background in packages-style.css, so restating
   the fill per state is the only way to beat it — the base rule above is not
   enough on its own. */
.wc-block-components-notice-banner.is-error,
.wc-block-components-notice-banner.is-success,
.wc-block-components-notice-banner.is-info,
.wc-block-components-notice-banner.is-warning {
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--contrast);
}
.wc-block-components-notice-banner.is-error { border-color: var(--wp--preset--color--amber); }

/* --- cart and checkout --------------------------------------------------- */

.woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 12px 10px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	color: var(--wp--preset--color--contrast);
}
.woocommerce table.shop_table th {
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}
.woocommerce table.shop_table img { width: 54px; height: auto; }

.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--green);
}

.woocommerce form .form-row { margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.woocommerce form .form-row label {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--wp--preset--color--contrast);
}
.woocommerce form .form-row .required { color: var(--wp--preset--color--amber); text-decoration: none; }

/* --- cart and checkout, the block versions -------------------------------

   Cart and Checkout are React blocks with their own class vocabulary, entirely
   separate from the classic `table.shop_table` markup above (which account
   pages still use). They also ship a light-theme look that assumes a white
   page: white input fills, a pale pink error banner, black-on-white selects.
   None of that inherits from theme.json, so it is set out here.
   ------------------------------------------------------------------------- */

/* Line-item thumbnails. Without a bound these render at the image's own
   height, and a 69x710 frontpanel photo then makes a single cart row about
   1200px tall. */
.wc-block-cart-item__image img,
.wc-block-components-order-summary-item__image img,
.wc-block-components-order-summary-item__image > img {
	width: 100%;
	height: 92px;
	object-fit: contain;
	background: linear-gradient(170deg, var(--wp--preset--color--raise), #070c08);
	border: 1px solid var(--wp--preset--color--line);
	padding: 6px;
	box-sizing: border-box;
}
.wc-block-cart-item__image { width: 92px; }
/* In the mini-cart drawer, and on the cart page when it is narrow, WooCommerce
   turns each row into a grid with a 60px first column. The 92px thumbnail
   then ran 32px into the next column, under the name and price. Same
   selectors as WooCommerce's, so this one wins. */
.is-medium table.wc-block-cart-items .wc-block-cart-items__row,
.is-mobile table.wc-block-cart-items .wc-block-cart-items__row,
.is-small table.wc-block-cart-items .wc-block-cart-items__row {
	grid-template-columns: 92px 132px;
}
/* The browser's default 2px border-spacing set the thumbnails and line totals
   in from the drawer's title and subtotal, so the left and right edges did not
   line up. */
table.wc-block-cart-items { border-spacing: 0; }
/* In that grid the thumbnail fills its cell, so its frame runs from the top
   of the name to the bottom of the quantity selector instead of stopping at a
   fixed 92px. The image is taken out of the flow to do it: in the flow, a
   1:11 Eurorack photo at 100% height set the row's height itself. */
.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,
.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image,
.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
	position: relative;
	min-height: 92px;
}
.is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,
.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,
.is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img {
	position: absolute;
	inset: 0;
	height: 100%;
}

/* Form fields.

   The selectors below carry the `.wc-block-components-form` /
   `.wc-block-components-checkbox` ancestors that WooCommerce's own
   packages-style.css uses. They are not decoration: that stylesheet sets white
   fills at that specificity, so a shorter selector here loses however late it
   loads. */
.wc-block-components-form .wc-block-components-text-input input[type="text"],
.wc-block-components-form .wc-block-components-text-input input[type="email"],
.wc-block-components-form .wc-block-components-text-input input[type="tel"],
.wc-block-components-form .wc-block-components-text-input input[type="number"],
.wc-block-components-form .wc-block-components-text-input input[type="password"],
.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="number"],
.wc-block-components-text-input input[type="password"],
.wc-block-components-textarea,
.wc-block-components-combobox-control input.components-combobox-control__input,
/* Note the plural: the country/region control is `wc-blocks-components-select`,
   not `wc-block-components-select` like everything around it. Styling only the
   singular form left one white box in the middle of the billing address, and
   checkout.css paints the container through a two-class selector, so matching
   it takes both classes. */
.wc-blocks-components-select .wc-blocks-components-select__container,
.wc-blocks-components-select__select,
.wc-block-components-select__select {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 0;
}
.wc-blocks-components-select__container select,
.wc-blocks-components-select__container .wc-blocks-components-select__select {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 0;
}

.wc-block-components-text-input.is-active input,
.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-block-components-select__select:focus {
	outline: 1px solid var(--wp--preset--color--green);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--green-dim);
	background: var(--wp--preset--color--panel);
}
/* While typing. packages-style.css turns the field white with dark text on
   :focus-within, through a four-part selector that outranked the rule above,
   so every name and address field flashed white while being filled in. Same
   shape as WooCommerce's, so this one wins. */
.wc-block-components-form .wc-block-components-text-input input[type="date"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="email"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="number"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="password"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="tel"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="text"]:focus-within,
.wc-block-components-form .wc-block-components-text-input input[type="url"]:focus-within,
/* The same without the form ancestor: the coupon field in the cart and
   checkout totals is not inside .wc-block-components-form. */
.wc-block-components-text-input input[type="date"]:focus-within,
.wc-block-components-text-input input[type="email"]:focus-within,
.wc-block-components-text-input input[type="number"]:focus-within,
.wc-block-components-text-input input[type="password"]:focus-within,
.wc-block-components-text-input input[type="tel"]:focus-within,
.wc-block-components-text-input input[type="text"]:focus-within,
.wc-block-components-text-input input[type="url"]:focus-within {
	background-color: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--green-dim);
}
/* The order note. WooCommerce turns its text dark grey (#2b2d2f) as soon as
   it holds anything (`:not(:placeholder-shown)`), written for its white
   field, and adds a dark inset shadow on focus: near-black text on the dark
   panel. Same selectors, so these win. */
.wc-block-components-textarea:not(:placeholder-shown),
.wc-block-components-textarea:focus {
	color: var(--wp--preset--color--contrast);
	box-shadow: none;
}
.wc-block-components-textarea::placeholder { color: var(--wp--preset--color--muted); }

/* The browser's own autofill colour (pale blue or yellow) cannot be set with
   background; an inset shadow covers it, and the text colour needs the
   -webkit- property. */
.wc-block-components-text-input input:-webkit-autofill,
.woocommerce input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 100px var(--wp--preset--color--panel) inset;
	-webkit-text-fill-color: var(--wp--preset--color--contrast);
	caret-color: var(--wp--preset--color--contrast);
}

/* The floating label sits inside the field, so it has to read against the
   panel fill rather than against white. */
.wc-block-components-text-input label,
.wc-block-components-combobox-control label,
.wc-blocks-components-select__label,
.wc-block-components-select__label {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--mono);
}
.wc-block-components-text-input.is-active label,
.wc-block-components-combobox-control.is-active label {
	color: var(--wp--preset--color--green);
}

/* Checkboxes and radios: the native control is a white square whatever the
   page behind it, so draw it.

   Checkboxes: a square, 20px because WooCommerce's tick (below) is drawn for
   a 20px box. */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
.wc-block-components-checkbox__input[type="checkbox"] {
	appearance: none;
	width: 20px;
	min-width: 20px;
	height: 20px;
	margin: 0;
	border: 1px solid var(--wp--preset--color--green-dim);
	background: var(--wp--preset--color--panel);
	border-radius: 0;
	cursor: pointer;
}
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked,
.wc-block-components-checkbox__input[type="checkbox"]:checked {
	background: var(--wp--preset--color--green);
	border-color: var(--wp--preset--color--green);
}

/* Radios (shipping and payment options): colour only. WooCommerce places the
   radio absolutely, in the option's 48px left padding; setting position or
   size here, with a selector as strong as its own, pulled the radio onto a
   line of its own above the label, or on top of it. A dark ring with a green
   dot when chosen, so it reads as a radio and not as a checkbox. */
.wc-block-components-radio-control .wc-block-components-radio-control__input {
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--green-dim);
	border-radius: 50%;
	cursor: pointer;
}
.wc-block-components-radio-control .wc-block-components-radio-control__input:checked {
	background: var(--wp--preset--color--panel);
	border-color: var(--wp--preset--color--green);
}
.wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before {
	background: var(--wp--preset--color--green);
}

.wc-block-components-checkbox__input[type="checkbox"]:focus-visible,
.wc-block-components-radio-control .wc-block-components-radio-control__input:focus-visible {
	outline: 1px solid var(--wp--preset--color--green);
	outline-offset: 2px;
}

/* Payment options: the method's name on the left, its logos on the right.
   WooPayments right-aligns its own; PayPal's label is just the name and a
   logo, which WooCommerce's flex-start then left the logo hard against the
   name. */
.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label {
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}
/* WooCommerce overlays its own SVG tick; it is dark-on-green once the box is
   filled, which is the contrast we want, so only the box needed drawing. */
.wc-block-components-checkbox__mark { fill: #03110a; }

/* Panels, summaries and totals. */
.wc-block-components-sidebar .wc-block-components-panel,
.wc-block-components-order-summary,
.wc-block-checkout__sidebar .wc-block-components-panel {
	background: transparent;
}
.wc-block-components-sidebar {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--panel);
	padding: 1.2rem 1.4rem;
}
.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value,
.wc-block-components-product-name,
.wc-block-components-product-metadata {
	color: var(--wp--preset--color--contrast);
}
.wc-block-components-product-name { text-decoration: none; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	color: var(--wp--preset--color--green);
}
.wc-block-components-panel__button,
.wc-block-components-totals-coupon__button {
	color: var(--wp--preset--color--contrast);
}

/* The quantity stepper. */
.wc-block-components-quantity-selector {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--panel);
	border-radius: 0;
}
.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	padding-left: 0;
	padding-right: 0;
	text-align: center;
}
.wc-block-components-quantity-selector input,
.wc-block-components-quantity-selector__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 0;
}
.wc-block-components-quantity-selector__button:hover { color: var(--wp--preset--color--green); }

/* Notices. WooCommerce's error banner is pale pink with near-white text, which
   on this page is both off-palette and genuinely hard to read. */
.wc-block-components-notice-banner {
	border: 1px solid var(--wp--preset--color--green-dim);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--contrast);
	border-radius: 0;
}
.wc-block-components-notice-banner.is-error { border-color: var(--wp--preset--color--amber); }
.wc-block-components-notice-banner.is-error > svg { fill: var(--wp--preset--color--amber); }
.wc-block-components-notice-banner.is-success > svg,
.wc-block-components-notice-banner.is-info > svg { fill: var(--wp--preset--color--green); }
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content { color: inherit; }

/* The place-order and proceed buttons are the page's primary action; they get
   the same treatment as every other button here. */
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	width: 100%;
	justify-content: center;
}

/* --- footer -------------------------------------------------------------- */

.xor-footer a { color: var(--wp--preset--color--muted); text-decoration: none; }
.xor-footer a:hover { color: var(--wp--preset--color--green); }
.xor-footer ul { list-style: none; margin: 0; padding: 0; }
.xor-footer__mark { display: block; width: 168px; height: auto; color: var(--wp--preset--color--green-dim); }

/* --- narrower screens ---------------------------------------------------- */

@media (max-width: 1100px) {
	ul.products { grid-template-columns: repeat(2, 1fr); }
	.woocommerce div.product { grid-template-columns: 1fr; gap: 28px; }
	.woocommerce div.product .woocommerce-product-gallery,
	.woocommerce div.product .summary { grid-column: 1; }
}

@media (max-width: 600px) {
	ul.products { grid-template-columns: 1fr; gap: 16px; }
	.xor-brand { gap: 8px; font-size: 15px; }
	.xor-brand__mark { width: 22px; height: 22px; }
	ul.products li.product a img { height: 200px; }
}

/* Front page ---------------------------------------------------------------
   Every redirect from the old shop lands on `/`, so the front page is the
   catalogue rather than a blog index. The category row under the heading is
   plain links; `.xor-prose a` does not reach here, so it needs its own rule. */
.xor-shop-filter a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.xor-shop-filter a:hover,
.xor-shop-filter a:focus-visible {
	color: var(--wp--preset--color--green);
	border-bottom-color: currentColor;
}

/* Order confirmation -------------------------------------------------------
   `woocommerce/order-confirmation-status` renders <h1>Order received</h1> and
   <p>Thank you. Your order has been received.</p> inside one wrapper, so a
   block-level colour lands on both. The template colours the wrapper green for
   the heading; the sentence under it is ordinary body text. */
.wc-block-order-confirmation-status p {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	margin-top: 0.6rem;
}

/* Ordinary pages -----------------------------------------------------------
   templates/page.html is flow rather than constrained, so the width lives
   here. See the comment in that file for why: constrained layout centres every
   child on its own max-width, which gave the page title and the page content
   two different left edges. */
.xor-page {
	/* The content size, the same box a constrained template would have given
	   it — min() keeps a gutter on narrow screens without a media query. */
	width: min(100% - 3rem, var(--wp--style--global--content-size));
	margin-inline: auto;
}

/* Account ------------------------------------------------------------------
   Login/register, addresses and the order list are classic markup, not blocks,
   so they come dressed by `woocommerce-layout.css` — which floats .col-1 and
   .col-2 at a flat 48% with no breakpoint of its own. The breakpoint lived in
   `woocommerce-smallscreen.css`, which this theme dequeues, so on a phone the
   two columns stayed side by side and pushed the page 5px wider than the
   viewport. A grid replaces both floats and the clearfix. */
.woocommerce .col2-set,
.woocommerce-page .col2-set {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--50);
}

/* That same stylesheet clearfixes .col2-set with ::before and ::after. In a
   grid those are not invisible — they are grid items, and they took the first
   cell, which pushed Login into the second column and Register onto a row of
   its own. There is nothing left to clear once the floats are gone. */
.woocommerce .col2-set::before,
.woocommerce .col2-set::after,
.woocommerce-page .col2-set::before,
.woocommerce-page .col2-set::after {
	content: none;
}

.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2,
.woocommerce-page .col2-set .col-1,
.woocommerce-page .col2-set .col-2 {
	float: none;
	width: auto;
}

@media (min-width: 700px) {
	.woocommerce .col2-set,
	.woocommerce-page .col2-set {
		grid-template-columns: 1fr 1fr;
		gap: var(--wp--preset--spacing--60);
	}
}

/* The one checkbox on the classic forms ("Remember me"). The checkout's
   checkboxes are block markup and already painted; this one is not, and a
   default white browser checkbox on a near-black page is a bright hole. */
.woocommerce form .form-row input[type="checkbox"],
.woocommerce-form__label-for-checkbox input[type="checkbox"] {
	appearance: none;
	width: 1em;
	height: 1em;
	margin-right: 0.5em;
	vertical-align: -0.1em;
	background: var(--wp--preset--color--panel);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	cursor: pointer;
}

.woocommerce form .form-row input[type="checkbox"]:checked,
.woocommerce-form__label-for-checkbox input[type="checkbox"]:checked {
	background: var(--wp--preset--color--green);
	border-color: var(--wp--preset--color--green);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--panel);
}

.woocommerce form .form-row input[type="checkbox"]:focus-visible,
.woocommerce-form__label-for-checkbox input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--wp--preset--color--green);
	outline-offset: 2px;
}

/* WooCommerce's own privacy sentence, which renders at the root font size and
   so shouts next to the field labels beside it. */
.woocommerce-privacy-policy-text p {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	max-width: 56ch;
}

/* "New in store" on the empty cart ------------------------------------------
   The empty-cart and empty-checkout states render WooCommerce's `product-new`
   block, which is a third markup vocabulary again — `wc-block-grid`, older
   than both the product-collection blocks and the classic `ul.products`. Its
   images carry no ratio at all, so a 1:11 module photo rendered 2937px tall
   and the empty cart became a three-screen scroll.

   It is inside the cart block's own inner template, so there is no block
   attribute to set from templates/page-cart.html the way the catalogue does
   it. Hence CSS, and hence !important: the height comes from the img's own
   width/height attributes via the aspect-ratio UA rule. */
.wc-block-grid__product-image img {
	aspect-ratio: 1 !important;
	width: 100% !important;
	height: auto !important;
	max-height: 220px;
	object-fit: contain !important;
}

/* VAT: "Prices for: [country]" and the label under each price -------------
   See inc/vat.php. The label is information a buyer acts on, so contrast, not
   muted — the same rule as prices and stock. */
.xor-vat {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem .7rem;
	margin: .9rem 0 1.1rem;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}
.xor-vat__label {
	color: var(--wp--preset--color--contrast);
}
.xor-vat select {
	/* A select is as wide as its longest option, and the country list has
	   "South Georgia/Sandwich Islands" in it. */
	width: 17rem;
	flex: 0 1 auto;
	padding-top: .35rem;
	padding-bottom: .35rem;
	max-width: 100%;
}
.xor-vat__go {
	font: inherit;
	color: var(--wp--preset--color--contrast);
	background: none;
	border: 1px solid var(--wp--preset--color--line);
	padding: .35rem .7rem;
	cursor: pointer;
}
.xor-vat .xor-vat__note {
	flex: 0 0 100%;
	width: 100%;
	margin: 0;
	line-height: 1.5;
}
.xor-vat__note a {
	color: var(--wp--preset--color--green);
}
.xor-vat-suffix {
	font-size: var(--wp--preset--font-size--small);
	font-weight: normal;
	letter-spacing: 0;
	color: var(--wp--preset--color--contrast);
	white-space: nowrap;
}
.wc-block-product .xor-vat-suffix,
.wc-block-grid__product .xor-vat-suffix {
	display: block;
	font-size: .85em;
}
.xor-rates-note {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	margin-top: .5rem;
}
.xor-specs td small {
	font-size: .85em;
	white-space: nowrap;
}

/* The model cancellation form on /terms-of-sale/: text to copy into an
   e-mail, set apart from the prose around it. */
.xor-form-letter {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base-2);
	padding: 14px 16px;
	font-size: 0.9em;
	line-height: 1.7;
}

/* The serial-number field on products fitted to a unit the customer owns
   (inc/serial-number.php). Label in contrast, never muted: it is a form
   label, and the order cannot go through without it. */
.xor-serial { display: grid; gap: 6px; margin: 0 0 var(--wp--preset--spacing--30); max-width: 22rem; }
.xor-serial label { color: var(--wp--preset--color--contrast); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.xor-serial__req { color: var(--wp--preset--color--amber); }
.xor-serial input {
	width: 100%; box-sizing: border-box; padding: 10px 12px;
	font: inherit; letter-spacing: .04em;
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--line); border-radius: 0;
}
.xor-serial input:focus { outline: 2px solid var(--wp--preset--color--green); outline-offset: 1px; }
.xor-serial__hint { color: var(--wp--preset--color--contrast); font-size: 0.8em; opacity: .8; }

/* Footer logo — the same rule as themes/xor/assets/css/main.css, which the
   shop does not load. Without it the logo filled its column at twice the
   main site's size, and at full green, where the main site uses the dim one. */
.xor-footer-logo {
	display: block;
	width: 190px;
	max-width: 100%;
	margin-bottom: 16px;
	color: var(--wp--preset--color--green-dim);
	transition: color .16s;
}
.xor-footer-logo:hover { color: var(--wp--preset--color--green); }
.xor-footer-logo svg { display: block; width: 100%; height: auto; }

/* The phone menu. Below 600px the navigation is core's full-screen overlay,
   white with black text by default — nothing in theme.json reaches it. The
   site's own colours instead, left-aligned like the rest of a phone page.
   Same selector shape as core's, so this wins. (The main site's main.css has
   the same, plus the sub-menu styling the shop does not need.) */
.wp-block-navigation:not(.has-background):not(.has-text-color) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	--navigation-layout-align: flex-start;
}
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	padding-top: 1.5rem;
}
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 1.4rem;
	align-items: flex-start;
}
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--green);
	font-size: var(--wp--preset--font-size--medium, 1rem);
}
.wp-block-navigation__responsive-container-close,
.wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--contrast); }
