/*
 * WooCommerce — ASFC design system integration
 *
 * Replaces WooCommerce's three default stylesheets entirely (suppressed via
 * `woocommerce_enqueue_styles` in inc/woocommerce.php). Every rule maps
 * WooCommerce's output classes to the ASFC design tokens so the shop matches
 * `.asfc-btn / .asfc-card / .asfc-input` exactly.
 *
 * Scope: rules are scoped to `.woocommerce` (or the shop body classes) so
 * nothing leaks into the rest of the site or WP admin.
 *
 * Fulfilment model: COLLECTION ONLY on home matchdays. Shipping is disabled at
 * the WooCommerce level; section 11 hides any shipping UI that survives.
 */

/* ── 1. Page scaffolding ──────────────────────────────────────────────── */

.woocommerce-page .asfc-shop {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--section-y);
}

@media (min-width: 768px) {
  .woocommerce-page .asfc-shop {
    padding-inline: var(--gutter-lg);
    padding-block: var(--section-y-lg);
  }
}

/* Basket / Checkout / My account render through page.php (they are pages with
   a shortcode, not WooCommerce templates). page.php gives them this class
   instead of .asfc-prose so they get the full container width. */
.asfc-shop-content {
  max-width: none;
}

/* WooCommerce ships a sidebar by default; the theme has none. */
.woocommerce-page .widget-area,
.woocommerce-page #secondary { display: none; }

/* Result count + ordering bar */
.woocommerce .woocommerce-result-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-6);
}

/* The ordering form is a float in WooCommerce's own CSS; here it sits in normal
   flow and needs its own space below before the grid starts. */
.woocommerce .woocommerce-ordering {
  margin: 0 0 var(--space-8);
}

.woocommerce .woocommerce-ordering select {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--text-default);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 9px 38px 9px 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5852' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.woocommerce .woocommerce-ordering select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

/* Shop intro — replaces WooCommerce's result count. */
.asfc-shop-intro {
  max-width: 68ch;
  color: var(--text-muted);
  margin: 0 0 var(--space-8);
}

/* Category chips. The component lives in theme.css (.asfc-chips/.asfc-chip)
   and is shared with the news archive; these are anchors rather than buttons,
   so they need the link defaults unpicked. */
.asfc-shop-filters { margin-bottom: var(--space-8); }

a.asfc-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

a.asfc-chip:hover { color: var(--text-default); }
a.asfc-chip.is-active:hover { color: var(--brand-white); }
a.asfc-chip:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* Back to the listing — single product. Ships as "View all products" and is
   upgraded to "Back" by assets/js/theme.js when the shopper came from one. */
.asfc-back { margin: 0 0 var(--space-6); }

.asfc-back__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.asfc-back__link:hover { color: var(--text-default); }
.asfc-back__link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* flex: none so the arrow cannot be squashed onto a second line by a long
   label on a narrow phone. */
.asfc-back__link svg { flex: none; width: 1.1em; height: 1.1em; }

/* Fulfilment line — lead time + collection, above the add to basket button. */
.asfc-fulfilment {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.asfc-fulfilment svg { flex: none; width: 1.05em; height: 1.05em; margin-top: 0.15em; }

/* Size guide link, under the Size dropdown. */
.asfc-sizeguide-link { margin: calc(var(--space-3) * -1) 0 var(--space-5); }

.asfc-sizeguide-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-default);
  text-underline-offset: 3px;
}

.asfc-sizeguide-link a:hover { color: var(--text-muted); }
.asfc-sizeguide-link svg { flex: none; width: 1.05em; height: 1.05em; }

/* ── 1b. Size guide modal ─────────────────────────────────────────────── */

.asfc-sizeguide {
  width: min(560px, calc(100vw - var(--space-6) * 2));
  max-height: calc(100vh - var(--space-8) * 2);
  padding: 0;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-default);
  color: var(--text-default);
  box-shadow: var(--shadow-md);
  overflow: auto;
}

.asfc-sizeguide::backdrop { background: rgba(10, 10, 10, 0.55); }

/* The element is rendered with [hidden] so an unsupporting browser does not
   paint the table inline; without this the UA's dialog rules would win. */
.asfc-sizeguide[hidden] { display: none; }

.asfc-sizeguide__inner { padding: var(--space-6); }

.asfc-sizeguide__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}

.asfc-sizeguide__head h2 { margin: 0; font-size: var(--font-size-xl); }

.asfc-sizeguide__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-default);
  cursor: pointer;
}

.asfc-sizeguide__close:hover { background: var(--neutral-100); }
.asfc-sizeguide__close:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.asfc-sizeguide__close svg { width: 18px; height: 18px; }

.asfc-sizeguide__intro,
.asfc-sizeguide__note {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

.asfc-sizeguide__note { margin: var(--space-5) 0 0; }

.asfc-sizeguide__subtitle {
  font-size: var(--font-size-base);
  margin: var(--space-5) 0 var(--space-3);
}

.asfc-sizeguide__subtitle:first-of-type { margin-top: 0; }

/* Narrow phones: the table scrolls in its own box rather than the page. */
.asfc-sizeguide__scroll { overflow-x: auto; }

.asfc-sizeguide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.asfc-sizeguide__table th,
.asfc-sizeguide__table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: var(--border-width) solid var(--border-default);
  white-space: nowrap;
}

.asfc-sizeguide__table thead th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.asfc-sizeguide__table tbody th { font-weight: var(--font-weight-semibold); }
.asfc-sizeguide__table tbody tr:last-child th,
.asfc-sizeguide__table tbody tr:last-child td { border-bottom: 0; }

/* ── 2. Product grid (shop + category archives) ───────────────────────── */

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Three columns at the top step, not four — see asfc_wc_loop_columns() in
   inc/woocommerce.php, which must stay in step with this. */
@media (min-width: 768px) { .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); } }

/* Cards the lazy loader has not revealed yet. The [hidden] attribute alone is
   not enough: the rule below sets display:flex on every card, which outranks
   the user-agent [hidden] { display: none }. */
.woocommerce ul.products li.product[hidden] { display: none !important; }

/* Newly revealed cards fade up once, then the class is dropped. */
.woocommerce ul.products li.product.is-revealing {
  animation: asfc-shop-reveal var(--duration-base) var(--ease-standard) both;
}

@keyframes asfc-shop-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* "Show more" — rendered hidden, unhidden by assets/js/theme.js. An author
   display: value beats the user agent's [hidden] rule whatever its
   specificity, so the hidden state has to be restated here. */
.asfc-shop-more {
  display: flex;
  justify-content: center;
  margin: var(--space-10) 0 0;
}

.asfc-shop-more[hidden] { display: none; }

/* Neutralise WooCommerce's float grid */
.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    box-shadow var(--duration-base) var(--ease-standard),
    transform  var(--duration-base) var(--ease-standard);
}

.woocommerce ul.products li.product:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.woocommerce ul.products li.product a img {
  display: block;
  width: 100%;
  height: auto;
  /* Square — product shots are 1536x1536 (Sep 2026). Must match the Customizer
     thumbnail crop (WooCommerce > Product Images > Thumbnail cropping = 1:1)
     or the file is cropped twice. */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 0;
  background: var(--neutral-100);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--text-heading);
  padding: var(--space-4) var(--space-4) 0;
  margin: 0;
}

.woocommerce ul.products li.product .price {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-default);
  padding: var(--space-2) var(--space-4) 0;
  /* The button below uses `margin-top: auto` to bottom-align across a row.
     On a card whose content already fills the height that auto collapses to
     zero and the price ends up touching the button — so set the gap here. */
  margin: 0 0 var(--space-4);
}

.woocommerce ul.products li.product .price del { color: var(--text-subtle); font-weight: var(--font-weight-regular); }
.woocommerce ul.products li.product .price ins { text-decoration: none; }

/* Push the button to the bottom so cards in a row align */
.woocommerce ul.products li.product .button {
  margin: auto var(--space-4) var(--space-4);
}

/* Sale flash */
.woocommerce span.onsale {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-raised);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--gold-light);
  color: #0a0a0a;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  min-height: 0;
  min-width: 0;
  line-height: 1.4;
}

.woocommerce ul.products li.product { position: relative; }

/* ── 3. Buttons — inherit .asfc-btn ───────────────────────────────────── */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 20px;
  border: var(--border-width-thick) solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-inverse);
  color: var(--brand-white);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background   var(--duration-fast) var(--ease-standard),
    color        var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    transform    var(--duration-fast) var(--ease-standard);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
  background: var(--brand-black);
  color: var(--brand-white);
}

.woocommerce .button:active { transform: translateY(1px); }

.woocommerce .button:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
}

.woocommerce .button.disabled,
.woocommerce .button:disabled,
.woocommerce .button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* The primary conversion buttons carry the gold accent */
.woocommerce .single_add_to_cart_button,
.woocommerce .checkout-button,
.woocommerce #place_order {
  background: var(--gold-light);
  color: #0a0a0a;
  font-size: var(--font-size-base);
  padding: 15px 28px;
}

.woocommerce .single_add_to_cart_button:hover,
.woocommerce .checkout-button:hover,
.woocommerce #place_order:hover {
  background: var(--brand-gold);
  color: #0a0a0a;
}

/* Secondary actions (update cart, apply coupon) */
.woocommerce .cart .actions .button[name="update_cart"],
.woocommerce .coupon .button {
  background: transparent;
  color: var(--text-default);
  border-color: var(--surface-inverse);
}

.woocommerce .cart .actions .button[name="update_cart"]:hover,
.woocommerce .coupon .button:hover {
  background: var(--surface-inverse);
  color: var(--brand-white);
}

/* WooCommerce ships Update basket disabled until a quantity actually changes.
 * The generic 0.45 opacity made an outline button almost vanish, so it read as
 * a rendering fault rather than as "nothing to save yet". Stated properly
 * instead: full opacity, muted text, light border. Disabled controls are exempt
 * from the WCAG contrast minimum, but --text-muted clears it anyway at 7:1. */
.woocommerce .cart .actions .button[name="update_cart"]:disabled,
.woocommerce .cart .actions .button[name="update_cart"][disabled],
.woocommerce .cart .actions .button[name="update_cart"].disabled {
  opacity: 1;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-default);
}

/* "View cart" link that appears after an ajax add */
.woocommerce a.added_to_cart {
  display: inline-block;
  font-size: var(--font-size-sm);
  color: var(--link-on-light);
  text-decoration: underline;
  margin: 0 var(--space-4) var(--space-4);
}

/* ── 4. Single product ────────────────────────────────────────────────── */

.woocommerce div.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 900px) {
  .woocommerce div.product {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-12);
    align-items: start;
  }
  .woocommerce div.product .woocommerce-product-gallery { grid-column: 1; }
  .woocommerce div.product .summary { grid-column: 2; margin: 0; }
  .woocommerce div.product .woocommerce-tabs,
  .woocommerce div.product .related,
  .woocommerce div.product .upsells { grid-column: 1 / -1; }
}

.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product .summary {
  width: auto !important;
  float: none !important;
  margin: 0;
}

.woocommerce div.product .product_title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-display);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  color: var(--text-heading);
  margin: 0 0 var(--space-3);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  font-family: var(--font-body);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  color: var(--text-default);
  margin: 0 0 var(--space-6);
}

.woocommerce div.product .woocommerce-product-details__short-description {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-default);
  margin-bottom: var(--space-6);
}

.woocommerce div.product .woocommerce-product-gallery__image img {
  border-radius: var(--radius-md);
  background: var(--neutral-100);
}

.woocommerce div.product .flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0;
  list-style: none;
}

.woocommerce div.product .flex-control-thumbs li { width: auto; float: none; margin: 0; }
.woocommerce div.product .flex-control-thumbs img {
  border-radius: var(--radius-sm);
  opacity: 0.7;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.woocommerce div.product .flex-control-thumbs img:hover,
.woocommerce div.product .flex-control-thumbs img.flex-active { opacity: 1; }

/* Stock / meta */
.woocommerce div.product .stock {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--success);
}
.woocommerce div.product .stock.out-of-stock { color: var(--error); }

.woocommerce div.product .product_meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  border-top: var(--border-width) solid var(--border-default);
  padding-top: var(--space-4);
  margin-top: var(--space-6);
}

/* ── 5. Variations (size / fit) ───────────────────────────────────────── */

.woocommerce div.product form.cart .variations {
  width: 100%;
  border: 0;
  margin: 0 0 var(--space-6);
}

.woocommerce div.product form.cart .variations tr { display: block; margin-bottom: var(--space-5); }
.woocommerce div.product form.cart .variations td { display: block; padding: 0; border: 0; }

.woocommerce div.product form.cart .variations label {
  display: block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  margin: 0 0 var(--space-2);
}

.woocommerce div.product form.cart .variations select {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-default);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 38px 11px 13px;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5852' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.woocommerce div.product form.cart .variations select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.woocommerce div.product .woocommerce-variation-price { margin-bottom: var(--space-4); }

.woocommerce a.reset_variations {
  display: inline-block;
  font-size: var(--font-size-sm);
  color: var(--link-on-light);
  text-decoration: underline;
  margin-top: var(--space-2);
}

/* ── 6. Personalisation fields (product add-ons) ──────────────────────── */
/*
 * The club sells personalised kit: a NAME and NUMBER captured against each
 * individual item. Whichever add-ons plugin is chosen, wrap its output in
 * `.asfc-personalisation` (see inc/woocommerce.php) so it reads as a distinct,
 * deliberate step rather than a stray pair of inputs.
 */

.asfc-personalisation {
  background: var(--surface-tint);
  border: var(--border-width) solid var(--gold-tint-400);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: 0 0 var(--space-6);
}

/* Title row: label on the left, the single flat fee badge on the right. The
   charge is per item, not per field, so it belongs here rather than on each
   input's label. */
.asfc-personalisation__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-kicker);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  margin: 0 0 var(--space-4);
}

.asfc-personalisation__note {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: var(--space-3) 0 0;
}

/* Generic mapping for add-on field markup */
.asfc-personalisation label,
.woocommerce .wc-pao-addon-name {
  display: block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  margin: 0 0 var(--space-2);
}

.asfc-personalisation input[type="text"],
.asfc-personalisation input[type="number"],
.asfc-personalisation select,
.asfc-personalisation textarea {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-default);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow   var(--duration-fast) var(--ease-standard);
}

.asfc-personalisation input:focus,
.asfc-personalisation select:focus,
.asfc-personalisation textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

/* Shirt name and squad number are ALWAYS separate fields — never one combined
   input. A shirt printed "HORNER 9" because someone typed the number into the
   name box is a garment the club has already paid the supplier for. */
.asfc-personalisation__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 560px) {
  /* name gets the room, number stays narrow — its own width signals "2 digits" */
  .asfc-personalisation__grid:has(.asfc-personalisation__field + .asfc-personalisation__field) {
    grid-template-columns: 1fr 96px;
  }
}

.asfc-personalisation__field { display: flex; flex-direction: column; }

.asfc-personalisation__field label {
  display: block;
}

/* The +£5.00 badge — one per panel, not one per field, since the charge is
   flat: a name, a number, or both costs the same. */
.asfc-personalisation__fee {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #0a0a0a;
  background: var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
}

/* Number field: centred, tabular, reads as a squad number */
.asfc-personalisation input#asfc_pers_number {
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* Name field: uppercase as typed, because that is how it gets printed */
.asfc-personalisation input#asfc_pers_name {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Character counter / validation hint.
 *
 * --text-muted, NOT --text-subtle: subtle (#807b72) on this panel's cream
 * (#fcf9f2) measures 4.00:1, under the 4.5:1 WCAG AA needs for text this size.
 * Muted (#5c5852) is 6.72:1. The over-limit red is 5.20:1 and passes as is. */
.asfc-personalisation__count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.asfc-personalisation__count--over { color: var(--error); }

/* Placeholders were browser-default here, which varies by engine and lands
   near or below the AA line. Stated explicitly instead: --text-muted is 7.06:1
   on the white input. opacity:1 because Firefox dims placeholders by default. */
.asfc-personalisation input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Running total — the price the shopper is about to commit to, so it carries
   more weight than the helper text around it. */
.asfc-personalisation__total {
  font-family: var(--font-heading);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  margin: var(--space-4) 0 0;
}

/* Collapsed while empty, but NOT display:none — that would drop the live
   region out of the accessibility tree and the announcement with it. */
.asfc-personalisation__total:empty { margin: 0; }

/* ── 7. Quantity control ──────────────────────────────────────────────── */

.woocommerce .quantity .qty {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-default);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 8px;
  width: 80px;
  text-align: center;
}

.woocommerce .quantity .qty:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
  margin: 0;
}

.woocommerce div.product form.cart .variations,
.woocommerce div.product form.cart .asfc-personalisation,
.woocommerce div.product form.cart .woocommerce-variation { width: 100%; }

/*
 * Quantity and Add to basket sit on one row.
 *
 * On a VARIABLE product WooCommerce wraps them in
 * `.woocommerce-variation-add-to-cart`, a plain block element — so the flex
 * rules on form.cart never reached them and they stacked with no gap. Lay out
 * that wrapper too, and the simple-product form directly.
 */
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart,
.woocommerce div.product form.cart.cart:not(.variations_form) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

/* Belt and braces: if the button ever wraps below the quantity on a narrow
   screen, the flex gap still separates them. */
.woocommerce div.product form.cart .quantity { margin: 0; }

/* ── 7b. Product tabs ─────────────────────────────────────────────────── */
/*
 * WooCommerce ships the tab strip as a bulleted <ul> with rounded "folder"
 * tabs, borders and pseudo-element corners — none of which survive having its
 * stylesheet removed, so it was rendering as a bare bullet list. Rebuilt here
 * as a flat underlined tab row in the ASFC system.
 *
 * The Additional Information tab is removed in inc/woocommerce.php (it only
 * repeated the Size attribute already shown in the variation dropdown), so in
 * practice this is usually a single Description tab. The strip is styled to
 * cope with one tab or several.
 */

.woocommerce div.product .woocommerce-tabs {
  margin-top: var(--space-12);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0 0 var(--space-3);
  border-bottom: var(--border-width) solid var(--border-default);
}

/* Kill WooCommerce's folder-tab pseudo elements. */
.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
  display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 0 var(--space-3);
  margin-bottom: calc(-1 * var(--space-3) - var(--border-width));
  border-bottom: var(--border-rule-accent) solid transparent;
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--text-default);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--text-default);
  border-bottom-color: var(--gold-light);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Panel */
.woocommerce div.product .woocommerce-Tabs-panel {
  max-width: var(--container-narrow);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-default);
}

/* WooCommerce prints an h2 ("Description") inside the panel that duplicates the
   tab label. Hide it visually but leave it for assistive tech. */
.woocommerce div.product .woocommerce-Tabs-panel > h2:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.woocommerce div.product .woocommerce-Tabs-panel p { margin: 0 0 var(--space-4); }
.woocommerce div.product .woocommerce-Tabs-panel p:last-child { margin-bottom: 0; }

.woocommerce div.product .woocommerce-Tabs-panel ul,
.woocommerce div.product .woocommerce-Tabs-panel ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

.woocommerce div.product .woocommerce-Tabs-panel li { margin: 0 0 var(--space-2); }

.woocommerce div.product .woocommerce-Tabs-panel strong {
  font-weight: var(--font-weight-semibold);
}

/* Attribute table, if the Additional Information tab is ever re-enabled. */
.woocommerce div.product .woocommerce-product-attributes {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.woocommerce div.product .woocommerce-product-attributes th,
.woocommerce div.product .woocommerce-product-attributes td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--border-default);
  background: transparent;
}

.woocommerce div.product .woocommerce-product-attributes th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  width: 30%;
}

.woocommerce div.product .woocommerce-product-attributes td p { margin: 0; }

/* ── 8. Cart ──────────────────────────────────────────────────────────── */

.woocommerce table.shop_table {
  width: 100%;
  border-collapse: collapse;
  border: 0;
  border-radius: 0;
  background: var(--surface-raised);
  margin: 0 0 var(--space-8);
}

.woocommerce table.shop_table th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  text-align: left;
  background: var(--surface-inverse);
  color: var(--brand-white);
  padding: var(--space-3) var(--space-4);
  border: 0;
}

.woocommerce table.shop_table td {
  font-size: var(--font-size-sm);
  color: var(--text-default);
  padding: var(--space-4);
  border-top: var(--border-width) solid var(--border-default);
  vertical-align: middle;
}

/* Striping is for line items only. The actions row is a row like any other as
   far as :nth-child is concerned, so with a single item in the basket it came
   out second and got tinted — which read as a stray beige box round the Update
   basket button rather than as striping. */
.woocommerce table.shop_table tbody tr:nth-child(even) td:not(.actions) { background: var(--surface-tint); }

.woocommerce table.cart img {
  display: block;
  width: 64px;
  /* Belt-and-braces against the global img { max-width: 100% }: if a plugin
     ever wraps the image in another sizeless element, the width still holds. */
  max-width: none;
  height: auto;
  border-radius: var(--radius-sm);
}

/* Column widths.
 *
 * width: 1% with nowrap is the old table trick for "shrink to content": the
 * browser honours the nowrap over the 1%, so those columns take exactly the
 * room they need and every remaining pixel falls to the product name — which
 * is the only cell with anything to wrap. Left alone, the browser shared the
 * width out evenly and stranded the thumbnail in the middle of a column twice
 * the size of the image. */
.woocommerce table.cart th.product-remove,
.woocommerce table.cart td.product-remove {
  width: 1%;
  padding-right: 0;
}

/* The thumbnail column gets a REAL width, not the 1% the others use.
 *
 * Imagify wraps the image in a <picture>, and a <picture> is a non-replaced
 * inline element with no intrinsic size of its own — so the table's min-content
 * calculation for this cell came out at roughly zero, the 1% was granted, and
 * the global img { max-width: 100% } in tokens/base.css then resolved the
 * image's 64px against a zero-width parent. Result: a 0x0 picture and an
 * invisible thumbnail. The image's own width: 64px cannot save it, because
 * max-width always wins over width.
 *
 * Both fixes below are needed: the explicit column width, and giving the
 * wrappers a width so the intrinsic size propagates back up to the table. */
.woocommerce table.cart th.product-thumbnail,
.woocommerce table.cart td.product-thumbnail {
  width: 64px;
  text-align: left;
  padding-right: var(--space-3);
}

.woocommerce table.cart td.product-thumbnail a,
.woocommerce table.cart td.product-thumbnail picture {
  display: block;
  width: 64px;
}

.woocommerce table.cart th.product-name,
.woocommerce table.cart td.product-name { width: auto; }

.woocommerce table.cart th.product-price,
.woocommerce table.cart td.product-price,
.woocommerce table.cart th.product-quantity,
.woocommerce table.cart td.product-quantity,
.woocommerce table.cart th.product-subtotal,
.woocommerce table.cart td.product-subtotal {
  width: 1%;
  white-space: nowrap;
}

.woocommerce table.cart .product-name a {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  text-decoration: none;
}
.woocommerce table.cart .product-name a:hover { text-decoration: underline; }

/* Personalisation shown against each line item.
 *
 * WooCommerce renders it as a <dl>, and a bare dl stacks the label above the
 * value — "Shirt name:" on one line, JAY indented on the next, for every field.
 * Two columns puts each label beside its value, which is both shorter and
 * easier to scan against the shirt it describes. */
.woocommerce table.shop_table .variation,
.woocommerce .wc-item-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.woocommerce table.shop_table .variation {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px var(--space-2);
}

.woocommerce table.shop_table .variation dt {
  font-weight: var(--font-weight-regular);
  margin: 0;
}

.woocommerce table.shop_table .variation dd { margin: 0; }
.woocommerce table.shop_table .variation dd p { margin: 0; }

/* Order-received / account / emails print the same data as a <ul> of
   <strong>label</strong> <p>value</p>. Same two columns, so it reads
   identically on every page the order appears. */
.woocommerce .wc-item-meta li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px var(--space-2);
  margin: 0;
}
.woocommerce .wc-item-meta li p { margin: 0; }
.woocommerce .wc-item-meta strong { font-weight: var(--font-weight-regular); color: var(--text-muted); }

/* Line totals sit level with the product name, not floating at the vertical
   middle of a tall personalised row. */
.woocommerce table.shop_table td.product-name,
.woocommerce table.shop_table td.product-total,
.woocommerce table.shop_table td.product-subtotal,
.woocommerce table.shop_table td.product-price { vertical-align: top; }

.woocommerce a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted) !important;
  border-radius: var(--radius-pill);
  text-decoration: none;
}
.woocommerce a.remove:hover { background: var(--error-tint); color: var(--error) !important; }

/* The actions row.
 *
 * This cell is a <td colspan="6">. display: flex on it takes it out of table
 * layout and the colspan goes with it, so instead of spanning the table the
 * cell shrank to the width of its own contents — the narrow boxed button that
 * looked broken. It has to stay a table-cell; the float handles the one case
 * where there are two controls (coupon left, update right). */
.woocommerce .cart td.actions {
  display: table-cell;
  text-align: right;
  /* Matches the table, not the page: both resolve to white today, but this
     cell belongs to the table and should follow it if that ever changes. */
  background: var(--surface-raised);
}

.woocommerce .cart td.actions::after { content: ""; display: table; clear: both; }

.woocommerce .cart .coupon {
  float: left;
  display: flex;
  gap: var(--space-2);
}

.woocommerce .cart .coupon .input-text {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  min-width: 180px;
}

/* Cart totals */
.woocommerce .cart_totals {
  background: var(--surface-tint);
  border: var(--border-width) solid var(--gold-tint-400);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.woocommerce .cart_totals h2,
.woocommerce-checkout #order_review_heading,
.woocommerce .checkout h3 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-heading);
  margin: 0 0 var(--space-4);
}

.woocommerce .cart_totals table.shop_table { background: transparent; margin: 0 0 var(--space-4); }
.woocommerce .cart_totals table.shop_table th { background: transparent; color: var(--text-default); padding-left: 0; }
.woocommerce .cart_totals table.shop_table td { background: transparent !important; text-align: right; padding-right: 0; }
/* Rules span the full panel.
 *
 * The generic .shop_table rule puts border-top on td only. In the line-item
 * table that is fine — every column is a td, so the rule runs the full width.
 * Here each row is <th>Subtotal</th><td>£35.00</td>, so the border started at
 * the value column and stopped: the line that only reached halfway. The th
 * needs it too, and border-collapse merges the pair into one continuous rule. */
.woocommerce .cart_totals table.shop_table th,
.woocommerce .cart_totals table.shop_table td {
  border-top: var(--border-width) solid var(--border-default);
}

.woocommerce .cart_totals .order-total .amount { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }

/* Basket on phones.
 *
 * The theme switches off WooCommerce's own stylesheets (inc/woocommerce.php),
 * including woocommerce-smallscreen.css — the file that normally turns the
 * basket table into stacked rows below 768px. Without a replacement the
 * six-column table simply ran off the right edge of the screen: Quantity,
 * Subtotal and Update basket were unreachable without sideways scrolling.
 *
 * Below 768px each line item becomes a small card:
 *
 *   [img]  PRODUCT NAME                 ×
 *          Shirt name: BOND
 *          Price ................. £40.00
 *          Quantity .............. [ 1 ]
 *          Subtotal .............. £40.00
 *
 * The row labels come from WooCommerce's own data-title attributes, so they
 * stay translated. Scoped to the basket table only — the Basket totals table
 * already reads fine stacked. */
@media (max-width: 767px) {
  .woocommerce table.cart.shop_table_responsive thead { display: none; }

  .woocommerce table.cart.shop_table_responsive,
  .woocommerce table.cart.shop_table_responsive tbody { display: block; width: 100%; }

  /* tr.cart_item:nth-child(n) / td selectors below are deliberately heavy: they
     must beat the desktop striping and column-width rules in §8. */
  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    align-items: start;
    padding: var(--space-5) 0;
    border-top: var(--border-width) solid var(--border-default);
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    white-space: normal;
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-thumbnail {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-name {
    grid-column: 2;
    grid-row: 1;
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-remove {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-price,
  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-quantity,
  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-subtotal {
    grid-column: 2 / span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-price::before,
  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-quantity::before,
  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-subtotal::before {
    content: attr(data-title);
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--tracking-caps-sm);
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .woocommerce table.cart.shop_table_responsive tbody tr.cart_item:nth-child(n) td.product-subtotal {
    font-weight: var(--font-weight-semibold);
  }

  /* Update basket: full-width row of its own under the items. */
  .woocommerce table.cart.shop_table_responsive tr:not(.cart_item) { display: block; }

  .woocommerce table.cart.shop_table_responsive td.actions {
    display: block;
    padding: var(--space-4) 0 0;
    border-top: var(--border-width) solid var(--border-default);
  }

  .woocommerce table.cart.shop_table_responsive td.actions .coupon {
    float: none;
    margin-bottom: var(--space-3);
  }

  .woocommerce table.cart.shop_table_responsive td.actions .button[name="update_cart"] {
    width: 100%;
  }
}

/* ── 9. Checkout ──────────────────────────────────────────────────────── */

.woocommerce-checkout .woocommerce form.checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

@media (min-width: 900px) {
  .woocommerce-checkout .woocommerce form.checkout {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    /*
     * Row 1 is min-content so it sizes to the "Your order" heading alone.
     * Without this, the billing form spanning both rows has its height
     * distributed ACROSS those rows, inflating row 1 and pushing the order
     * summary ~300px down the page. Verified in a headless render.
     */
    grid-template-rows: min-content min-content min-content minmax(0, 1fr);
    column-gap: var(--space-12);
    row-gap: var(--space-4);
    align-items: start;
  }

  /*
   * ROWS MUST BE EXPLICIT.
   *
   * WooCommerce's markup order is: #customer_details, #order_review_heading,
   * #order_review. With only `grid-column: 2` set, auto-placement put the
   * heading in row 1 and the review box in row 2 — and row 1's height is the
   * entire billing form, so the order summary was pushed down to sit level
   * with the bottom of the form instead of beside its heading.
   *
   * Pinning the rows keeps the heading and the summary together at the top of
   * column two. Column one is: express pay (rows 1-2), "— OR —" (row 3),
   * billing form (row 4).
   */
  /*
   * Stripe's express-pay block (Apple Pay / Google Pay / Link) and its
   * "— OR —" separator are printed inside the form, before #customer_details.
   * Unplaced, auto-placement dropped them to the bottom of column one, leaving
   * "OR" dangling under the buttons with nothing after it. They belong at the
   * top: express buttons, OR, then the card route.
   *
   * The express block spans rows 1-2 so its height grows row 2, not row 1 —
   * row 1 stays the height of the "Your order" heading, and the summary still
   * starts directly beneath it. If Stripe shows no express buttons, the rows
   * collapse to nothing.
   */
  .woocommerce-checkout #wc-stripe-express-checkout-element {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .woocommerce-checkout #wc-stripe-express-checkout-button-separator {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
  }

  /* Zero-height custom element; pinned so it can't open an extra grid row. */
  .woocommerce-checkout #wc-stripe-express-checkout__order-attribution-inputs {
    grid-column: 1;
    grid-row: 3;
  }

  .woocommerce-checkout #customer_details {
    grid-column: 1;
    grid-row: 4;
  }

  .woocommerce-checkout #order_review_heading {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .woocommerce-checkout .woocommerce-checkout-review-order {
    grid-column: 2;
    grid-row: 2 / span 3;
  }
}

.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 { width: auto; float: none; }

.woocommerce form .form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: 0;
}

.woocommerce form .form-row label {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
}

.woocommerce form .form-row .required { color: var(--error); border: 0; text-decoration: none; }
.woocommerce form .form-row .optional { color: var(--text-subtle); font-weight: var(--font-weight-regular); }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-default);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  appearance: none;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    box-shadow   var(--duration-fast) var(--ease-standard);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select { border-color: var(--error); }
.woocommerce form .form-row.woocommerce-validated input.input-text { border-color: var(--success); }

.woocommerce form .form-row-first,
.woocommerce form .form-row-last { width: 100%; float: none; }

@media (min-width: 560px) {
  .woocommerce form #billing_first_name_field,
  .woocommerce form #billing_last_name_field { width: calc(50% - var(--space-2)); display: inline-flex; }
  .woocommerce form #billing_first_name_field { margin-right: var(--space-4); }
}

/* select2 (country / state) alignment */
.woocommerce .select2-container .select2-selection--single { display: flex; align-items: center; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered { padding: 0; color: var(--text-default); line-height: inherit; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; right: 8px; }

/* Order review */
.woocommerce-checkout .woocommerce-checkout-review-order {
  background: var(--surface-tint);
  border: var(--border-width) solid var(--gold-tint-400);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.woocommerce-checkout .woocommerce-checkout-review-order-table { background: transparent; margin-bottom: var(--space-5); }
.woocommerce-checkout .woocommerce-checkout-review-order-table th { background: transparent; color: var(--text-default); border-bottom: var(--border-width-thick) solid var(--surface-inverse); padding-left: 0; padding-right: 0; }
.woocommerce-checkout .woocommerce-checkout-review-order-table td { background: transparent !important; padding-left: 0; padding-right: 0; }
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total td { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }

/* Payment box */
.woocommerce-checkout #payment {
  background: transparent;
  border-radius: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
  border-bottom: var(--border-width) solid var(--border-default);
  padding: 0 0 var(--space-4);
  margin: 0 0 var(--space-4);
  list-style: none;
}

/* The donation question brings its own gold rule, so the grey one above it
   would double up. Dropped only when the donation block is present. */
.woocommerce-checkout #payment:has(.asfc-donation) ul.payment_methods { border-bottom: 0; }

.woocommerce-checkout #payment ul.payment_methods li { margin-bottom: var(--space-3); }

.woocommerce-checkout #payment ul.payment_methods label {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-default);
}

.woocommerce-checkout #payment div.payment_box {
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  padding: var(--space-4);
  margin: var(--space-3) 0 0;
}

.woocommerce-checkout #payment div.payment_box::before { display: none; }

.woocommerce-checkout #payment .place-order { padding: 0; margin-top: var(--space-5); }
.woocommerce-checkout #payment #place_order { width: 100%; }

/* Terms checkbox */
.woocommerce form.checkout .woocommerce-terms-and-conditions-wrapper { margin-bottom: var(--space-4); }
.woocommerce form .form-row.validate-required label.checkbox,
.woocommerce-checkout .woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--text-default);
}

/* ── 10. Notices ──────────────────────────────────────────────────────── */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  border: var(--border-width) solid transparent;
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: 0 0 var(--space-6);
  list-style: none;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before { display: none; }

.woocommerce-message { background: var(--success-tint); border-color: var(--success); color: var(--text-default); }
.woocommerce-info    { background: var(--info-tint);    border-color: var(--info);    color: var(--text-default); }
.woocommerce-error   { background: var(--error-tint);   border-color: var(--error);   color: var(--text-default); }
.woocommerce-error li { margin: 0; }

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

/* WooCommerce gives each notice tabindex="-1" and focuses it so screen readers
   announce it. That lands a browser focus ring round the whole panel — the blue
   halo.

   Guarding this with :not(:focus-visible) does NOT work: Chrome treats a
   programmatic focus with no preceding interaction in the document (which is
   exactly this case, since the focus happens on load) as focus-visible, so the
   ring stayed. Removed unconditionally instead.

   Safe to remove here in a way it would not be on a control: the panel is
   tabindex="-1", so it is never in the tab order and a keyboard user cannot
   land on it. The one actionable thing inside it, the Continue shopping button,
   keeps its own focus ring.

   The ring itself is a box-shadow, not an outline: base.css draws focus with
   `:focus-visible { box-shadow: var(--focus-ring) }`, so `outline: none` alone
   left the halo in place. Both are cleared here. */
.woocommerce-message:focus,
.woocommerce-info:focus,
.woocommerce-error:focus {
  outline: none;
  box-shadow: none;
}

/* ── 11. Collection only — suppress shipping UI ───────────────────────── */
/*
 * Shipping is disabled in WooCommerce settings (see WOOCOMMERCE-SETUP.md).
 * These rules are belt-and-braces: if a plugin or a Woo update reintroduces a
 * shipping row, the customer must never be offered delivery the club cannot
 * honour. Remove this block only if the club starts shipping orders.
 */

.woocommerce .shipping,
.woocommerce tr.shipping,
.woocommerce .woocommerce-shipping-fields,
.woocommerce .woocommerce-shipping-totals,
.woocommerce .shipping-calculator-button,
.woocommerce .shipping_calculator,
.woocommerce #ship-to-different-address { display: none !important; }

/* The collection notice that replaces it (output in inc/woocommerce.php) */
.asfc-collection-notice {
  display: flex;
  gap: var(--space-3);
  background: var(--surface-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: 0 0 var(--space-6);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.asfc-collection-notice strong {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  color: var(--text-accent);
  font-weight: var(--font-weight-semibold);
}

.asfc-collection-notice a { color: var(--link-on-dark); text-decoration: underline; }

/* ── 12. Order received / account ─────────────────────────────────────── */

.woocommerce .woocommerce-order {
  max-width: var(--container-max);
}

.woocommerce ul.order_details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  background: var(--surface-tint);
  border: var(--border-width) solid var(--gold-tint-400);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: 0 0 var(--space-8);
  list-style: none;
}

.woocommerce ul.order_details li {
  float: none;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.woocommerce ul.order_details li strong {
  display: block;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  margin-top: var(--space-1);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  background: var(--surface-inverse);
  border-color: var(--surface-inverse);
  color: var(--brand-white);
}

/* ── 12b. Shop donation (inc/woocommerce-donation.php) ────────────────── */

/* Checkout: the donation question, above the terms checkbox. A native radio
   group; the pills are the labels, so it stays keyboard- and screen-reader-
   friendly. Selected = dark fill + tick, never colour alone. */
.asfc-donation {
  container-type: inline-size;
  min-width: 0;
  margin: 0 0 var(--space-6);
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: var(--border-width) solid var(--gold-tint-400);
}

.asfc-donation__legend {
  float: left; /* lets the legend sit in the flow like a heading */
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: 0;
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl); /* 24px, up from 18 */
  font-weight: var(--font-weight-regular); /* regular, so the bold cause name stands out */
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-heading);
  text-transform: uppercase;
  color: var(--text-heading);
}

.asfc-donation__legend strong { font-weight: var(--font-weight-bold); white-space: nowrap; /* keep the bold phrase on one line */ }

.asfc-donation__legend + * { clear: both; }

.asfc-donation__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

@container (min-width: 26rem) {
  .asfc-donation__options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.asfc-donation__option { position: relative; }

.asfc-donation__radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.asfc-donation__pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-default);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-default);
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-heading);
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}

.asfc-donation__pill [data-lucide],
.asfc-donation__pill svg {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.asfc-donation__radio:hover + .asfc-donation__pill { border-color: var(--surface-inverse); }

.asfc-donation__radio:checked + .asfc-donation__pill {
  background: var(--surface-inverse);
  border-color: var(--surface-inverse);
  color: var(--text-inverse);
}

.asfc-donation__radio:checked + .asfc-donation__pill [data-lucide],
.asfc-donation__radio:checked + .asfc-donation__pill svg { display: block; }

.asfc-donation__radio:focus-visible + .asfc-donation__pill {
  box-shadow: var(--focus-ring);
  outline: 2px solid transparent; /* Windows high contrast */
}

/* Other amount — always shown without JS; donation.js hides it until chosen. */
.asfc-donation__other { margin-top: var(--space-4); }

.asfc-donation-js .asfc-donation:not(.is-other) .asfc-donation__other { display: none; }

.asfc-donation__other-label {
  display: block;
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-default);
}

.asfc-donation__other-field {
  display: flex;
  align-items: stretch;
  max-width: 12rem;
}

.asfc-donation__currency {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  background: var(--surface-subtle);
  border: var(--border-width) solid var(--border-strong);
  border-right: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-weight: var(--font-weight-semibold);
  color: var(--text-default);
}

.woocommerce .asfc-donation__other-field input.asfc-donation__other-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Inline error — shown by donation.js when the server rejects the amount.
   Red border + icon + text, so the state never relies on colour alone. */
.asfc-donation__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  color: var(--error);
}

.asfc-donation__error[hidden] { display: none; }

.asfc-donation__error [data-lucide],
.asfc-donation__error svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.asfc-donation.is-invalid .asfc-donation__currency,
.woocommerce .asfc-donation.is-invalid .asfc-donation__other-field input.asfc-donation__other-input {
  border-color: var(--error);
}

.asfc-donation.is-invalid .asfc-donation__currency {
  background: var(--error-tint);
  color: var(--error);
}

.asfc-donation__hint,
.asfc-donation__helper {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  color: var(--text-muted);
}

.asfc-donation__helper { margin-top: var(--space-3); }

/* Order received: the JustGiving ask. Same dark band language as the Phase 1
   donate-panel, reusing its .asfc-thermo-card and the highlight button. */
.asfc-order-donation {
  display: grid;
  gap: var(--space-6);
  margin: 0 0 var(--space-8);
  padding: var(--space-8) var(--space-6);
  background: var(--surface-inverse);
  border-radius: var(--radius-lg);
  color: var(--text-inverse);
}

.asfc-order-donation--soft { margin-top: var(--space-8); }

.asfc-order-donation__title {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  color: var(--text-heading-inverse);
}

/* When the heading carries a bold cause name, the rest drops to regular so the
   emphasis reads (Oswald 600 against 700 is barely visible). */
.asfc-order-donation__title--emph { font-weight: var(--font-weight-regular); }
.asfc-order-donation__title strong { font-weight: var(--font-weight-bold); white-space: nowrap; }

.asfc-order-donation__body {
  margin: 0;
  max-width: 46ch;
  line-height: var(--line-height-normal);
  color: var(--text-inverse-muted);
}

.asfc-order-donation .asfc-thermo-card { margin-bottom: var(--space-5); }

.asfc-order-donation__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.asfc-order-donation__actions .asfc-btn { display: inline-flex; }

.asfc-order-donation__secondary {
  color: var(--link-on-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.asfc-order-donation__secondary:focus-visible {
  box-shadow: var(--focus-ring);
  outline: 2px solid transparent;
}

@media (min-width: 900px) {
  .asfc-order-donation {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-10);
    padding: var(--space-10);
  }

  .asfc-order-donation__title { font-size: var(--font-size-4xl); }
}

/* ── 13. Pagination ───────────────────────────────────────────────────── */

.woocommerce nav.woocommerce-pagination ul {
  display: flex;
  gap: var(--space-2);
  border: 0;
  margin: var(--space-10) 0 0;
  padding: 0;
  justify-content: center;
  /* WooCommerce's own stylesheet is suppressed, so nothing was removing the
     list bullets — they were rendering as ::marker between the page numbers. */
  list-style: none;
}

.woocommerce nav.woocommerce-pagination ul li {
  border: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  list-style: none;
}

/* Flex items still paint a ::marker in Firefox unless it is emptied. */
.woocommerce nav.woocommerce-pagination ul li::marker { content: ""; }

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  min-width: 40px;
  padding: 9px 12px;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-default);
  background: var(--surface-default);
  text-decoration: none;
}

.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
  background: var(--surface-inverse);
  border-color: var(--surface-inverse);
  color: var(--brand-white);
}

/* ── 14. Reduced motion ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .woocommerce ul.products li.product,
  .woocommerce .button,
  .woocommerce input,
  .woocommerce select {
    transition: none !important;
  }
  .woocommerce ul.products li.product:hover { transform: none; }
  /* Revealed cards simply appear. */
  .woocommerce ul.products li.product.is-revealing { animation: none; }
  .asfc-donation__pill { transition: none; }
}
