/* Shop (WooCommerce).

   Loaded only on shop, product, cart, checkout and account pages, after
   WooCommerce's own stylesheets, so these rules retheme the plugin rather than
   duplicate it. Everything uses the tokens from site.css and the active scheme
   -- no new colours, so a scheme switch carries the shop with it.

   The product cards reuse .card / .card-body / .card-foot / .card-price from
   site.css; only the pieces WooCommerce brings of its own are defined here. */

/* ---------- shop grid ---------- */

.card-grid--shop {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1000px) {
	.card-grid--shop { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
	.card-grid--shop { grid-template-columns: 1fr; }
}

/* WooCommerce marks the card with its own product classes too; keep the
   theme's card look rather than the plugin's list styling. */
.card-grid--shop .card {
	list-style: none;
	margin: 0;
	padding: 1.25rem 1.25rem 1.5rem;
}

/* The photo links to the product, so it is not .card-photo -- that class is
   what the lightbox binds to, and here the click must follow the link. */
.product-photo {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	margin-bottom: 1.4rem;
	border: 1px solid var(--surface-line);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.product-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.4s ease;
}

.card:hover .product-photo img {
	scale: 1.03;
}

.product-flash {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.3rem 0.7rem;
	border-radius: var(--pill);
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--display);
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.product-flash--out {
	background: var(--fg-soft);
}

.card-grid--shop .card h3 {
	font-size: 1.12rem;
	line-height: 1.35;
}

.card-grid--shop .card h3 a {
	color: inherit;
	text-decoration: none;
}

.card-grid--shop .card h3 a:hover {
	color: var(--accent);
}

/* price markup comes from WooCommerce inside our .card-price */
.card-price .amount .woocommerce-Price-amount,
.product-price .woocommerce-Price-amount {
	font-family: var(--display);
	color: var(--brass);
}

.card-price del,
.product-price del {
	margin-right: 0.4rem;
	opacity: 0.55;
	font-size: 0.7em;
}

/* ---------- buttons ---------- */

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.wc-block-components-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: var(--pill);
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--display);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.wc-block-components-button:hover {
	background: var(--accent);
	color: var(--on-accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow, 0 10px 26px rgba(11, 79, 58, 0.14));
}

/* WooCommerce's "alt" variant (the primary add-to-cart, and the classic
   place-order button) sets its own purple at .woocommerce button.button.alt --
   (0,3,1), which outranks the rule above at (0,2,1). Matching its selector
   shape means ours wins on load order instead: shop.css is enqueued at
   priority 99, after WooCommerce's stylesheet. */
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit.alt:hover {
	background: var(--accent);
	color: var(--on-accent);
}

/* Disabled buttons still have to be readable, just obviously inert. */
.woocommerce .button:disabled,
.woocommerce .button.disabled,
.wc-block-components-button:disabled {
	background: var(--surface-line);
	color: var(--fg-soft);
	opacity: 1;
	transform: none;
	box-shadow: none;
}

/* Keyboard focus. Every WooCommerce button, block or classic, including the
   ones that aren't .wc-block-components-button (quantity steppers, the coupon
   toggle) -- a ring you can actually see against both grounds. */
/* Mouse clicks get no ring; WooCommerce's own blue box-shadow is cleared. */
.wc-block-components-button:not(.is-link):focus {
	box-shadow: none;
	outline: none;
}

/* Keyboard focus, in the site's own green. The :not(.is-link) matches the
   shape WooCommerce uses, so this wins on load order rather than on weight. */
.woocommerce .button:focus-visible,
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible,
.wc-block-components-button:not(.is-link):focus-visible,
.wc-block-components-quantity-selector__button:focus-visible,
.wc-block-components-totals-coupon-link:focus-visible,
.wc-block-components-panel__button:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	box-shadow: none;
}

/* The label colour is set on the button itself and must not be inherited from
   a link rule: WooCommerce renders several of these as <a> inside
   .entry-content. See the note on .entry-content a in theme.css. */
.wc-block-components-button,
.wc-block-components-button:visited {
	color: var(--on-accent);
}

.card-foot .button,
.card-foot .added_to_cart {
	font-size: 0.8rem;
	padding: 0.6rem 1.1rem;
}

.added_to_cart {
	display: inline-block;
	margin-left: 0.5rem;
	color: var(--accent);
	font-size: 0.8rem;
}

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

.product-section {
	padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

.product-single {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}

@media (max-width: 900px) {
	.product-single { grid-template-columns: 1fr; }
}

.product-shots {
	grid-template-columns: 1fr;
	gap: 1rem;
}

.product-shots .card-photo {
	margin-bottom: 0;
	cursor: zoom-in;
}

.product-shots-note {
	margin-top: 0.75rem;
	color: var(--fg-soft);
	font-size: 0.85rem;
}

.product-title {
	font-size: clamp(1.9rem, 4vw, 2.7rem);
	margin: 0.4rem 0 0.9rem;
}

.product-price {
	font-family: var(--display);
	font-size: 1.9rem;
	color: var(--brass);
	margin-bottom: 1.25rem;
}

.product-summary {
	color: var(--fg-soft);
	margin-bottom: 1.25rem;
}

.product-stock {
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 1.5rem;
}

.product-stock.is-in { color: var(--accent); }
.product-stock.is-out { color: var(--fg-soft); }

.product-single form.cart {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
}

.product-single .quantity input {
	width: 5rem;
	padding: 0.65rem 0.6rem;
	border: 1px solid var(--surface-line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--fg);
	font-family: var(--sans);
	font-size: 1rem;
	text-align: center;
}

.product-meta {
	list-style: none;
	margin: 1.75rem 0 0;
	padding: 1.25rem 0 0;
	border-top: 1px solid var(--surface-line);
	font-size: 0.9rem;
}

.product-meta li {
	display: flex;
	gap: 1rem;
	padding: 0.35rem 0;
}

.product-meta .k {
	min-width: 6.5rem;
	color: var(--fg-soft);
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.product-meta .v a { color: var(--accent); }

.product-bespoke {
	margin-top: 1.5rem;
	padding: 1rem 1.2rem;
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-size: 0.95rem;
}

.product-bespoke a { color: var(--accent); }

/* related products, below the fold */
.related.products {
	margin-top: clamp(3rem, 7vw, 5rem);
}

.related.products > h2 {
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin-bottom: 1.75rem;
}

.related.products ul.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 900px) {
	.related.products ul.products { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
	.related.products ul.products { grid-template-columns: 1fr; }
}

/* ---------- cart and checkout ----------
   These two pages are WooCommerce blocks, not templates, so they are themed
   here: one column, held to a comfortable reading measure. */

.woocommerce-cart .entry-content,
.woocommerce-checkout .entry-content,
.woocommerce-cart .wp-block-woocommerce-cart,
.woocommerce-checkout .wp-block-woocommerce-checkout {
	max-width: 640px;
	margin-inline: auto;
}

.wc-block-cart,
.wc-block-checkout {
	--wp--preset--color--contrast: var(--fg);
}

.wc-block-cart .wc-block-cart__main,
.wc-block-cart .wc-block-cart__sidebar,
.wc-block-checkout__main,
.wc-block-checkout__sidebar {
	flex: 1 1 100%;
	max-width: 100%;
	padding-inline: 0;
}

.wp-block-woocommerce-cart.alignwide,
.wp-block-woocommerce-checkout.alignwide,
.wc-block-checkout.alignwide {
	max-width: 640px;
}

.wc-block-components-product-name,
.wc-block-components-title,
.wc-block-components-checkout-step__title {
	font-family: var(--display);
	color: var(--fg);
}

.wc-block-components-totals-item__value,
.wc-block-formatted-money-amount {
	font-family: var(--display);
	color: var(--brass);
}

.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-block-components-select__select {
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-family: var(--sans);
}

.wc-block-components-sidebar-layout .wc-block-components-sidebar {
	order: 2;
}

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

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	margin-bottom: 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--surface-line);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--fg);
	font-size: 0.95rem;
	list-style: none;
}

.woocommerce-error {
	border-left-color: #9b2226;
}

.woocommerce-message .button,
.woocommerce-info .button {
	margin-left: 0.75rem;
}

/* ---------- account page ---------- */

.woocommerce-account .woocommerce {
	max-width: 640px;
	margin-inline: auto;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 1px solid var(--surface-line);
	border-radius: var(--pill);
	color: var(--fg);
	font-size: 0.85rem;
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
	border-color: var(--accent);
	color: var(--accent);
}
