/* =========================================================================
   AFFINITY FORMATIONS — WOOCOMMERCE

   WooCommerce's three classic stylesheets are dequeued in
   inc/woocommerce.php, so this file is fully responsible for the appearance
   of the shop, product, account and order-tracking pages.

   The Cart and Checkout *blocks* are a separate stylesheet (wc-blocks-style)
   which is deliberately left loaded — re-implementing a payment form's
   layout from scratch would be a lot of risk for no gain. This file only
   re-skins it with our tokens.

   Loaded only on WooCommerce pages (see inc/assets.php).
   ========================================================================= */

/* -------------------------------------------------------------------------
   PRODUCT GRID
   ------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
   SHOP ARCHIVE — editorial introduction and real taxonomy navigation
   ------------------------------------------------------------------------- */

.af-shop-hero {
	position: relative;
	overflow: hidden;
	padding-block: var(--af-s-lg) clamp(3.5rem, 7vw, 6.5rem);
	background:
		radial-gradient(circle at 80% 12%, color-mix(in srgb, var(--af-gold-soft) 58%, transparent), transparent 31%),
		linear-gradient(145deg, var(--af-bone) 0%, var(--af-surface) 68%, var(--af-surface-alt) 100%);
}

.af-shop-hero::after {
	content: "";
	position: absolute;
	right: -10rem;
	top: -15rem;
	width: 34rem;
	height: 34rem;
	border: 1px solid color-mix(in srgb, var(--af-gold) 32%, transparent);
	border-radius: 50%;
	pointer-events: none;
}

.af-shop-hero .af-breadcrumb {
	position: relative;
	z-index: 1;
	margin-bottom: var(--af-s-lg);
}

.af-shop-hero__grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 0.82fr) minmax(24rem, 1.18fr);
	align-items: end;
	gap: clamp(2rem, 6vw, 6rem);
}

.af-shop-hero h1 {
	max-width: 12ch;
	font-size: clamp(3.5rem, 7vw, 6.25rem);
	line-height: 0.92;
	letter-spacing: -0.045em;
}

.af-shop-hero .af-lead {
	margin-top: var(--af-s-md);
}

.af-shop-hero__promise {
	position: absolute;
	right: var(--af-s-md);
	bottom: var(--af-s-md);
	left: var(--af-s-md);
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: var(--af-s-sm) var(--af-s-md);
	border: 1px solid rgb(255 255 255 / 0.24);
	border-radius: var(--af-r-md);
	background: rgb(14 14 16 / 0.84);
	box-shadow: var(--af-shadow-1);
	font-size: var(--af-t-small);
	color: var(--af-on-dark-muted);
	backdrop-filter: blur(10px);
}

.af-shop-hero__promise strong {
	color: var(--af-on-dark);
	font-size: var(--af-t-body);
}

.af-shop-hero__visual {
	position: relative;
	overflow: hidden;
	border-radius: var(--af-r-lg);
	background: var(--af-surface);
	box-shadow: var(--af-shadow-2);
}

.af-shop-hero__visual > img {
	display: block;
	width: 100%;
	height: auto;
}

.af-shop-filters {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: var(--af-s-2xs);
	margin-top: var(--af-s-xl);
}

.af-shop-filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding-inline: 18px;
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-pill);
	background: color-mix(in srgb, var(--af-surface) 72%, transparent);
	color: var(--af-ink);
	font-size: var(--af-t-small);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--af-dur-fast) var(--af-ease-out), border-color var(--af-dur-fast) var(--af-ease-out), color var(--af-dur-fast) var(--af-ease-out);
}

.af-shop-filter:hover,
.af-shop-filter.is-active {
	border-color: var(--af-ink);
	background: var(--af-ink);
	color: var(--af-surface);
}

.af-shop-catalog {
	padding-block: clamp(3.5rem, 7vw, 6.5rem);
}

.af-shop-catalog .woocommerce-notices-wrapper:empty {
	display: none;
}

.af-shop-catalog .woocommerce-result-count,
.af-shop-catalog .woocommerce-ordering {
	margin-bottom: var(--af-s-xl);
}

.af-shop-catalog .woocommerce-result-count {
	padding-top: 10px;
}

.af-shop-catalog .woocommerce-ordering select {
	min-width: 13rem;
	background-color: var(--af-surface);
}

/* Shop gallery ----------------------------------------------------------- */

.af-shop-gallery {
	background: linear-gradient(180deg, var(--af-bone) 0%, var(--af-surface) 100%);
	padding-block: var(--af-s-3xl);
}

.af-shop-gallery__header {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
	align-items: end;
	gap: var(--af-s-2xl);
	margin-bottom: var(--af-s-2xl);
}

.af-shop-gallery__header h2 {
	max-width: 12ch;
	margin: 0;
	font-size: clamp(2.6rem, 6vw, 5.75rem);
	line-height: 0.96;
}

.af-shop-gallery__header .af-lead {
	max-width: 38rem;
	margin: 0 0 0.35rem;
}

.af-shop-gallery__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.af-shop-gallery__item {
	position: relative;
	grid-column: span 3;
	margin: 0;
	overflow: hidden;
	border-radius: var(--af-r-lg);
	background: var(--af-ink);
	box-shadow: var(--af-shadow-1);
}

.af-shop-gallery__item--product {
	aspect-ratio: 4 / 5;
}

.af-shop-gallery__item--wide,
.af-shop-gallery__item--story {
	grid-column: span 6;
	aspect-ratio: 3 / 2;
}

.af-shop-gallery__item--portrait {
	grid-column: span 4;
	aspect-ratio: 2 / 3;
}

.af-shop-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms var(--af-ease-out);
}

.af-shop-gallery__item--product img,
.af-shop-gallery__item--wide:not(.af-shop-gallery__item--story) img {
	object-fit: contain;
}

.af-shop-gallery__item::after {
	content: '';
	position: absolute;
	inset: auto 0 0;
	height: 42%;
	background: linear-gradient(transparent, rgb(0 0 0 / 0.78));
	pointer-events: none;
}

.af-shop-gallery__item figcaption {
	position: absolute;
	z-index: 1;
	right: 1rem;
	bottom: 0.9rem;
	left: 1rem;
	color: #fff;
	font-size: var(--af-t-small);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.af-shop-gallery__item:hover img {
	transform: scale(1.025);
}

@media (max-width: 960px) {
	.af-shop-gallery__header {
		grid-template-columns: 1fr;
		gap: var(--af-s-md);
	}

	.af-shop-gallery__item,
	.af-shop-gallery__item--portrait {
		grid-column: span 4;
	}

	.af-shop-gallery__item--wide,
	.af-shop-gallery__item--story {
		grid-column: span 6;
	}
}

@media (max-width: 640px) {
	.af-shop-gallery {
		padding-block: var(--af-s-2xl);
	}

	.af-shop-gallery__grid {
		grid-template-columns: 1fr;
	}

	.af-shop-gallery__item,
	.af-shop-gallery__item--wide,
	.af-shop-gallery__item--story,
	.af-shop-gallery__item--portrait {
		grid-column: 1;
		aspect-ratio: 4 / 5;
	}

	.af-shop-gallery__item--story:not(.af-shop-gallery__item--portrait),
	.af-shop-gallery__item--wide {
		aspect-ratio: 3 / 2;
	}
}

.af-shop-help {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--af-s-xl);
	margin-bottom: var(--af-s-2xl);
	padding: clamp(2rem, 5vw, 3.5rem);
	border-radius: var(--af-r-lg);
	background: var(--af-ink);
	color: var(--af-on-dark);
}

.af-shop-help h2 {
	margin-bottom: var(--af-s-xs);
	color: var(--af-on-dark);
	font-size: clamp(2rem, 4vw, 3rem);
}

.af-shop-help p {
	margin: 0;
	color: var(--af-on-dark-muted);
}

.af-shop-help > p {
	flex-shrink: 0;
}

@media (max-width: 767px) {
	.af-shop-hero__grid,
	.af-shop-help {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.af-shop-hero h1 {
		font-size: clamp(3.25rem, 16vw, 4.75rem);
	}

	.af-shop-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: var(--af-s-2xs);
		scrollbar-width: thin;
	}

	.af-shop-filter {
		flex: 0 0 auto;
	}

	.af-shop-catalog .woocommerce-ordering {
		float: none;
		display: block;
	}

	.af-shop-catalog .woocommerce-ordering select {
		width: 100%;
	}
}

.woocommerce ul.products,
ul.products {
	display: grid;
	gap: var(--af-s-xl) var(--af-s-lg);
	grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

ul.products::before,
ul.products::after {
	content: none;
}

ul.products > li.product {
	width: auto;
	margin: 0;
	float: none;
	clear: none;
}

/* -------------------------------------------------------------------------
   PRODUCT CARD EXTRAS
   Base card styles live in components.css; only commerce-specific parts
   are here.
   ------------------------------------------------------------------------- */

.af-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.af-shop-catalog .af-card {
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

.af-shop-catalog .af-card:hover {
	box-shadow: none;
	translate: 0 -4px;
}

.af-shop-catalog .af-card__media {
	aspect-ratio: 4 / 5;
	border-radius: 0;
	box-shadow: var(--af-shadow-1);
}

.af-shop-catalog .af-card__img {
	transition: opacity var(--af-dur-base) var(--af-ease-out), transform var(--af-dur-slow) var(--af-ease-out);
}

.af-shop-catalog .af-card:hover .af-card__img {
	transform: scale(1.025);
}

.af-shop-catalog .af-card__body {
	padding: var(--af-s-sm) 2px 0;
}

.af-shop-catalog .af-card__title {
	font-size: 1.2rem;
}

.af-card__summary {
	margin: 0;
	color: var(--af-slate);
	font-size: var(--af-t-small);
	line-height: 1.5;
}

.af-shop-catalog .af-card__price {
	margin: 0;
	font-weight: 700;
}

.af-shop-catalog .af-card__actions {
	margin-top: var(--af-s-xs);
}

.af-shop-catalog .af-card__actions .af-btn {
	min-height: 44px;
	font-size: var(--af-t-small);
}

.af-card__img--alt {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity var(--af-dur-base) var(--af-ease-out);
}

.af-card:hover .af-card__img--alt,
.af-card:focus-within .af-card__img--alt {
	opacity: 1;
}

.af-card__badge {
	position: absolute;
	top: var(--af-s-xs);
	left: var(--af-s-xs);
	z-index: 2;
	background-color: var(--af-crimson);
	color: var(--af-surface);
}

.af-card__price-prefix {
	font-weight: 400;
	color: var(--af-slate);
}

.af-card__title a {
	color: inherit;
	text-decoration: none;
}

.af-card__title a:hover {
	color: var(--af-crimson);
}

/*
 * The card overlay (.af-card__link::after) covers the whole card, so any
 * genuinely separate control must be lifted above it or it becomes
 * unclickable — a bug that is invisible until someone tries to buy.
 */
.af-card__actions,
.af-card__rating {
	position: relative;
	z-index: 2;
}

.af-card__actions {
	margin-top: var(--af-s-2xs);
}

/* -------------------------------------------------------------------------
   STAR RATINGS
   ------------------------------------------------------------------------- */

/*
 * WooCommerce's default star rating uses its own icon font, which is
 * declared inside woocommerce-general.css — the stylesheet we dequeue. Using
 * those glyph codepoints here would render empty boxes on every review.
 *
 * Unicode stars have no font dependency, inherit our colour tokens, and
 * survive any future WooCommerce asset reshuffle. `ch` units keep the track
 * width stable so the fill percentage stays accurate across typefaces.
 */
.star-rating {
	position: relative;
	display: inline-block;
	width: 5.5ch;
	height: 1.3em;
	overflow: hidden;
	font-size: var(--af-t-small);
	line-height: 1.3;
	letter-spacing: 0.05ch;
	white-space: nowrap;
}

.star-rating::before {
	content: "★★★★★";
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	color: var(--af-line);
}

.star-rating span {
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	overflow: hidden;
	/* WooCommerce sets an inline width percentage on this element. */
	height: 100%;
}

.star-rating span::before {
	content: "★★★★★";
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	color: var(--af-gold);
}

.woocommerce-review-link {
	font-size: var(--af-t-small);
	color: var(--af-slate);
}

/* -------------------------------------------------------------------------
   SINGLE PRODUCT
   ------------------------------------------------------------------------- */

/*
 * The product block also emits WooCommerce's legacy breadcrumb internally.
 * The block template already provides the accessible page-level trail, so
 * the nested copy is suppressed as a final safeguard against duplicate output.
 */
.single-product .af-section--tight .af-breadcrumb,
.single-product .af-section--tight .woocommerce-breadcrumb {
	display: none;
}

.single-product .af-section--tight {
	padding-top: var(--af-s-lg);
	padding-bottom: var(--af-s-3xl);
}

.single-product div.product {
	position: relative;
	display: grid;
	gap: var(--af-s-xl);
	grid-template-columns: 1fr;
	align-items: start;
}

/*
 * The sale badge is the first child emitted by WooCommerce. It must be an
 * overlay rather than a grid item, otherwise it takes the gallery's cell and
 * pushes the product title and purchase details onto the next row.
 */
.single-product div.product > .onsale {
	position: absolute;
	top: var(--af-s-sm);
	left: var(--af-s-sm);
	z-index: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 7px 11px;
	background-color: var(--af-crimson);
	color: var(--af-surface);
	border-radius: var(--af-r-pill);
	font-size: var(--af-t-micro);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.single-product div.product .woocommerce-product-gallery,
.single-product div.product .summary {
	float: none;
	clear: none;
	width: 100%;
	min-width: 0;
	margin: 0;
}

@media (min-width: 1024px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		column-gap: 0;
		row-gap: var(--af-s-3xl);
	}

	.single-product div.product .woocommerce-product-gallery {
		position: relative;
		grid-column: 1;
		grid-row: 1;
	}

	.single-product div.product .summary {
		grid-column: 2;
		grid-row: 1;
		padding: var(--af-s-xs) var(--af-s-md) var(--af-s-lg) clamp(2rem, 5vw, 5rem);
	}

	/* Tabs, description and related products span the full width below. */
	.single-product div.product .woocommerce-tabs,
	.single-product div.product .related,
	.single-product div.product .upsells {
		grid-column: 1 / -1;
	}
}

.woocommerce-product-gallery {
	position: relative;
}

.woocommerce-product-gallery__trigger {
	position: absolute;
	top: var(--af-s-sm);
	right: var(--af-s-sm);
	z-index: 7;
	display: grid;
	place-items: center;
	width: var(--af-touch);
	height: var(--af-touch);
	overflow: hidden;
	background-color: color-mix(in srgb, var(--af-surface) 92%, transparent);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-pill);
	box-shadow: var(--af-shadow-1);
	color: var(--af-ink);
	font-size: 0;
	text-decoration: none;
}

.woocommerce-product-gallery__trigger::before {
	content: "";
	width: 13px;
	height: 13px;
	border: 2px solid currentColor;
	border-radius: 50%;
	translate: -2px -2px;
}

.woocommerce-product-gallery__trigger::after {
	content: "";
	position: absolute;
	width: 8px;
	height: 2px;
	background-color: currentColor;
	border-radius: var(--af-r-pill);
	translate: 7px 7px;
	rotate: 45deg;
}

.woocommerce-product-gallery__trigger:hover {
	background-color: var(--af-surface);
	color: var(--af-crimson);
}

.woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	border-radius: 0;
}

.woocommerce-product-gallery .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
	gap: var(--af-s-2xs);
	list-style: none;
	margin: var(--af-s-sm) 0 0;
	padding: 0;
}

.woocommerce-product-gallery .flex-control-thumbs img {
	cursor: pointer;
	opacity: 0.6;
	transition: opacity var(--af-dur-fast) var(--af-ease-out);
}

.woocommerce-product-gallery .flex-control-thumbs img:hover,
.woocommerce-product-gallery .flex-control-thumbs .flex-active {
	opacity: 1;
}

.single-product div.product .product_title {
	font-family: var(--af-font-display);
	font-size: clamp(2.25rem, 4.5vw, 3.75rem) !important;
	font-variation-settings: var(--wp--custom--font-variation--display);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin-bottom: var(--af-s-sm);
}

.single-product div.product p.price,
.single-product div.product span.price {
	display: block;
	font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
	font-weight: 600;
	color: var(--af-ink);
	font-variant-numeric: tabular-nums;
	margin-bottom: var(--af-s-md);
}

@media (max-width: 1023px) {
	.single-product div.product .summary {
		padding: var(--af-s-sm) 0 var(--af-s-lg);
	}
}

.single-product div.product p.price del {
	color: var(--af-slate);
	font-weight: 400;
	margin-inline-end: var(--af-s-2xs);
}

.single-product div.product p.price ins {
	text-decoration: none;
	color: var(--af-crimson);
}

.woocommerce-product-details__short-description {
	font-size: var(--af-t-lead);
	line-height: 1.55;
	color: var(--af-slate);
	max-width: var(--af-measure-lead);
	margin-bottom: var(--af-s-lg);
}

.product_meta {
	margin-top: var(--af-s-lg);
	padding-top: var(--af-s-md);
	border-top: 1px solid var(--af-line);
	font-size: var(--af-t-small);
	color: var(--af-slate);
}

.product_meta > span {
	display: block;
	margin-bottom: 4px;
}

/* -------------------------------------------------------------------------
   ADD TO CART / QUANTITY
   ------------------------------------------------------------------------- */

form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-s-sm);
	margin-bottom: var(--af-s-lg);
}

.quantity {
	display: inline-flex;
	align-items: center;
}

.quantity .qty {
	width: 5rem;
	min-height: var(--af-control-h);
	padding: var(--af-s-2xs) var(--af-s-xs);
	text-align: center;
	background-color: var(--af-surface-alt);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-sm);
	font-variant-numeric: tabular-nums;
}

.quantity .qty:focus {
	background-color: var(--af-surface);
	border-color: var(--af-crimson);
	outline: 3px solid var(--af-info);
	outline-offset: 2px;
}

/*
 * WooCommerce emits its own button classes. Rather than duplicating the
 * button system, map them onto it.
 */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
a.button,
button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--af-s-2xs);
	min-height: var(--af-btn-h);
	padding: 0 var(--af-s-md);
	background-color: var(--af-ink);
	color: var(--af-bone);
	border: 1.5px solid var(--af-ink);
	border-radius: var(--af-r-md);
	font-family: var(--af-font-body);
	font-size: var(--af-t-body);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--af-dur-fast) var(--af-ease-out),
		border-color var(--af-dur-fast) var(--af-ease-out),
		translate var(--af-dur-fast) var(--af-ease-out);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background-color: var(--af-ink-800);
	border-color: var(--af-ink-800);
	color: var(--af-bone);
	translate: 0 -1px;
}

/* The primary purchase action is always crimson. */
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce input.button.alt,
.single_add_to_cart_button {
	background-color: var(--af-crimson);
	border-color: var(--af-crimson);
	color: var(--af-surface);
}

.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce input.button.alt:hover,
.single_add_to_cart_button:hover {
	background-color: var(--af-crimson-deep);
	border-color: var(--af-crimson-deep);
	color: var(--af-surface);
}

.woocommerce button.button:disabled,
.woocommerce button.button.disabled,
.woocommerce a.button.disabled {
	background-color: var(--af-surface-alt);
	border-color: var(--af-line);
	color: var(--af-slate);
	cursor: not-allowed;
	translate: 0 0;
}

/* -------------------------------------------------------------------------
   VARIATIONS
   ------------------------------------------------------------------------- */

table.variations {
	width: 100%;
	margin-bottom: var(--af-s-md);
}

table.variations th,
table.variations td {
	padding: var(--af-s-2xs) 0;
	text-align: left;
	vertical-align: middle;
	border: 0;
}

table.variations th label {
	font-size: var(--af-t-small);
	font-weight: 600;
}

table.variations select {
	width: 100%;
	min-height: var(--af-control-h);
	padding: var(--af-s-2xs) var(--af-s-sm);
	background-color: var(--af-surface-alt);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-sm);
	font-size: var(--af-t-body);
}

.woocommerce-variation-price {
	margin-bottom: var(--af-s-sm);
}

.reset_variations {
	font-size: var(--af-t-small);
	color: var(--af-slate);
}

/* -------------------------------------------------------------------------
   TABS, DESCRIPTION, REVIEWS
   ------------------------------------------------------------------------- */

.woocommerce-tabs {
	margin-top: var(--af-s-2xl);
	padding-top: var(--af-s-xl);
	border-top: 1px solid var(--af-line);
}

.woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--af-s-md);
	list-style: none;
	margin: 0 0 var(--af-s-lg);
	padding: 0;
	border-bottom: 1px solid var(--af-line);
}

.woocommerce-tabs ul.tabs li a {
	display: inline-flex;
	align-items: center;
	min-height: var(--af-touch);
	padding-bottom: var(--af-s-2xs);
	border-bottom: 2px solid transparent;
	font-size: var(--af-t-small);
	font-weight: 600;
	color: var(--af-slate);
	text-decoration: none;
	transition:
		color var(--af-dur-fast) var(--af-ease-out),
		border-color var(--af-dur-fast) var(--af-ease-out);
}

.woocommerce-tabs ul.tabs li a:hover {
	color: var(--af-ink);
}

.woocommerce-tabs ul.tabs li.active a {
	color: var(--af-crimson);
	border-bottom-color: var(--af-crimson);
}

.woocommerce-Tabs-panel {
	max-width: var(--af-measure-prose);
}

.woocommerce-Tabs-panel h2 {
	font-size: var(--af-t-h3);
	margin-bottom: var(--af-s-sm);
}

.related > h2,
.upsells > h2 {
	font-size: var(--af-t-h2);
	margin-bottom: var(--af-s-lg);
}

.related,
.upsells {
	margin-top: var(--af-s-2xl);
}

/* -------------------------------------------------------------------------
   NOTICES
   Errors must never be crimson — crimson is the brand action colour, and
   a page where the brand colour also means "something went wrong" reads
   as broken (see design system §1).
   ------------------------------------------------------------------------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-s-sm);
	margin: 0 0 var(--af-s-lg);
	padding: var(--af-s-sm) var(--af-s-md);
	border: 1px solid transparent;
	border-radius: var(--af-r-md);
	font-size: var(--af-t-small);
	list-style: none;
}

.woocommerce-message {
	background-color: color-mix(in srgb, var(--af-success) 10%, var(--af-surface));
	border-color: color-mix(in srgb, var(--af-success) 35%, transparent);
	color: var(--af-success);
}

.woocommerce-info {
	background-color: color-mix(in srgb, var(--af-info) 8%, var(--af-surface));
	border-color: color-mix(in srgb, var(--af-info) 30%, transparent);
	color: var(--af-info);
}

.woocommerce-error {
	background-color: color-mix(in srgb, var(--af-error) 8%, var(--af-surface));
	border-color: color-mix(in srgb, var(--af-error) 35%, transparent);
	color: var(--af-error);
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	margin-inline-start: auto;
	min-height: 40px;
}

/* -------------------------------------------------------------------------
   RESULT COUNT & ORDERING
   ------------------------------------------------------------------------- */

.woocommerce-result-count,
.woocommerce-ordering {
	display: inline-block;
	margin-bottom: var(--af-s-lg);
	font-size: var(--af-t-small);
	color: var(--af-slate);
}

.woocommerce-ordering {
	float: right;
}

.woocommerce-ordering select {
	min-height: 44px;
	padding: var(--af-s-3xs) var(--af-s-sm);
	background-color: var(--af-surface-alt);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-sm);
	font-size: var(--af-t-small);
}

/* -------------------------------------------------------------------------
   PAGINATION
   ------------------------------------------------------------------------- */

.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--af-s-2xs);
	list-style: none;
	margin: var(--af-s-2xl) 0 0;
	padding: 0;
}

.woocommerce-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--af-touch);
	min-height: var(--af-touch);
	padding: 0 var(--af-s-2xs);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-sm);
	font-size: var(--af-t-small);
	color: var(--af-ink);
	text-decoration: none;
}

.woocommerce-pagination .page-numbers:hover {
	border-color: var(--af-ink);
}

.woocommerce-pagination .page-numbers.current {
	background-color: var(--af-ink);
	border-color: var(--af-ink);
	color: var(--af-bone);
}

/* -------------------------------------------------------------------------
   ORDER TIMELINE
   Rendered by Customer_Account::render_timeline() on the My Account "View
   Order" page and the post-checkout order-received page (brief §18).
   Vertical on mobile, horizontal on desktop, per docs/03-design-system.md.
   ------------------------------------------------------------------------- */

.af-order-timeline {
	display: flex;
	flex-direction: column;
	gap: 0;
	list-style: none;
	margin: 0 0 var(--af-s-xl);
	padding: 0;
}

@media (min-width: 768px) {
	.af-order-timeline {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

.af-order-timeline__step {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--af-s-xs);
	padding: var(--af-s-2xs) 0;
	font-size: var(--af-t-small);
	color: var(--af-slate);
}

@media (min-width: 768px) {
	.af-order-timeline__step {
		flex: 1 1 0;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--af-s-2xs);
		padding-inline-end: var(--af-s-md);
		border-top: 2px solid var(--af-line);
		padding-top: var(--af-s-sm);
	}

	.af-order-timeline__step .af-order-timeline__dot {
		position: absolute;
		top: -7px;
		left: 0;
	}
}

.af-order-timeline__dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: var(--af-surface);
	border: 2px solid var(--af-line);
	flex-shrink: 0;
}

.af-order-timeline__step.is-done {
	color: var(--af-ink);
}

.af-order-timeline__step.is-done .af-order-timeline__dot {
	background-color: var(--af-success);
	border-color: var(--af-success);
}

@media (min-width: 768px) {
	.af-order-timeline__step.is-done {
		border-top-color: var(--af-success);
	}
}

.af-order-timeline__step.is-current {
	color: var(--af-crimson);
	font-weight: 600;
}

.af-order-timeline__step.is-current .af-order-timeline__dot {
	background-color: var(--af-crimson);
	border-color: var(--af-crimson);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--af-crimson) 20%, transparent);
}

@media (min-width: 768px) {
	.af-order-timeline__step.is-current {
		border-top-color: var(--af-crimson);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.af-order-timeline__step.is-current .af-order-timeline__dot {
		animation: af-timeline-pulse 2s ease-in-out infinite;
	}
}

@keyframes af-timeline-pulse {
	0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--af-crimson) 20%, transparent); }
	50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--af-crimson) 12%, transparent); }
}

/* -------------------------------------------------------------------------
   PROOF APPROVAL PAGE
   Rendered by Proof_Page — uses the same commerce stylesheet since it sits
   alongside checkout/account in the customer's purchase journey.
   ------------------------------------------------------------------------- */

.af-proof-image {
	background-color: var(--af-ink);
	border-radius: var(--af-r-lg);
	overflow: hidden;
	display: flex;
	justify-content: center;
}

.af-proof-image img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* -------------------------------------------------------------------------
   MY ACCOUNT
   ------------------------------------------------------------------------- */

.woocommerce-account .woocommerce {
	display: grid;
	gap: var(--af-s-xl);
	grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
	.woocommerce-account .woocommerce {
		grid-template-columns: 16rem minmax(0, 1fr);
		gap: var(--af-s-2xl);
	}
}

.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.woocommerce-MyAccount-navigation a {
	display: block;
	padding: var(--af-s-xs) var(--af-s-sm);
	border-radius: var(--af-r-sm);
	font-size: var(--af-t-small);
	font-weight: 500;
	color: var(--af-ink);
	text-decoration: none;
	transition: background-color var(--af-dur-fast) var(--af-ease-out);
}

.woocommerce-MyAccount-navigation a:hover {
	background-color: var(--af-surface-alt);
}

.woocommerce-MyAccount-navigation li.is-active a {
	background-color: var(--af-ink);
	color: var(--af-bone);
}

/* -------------------------------------------------------------------------
   TABLES (orders, downloads, order details)
   ------------------------------------------------------------------------- */

.woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	background-color: var(--af-surface);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-md);
	overflow: hidden;
	font-size: var(--af-t-small);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: var(--af-s-sm);
	text-align: left;
	border-bottom: 1px solid var(--af-line);
}

.woocommerce table.shop_table th {
	font-weight: 600;
	background-color: var(--af-surface-alt);
}

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

/* Stack tables on small screens rather than forcing a horizontal scroll. */
@media (max-width: 767px) {
	.woocommerce table.shop_table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	.woocommerce table.shop_table tr {
		display: block;
		border-bottom: 1px solid var(--af-line);
		padding: var(--af-s-2xs) 0;
	}

	.woocommerce table.shop_table td {
		display: flex;
		justify-content: space-between;
		gap: var(--af-s-sm);
		border-bottom: 0;
		padding: var(--af-s-2xs) var(--af-s-sm);
	}

	.woocommerce table.shop_table td::before {
		content: attr(data-title);
		font-weight: 600;
		color: var(--af-slate);
	}
}

/* -------------------------------------------------------------------------
   FORMS (login, register, order tracking, address)
   ------------------------------------------------------------------------- */

.woocommerce form .form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: var(--af-s-md);
}

.woocommerce form .form-row label {
	font-size: var(--af-t-small);
	font-weight: 600;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	width: 100%;
	min-height: var(--af-control-h);
	padding: var(--af-s-xs) var(--af-s-sm);
	background-color: var(--af-surface-alt);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-sm);
	font-size: var(--af-t-body);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
	background-color: var(--af-surface);
	border-color: var(--af-crimson);
	outline: 3px solid var(--af-info);
	outline-offset: 2px;
}

.woocommerce form .form-row .required {
	color: var(--af-error);
	text-decoration: none;
}

.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce form.track_order {
	max-width: var(--af-w-narrow);
	padding: var(--af-s-lg);
	background-color: var(--af-surface);
	border: 1px solid var(--af-line);
	border-radius: var(--af-r-lg);
}

/* -------------------------------------------------------------------------
   CART & CHECKOUT BLOCKS — token re-skin only
   wc-blocks-style stays loaded; these variables retheme it.
   ------------------------------------------------------------------------- */

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
	--wp--preset--color--contrast: var(--af-ink);
	font-family: var(--af-font-body);
}

.wc-block-components-title,
.wc-block-cart__submit-container + *,
.wp-block-woocommerce-checkout .wc-block-components-title {
	font-family: var(--af-font-body);
	font-weight: 600;
}

.wc-block-components-button:not(.is-link) {
	min-height: var(--af-btn-h);
	background-color: var(--af-crimson);
	border-radius: var(--af-r-md);
	color: var(--af-surface);
	font-family: var(--af-font-body);
	font-weight: 600;
}

.wc-block-components-button:not(.is-link):hover {
	background-color: var(--af-crimson-deep);
}

.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-textarea {
	background-color: var(--af-surface-alt);
	border-color: var(--af-line);
	border-radius: var(--af-r-sm);
}

.wc-block-components-panel,
.wc-block-components-totals-wrapper,
.wc-block-checkout__sidebar .wc-block-components-sidebar {
	border-color: var(--af-line);
}

.wc-block-components-order-summary__content,
.wc-block-components-sidebar {
	background-color: var(--af-surface);
	border-radius: var(--af-r-lg);
}

/* -------------------------------------------------------------------------
   PRICE FORMATTING
   ------------------------------------------------------------------------- */

.woocommerce-Price-amount {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.woocommerce-Price-currencySymbol {
	font-size: 0.85em;
	vertical-align: baseline;
}
