/*
Theme Name: Triple A Shop
Theme URI: https://tripleacollectibles.co.uk
Author: Digiwings
Description: Minimal WooCommerce theme for shop.tripleacollectibles.co.uk. Only ever renders cart, checkout and my-account; inc/front-gate.php redirects everything else to the static storefront. Styled from the same tokens as the storefront so checkout doesn't feel like a different company.
Version: 0.3.0
License: Proprietary
Text Domain: tcg-shop
*/

/* --- Tokens: kept in step with src/styles/tokens.css on the storefront ----- */
:root {
  --ink: #17171a;
  --ink-2: #3c3c42;
  --muted: #5c5c66;
  --faint: #6e6e78;
  --line: #e9e6e0;
  --line-2: #dad6ce;
  --bg: #ffffff;
  --paper: #faf8f4;
  --paper-2: #f3f0ea;
  --accent: #c8392b;
  --accent-ink: #161616;
  --maxw: 1180px;
  --r: 14px;
  --t: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ok: #1a7d46;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0 0 0.5em;
}

a {
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 0;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
}

/* --- Header / footer ------------------------------------------------------ */
.shop-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.shop-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  gap: 20px;
}

.shop-header img {
  height: 48px;
  width: auto;
  display: block;
}

.back-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.shop-main {
  padding: 56px 0 90px;
  min-height: 60vh;
}

/* --- Footer, mirroring the storefront's ------------------------------------
   Same structure and the same tokens, because a checkout that footers
   differently from the shop reads as a different company. Values kept in step
   with src/styles/components.css. */
.shop-footer {
  background: var(--accent-ink);
  color: #b9b9c0;
  padding: 72px 0 32px;
  font-size: 0.95rem;
}

.shop-footer a {
  color: #b9b9c0;
  transition: color 0.25s;
}

.shop-footer a:hover {
  color: #fff;
}

.shop-footer .foot-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-footer .foot-brand img {
  height: 50px;
  width: auto;
  max-width: none;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: block;
}

.shop-footer .foot-brand p {
  max-width: 34ch;
  color: #9696a0;
  font-size: 0.95rem;
  margin: 0;
}

.shop-footer .foot-col h3 {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 18px;
}

.shop-footer .foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shop-footer .foot-col li {
  margin-bottom: 11px;
  font-size: 0.95rem;
}

.shop-footer .foot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.85rem;
  color: #73737d;
}

.shop-footer .dw {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 920px) {
  .shop-footer .foot-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .shop-footer {
    padding: 48px 0 28px;
  }
  .shop-footer .foot-top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 32px;
  }
}

/* Trust strip: checkout is where doubt costs money. */
.shop-trust {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 40px;
}

.shop-trust span::before {
  content: '✓';
  color: var(--ok);
  margin-right: 0.4em;
  font-weight: 700;
}

/* --- WooCommerce ---------------------------------------------------------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--accent);
  background: var(--paper);
  border-radius: 10px;
  list-style: none;
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--accent);
}

.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,
.woocommerce #place_order {
  background: var(--accent-ink);
  color: #fff;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 500;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  border: 1px solid var(--accent-ink);
  transition: 0.3s var(--t);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #place_order:hover {
  background: #000;
  color: #fff;
  transform: translateY(-2px);
}

/* --- Cart layout: table beside a sticky totals card on desktop ----------- */
.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 40px;
  align-items: start;
}

/* Place the children rather than letting them fall where they land.
   This grid was written for the two it has on a good day, the form and the
   totals. WooCommerce adds a notices wrapper and one <div> per notice as
   siblings, so the moment anything needs saying, "we have 1 in stock and you
   already have 1 in your basket", or the nudge about free delivery, the count
   goes to four and every cell shifts one place: a notice took the left column,
   the basket table was pushed into the right, and the totals dropped to the row
   below. The layout broke exactly when the customer needed to read it. */
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper,
.woocommerce-cart .woocommerce > .woocommerce-message,
.woocommerce-cart .woocommerce > .woocommerce-info,
.woocommerce-cart .woocommerce > .woocommerce-error {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.woocommerce-cart .woocommerce > .woocommerce-cart-form {
  grid-column: 1;
}

.woocommerce-cart .woocommerce > .cart-collaterals {
  grid-column: 2;
}

/* An empty notices wrapper still creates a grid row and a 40px gap. */
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper:empty {
  display: none;
}
/* Any notices (stock warnings, coupon results) span the full width above both. */
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper {
  grid-column: 1 / -1;
}
.woocommerce-cart .woocommerce form.woocommerce-cart-form {
  min-width: 0;
}
.woocommerce-cart .cart-collaterals {
  width: 100%;
  float: none;
}
.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100%;
  float: none;
  position: sticky;
  top: 20px;
}
/* WooCommerce puts cross-sells in the form column; hide on this lean build. */
.woocommerce-cart .cross-sells {
  display: none;
}

.woocommerce table.shop_table {
  border: 1px solid var(--line);
  border-radius: var(--r);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
}

.woocommerce table.shop_table th {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
}

.woocommerce table.shop_table td {
  padding: 18px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

/* Product thumbnail: hold the trading-card ratio, contain (never crop).
   The cell needs an explicit width too. Woo's table is table-layout:auto, so
   the other columns squeezed this one down and the global img{max-width:100%}
   shrank a 56px thumbnail to 35px. */
.woocommerce table.cart td.product-thumbnail,
.woocommerce table.cart th.product-thumbnail {
  width: 86px;
  padding-right: 0;
}
.woocommerce table.cart img,
.woocommerce table.shop_table_responsive img {
  width: 64px;
  min-width: 64px;
  max-width: none;
  height: auto;
  aspect-ratio: 63 / 88;
  object-fit: contain;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: block;
}

/* Woo appends an icon-font glyph to the shipping calculator toggle. The font is
   not always there and it renders as a tofu box next to "Change address". */
.woocommerce .shipping-calculator-button::after {
  display: none;
}
.woocommerce .woocommerce-shipping-destination {
  color: var(--muted);
  font-size: 0.9rem;
}
.woocommerce .shipping-calculator-button {
  font-size: 0.9rem;
}

.woocommerce table.cart td.product-name a {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.woocommerce table.cart td.product-name a:hover {
  color: var(--accent);
}

/* Remove-item X: a quiet circle, not a shouty red link. */
.woocommerce a.remove {
  color: var(--muted) !important;
  border: 1px solid var(--line-2);
  width: 22px;
  height: 22px;
  line-height: 20px;
  font-size: 15px;
}
.woocommerce a.remove:hover {
  background: var(--accent) !important;
  border-color: var(--accent);
  color: #fff !important;
}

/* --- Cart actions row ----------------------------------------------------
   WooCommerce floats .coupon left and drops "Update cart" beside it, and it
   never styles the coupon field, so it rendered at the browser default 29px
   next to a 49px button and a 41px one. All three now share a height and sit on
   one baseline. */
/* The row stays a real table cell. Giving the <td colspan="6"> display:flex
   takes it out of table layout, the colspan stops applying and the cell
   collapses from 692px to its own content width (250px), which dropped "Update
   cart" onto a second line. Floats keep the cell in flow. */
.woocommerce .cart .actions {
  padding: 20px 14px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.woocommerce .cart .actions .coupon {
  display: flex;
  align-items: center;
  gap: 10px;
  float: left;
  width: min(440px, 62%);
  padding: 0;
  margin: 0;
}
/* Woo prints a visually hidden label; keep it for screen readers only. */
.woocommerce .cart .actions .coupon label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Outspecifies WooCommerce's own, which is
   ".woocommerce-cart table.cart td.actions .coupon .input-text" at (0,5,2).
   The rule here read (0,5,0) and lost on the two element selectors, so the
   height and the font applied from elsewhere while the padding stayed at
   WooCommerce's 6px 6px 5px. On a 999px pill that put the placeholder hard
   against the curve, half a character from the border, beside two buttons
   padded 24px. Matching the height was never the problem; the text inside it
   was in a different place. */
body.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text {
  flex: 1 1 auto;
  min-width: 0;
  height: 49px;
  padding: 0 22px;
  margin: 0;
  font-family: inherit;
  /* Same as the buttons beside it. At 0.95rem against their 1rem the two read
     as different controls that happen to be the same height. */
  font-size: 1rem;
  line-height: 49px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color 0.25s var(--t);
}
.woocommerce .cart .actions .coupon .input-text:focus {
  outline: none;
  border-color: var(--ink);
}
.woocommerce .cart .actions .coupon .input-text::placeholder {
  color: var(--faint);
}
.woocommerce .cart .actions .coupon button {
  flex: 0 0 auto;
  height: 49px;
  padding: 0 24px;
  white-space: nowrap;
}
/* "Apply coupon" is secondary to "Proceed to checkout", so it is outlined
   rather than another black pill competing with the primary action. */
.woocommerce .cart .actions .coupon button.button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.woocommerce .cart .actions .coupon button.button:hover {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--ink);
  transform: none;
}
.woocommerce .cart .actions button[name='update_cart'] {
  float: right;
  height: 49px;
  padding: 0 24px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.woocommerce .cart .actions button[name='update_cart']:hover:not([disabled]) {
  background: var(--paper-2);
  border-color: var(--ink);
  color: var(--ink);
  transform: none;
}
/* Woo disables it until a quantity actually changes. Say so quietly instead of
   showing a dead grey slab. */
.woocommerce .cart .actions button[name='update_cart'][disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  color: var(--faint);
  border-color: var(--line);
}

/* Totals card */
.woocommerce .cart_totals {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 26px;
}
.woocommerce .cart_totals h2 {
  margin: 0 0 16px;
}
.woocommerce .cart_totals table.shop_table {
  border: 0;
  background: transparent;
}
.woocommerce .cart_totals table.shop_table th,
.woocommerce .cart_totals table.shop_table td {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}
.woocommerce .cart_totals .order-total .amount {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.woocommerce .cart_totals .wc-proceed-to-checkout {
  padding: 18px 0 0;
}
.woocommerce .cart_totals .checkout-button {
  display: block;
  width: 100%;
  text-align: center;
}

@media (max-width: 640px) {
  .woocommerce .cart .actions .coupon,
  .woocommerce .cart .actions button[name='update_cart'] {
    float: none;
    width: 100%;
  }
  .woocommerce .cart .actions button[name='update_cart'] {
    margin-top: 12px;
  }

  /* The coupon row was two controls side by side in 325px: the field got 139px
     and its own placeholder, "Coupon code", did not fit in it. Stacked, each
     gets the full width and a thumb-sized height. */
  body.woocommerce-cart .woocommerce table.cart td.actions .coupon {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  body.woocommerce-cart .woocommerce table.cart td.actions .coupon .input-text,
  body.woocommerce-cart .woocommerce table.cart td.actions .coupon button {
    width: 100%;
    min-height: 48px;
  }

  /* Delivery is a list of choices, not a figure.
     The totals table right-aligns its cells, which is right for a price and
     wrong for a radio button with a sentence beside it: "Collect from the shop
     (Shrewsbury)" came out right-aligned, ragged and wrapped across two lines
     in 155px. Label above, choices below, left aligned, full width. */
  .woocommerce-cart .cart_totals .woocommerce-shipping-totals th,
  .woocommerce-cart .cart_totals .woocommerce-shipping-totals td {
    display: block;
    width: 100%;
    text-align: left;
    padding-left: 0;
    padding-right: 0;
  }
  .woocommerce-cart .cart_totals .woocommerce-shipping-totals th {
    padding-bottom: 6px;
  }
  .woocommerce-cart .cart_totals #shipping_method li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* Woo's own rule leaves the row shrink-to-fit, so the label had 192px of a
       281px list to wrap inside for no reason. */
    width: 100%;
    /* A choice worth a thumb rather than a fingertip. */
    min-height: 44px;
    padding: 4px 0;
  }
  .woocommerce-cart .cart_totals #shipping_method li input {
    margin: 3px 0 0;
    flex: 0 0 auto;
  }
  .woocommerce-cart .cart_totals #shipping_method li label {
    flex: 1 1 auto;
    text-align: left;
    line-height: 1.45;
  }
  .woocommerce-cart .cart_totals .woocommerce-shipping-destination,
  .woocommerce-cart .cart_totals .shipping-calculator-button {
    text-align: left;
  }
}

@media (max-width: 860px) {
  .woocommerce-cart .woocommerce {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  /* The placements have to be undone with the columns.
     Dropping to one column while the totals still said `grid-column: 2` made
     the browser create an implicit second track, size it to the totals card,
     and hand the 1fr track what was left, which was nothing. The basket form
     rendered zero pixels wide with its contents spilling across the totals: the
     cart was unreadable on a phone and the layout looked like it had exploded. */
  .woocommerce-cart .woocommerce > .woocommerce-cart-form,
  .woocommerce-cart .woocommerce > .cart-collaterals {
    grid-column: 1 / -1;
  }

  .woocommerce-cart .cart-collaterals .cart_totals {
    position: static;
  }
}

.woocommerce .quantity input,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.select2-container .select2-selection--single {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  height: auto;
}

.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(--ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.woocommerce form .form-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.woocommerce-checkout #payment {
  background: var(--paper);
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.woocommerce-checkout #payment div.payment_box {
  background: var(--paper-2);
}

.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: var(--paper-2);
}

.woocommerce .cart-collaterals .cart_totals > h2,
.woocommerce-checkout h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.woocommerce .woocommerce-breadcrumb {
  display: none;
}

/* Singles are usually quantity 1 — an editable quantity box on a unique card
   invites an error the customer can't resolve. */
.woocommerce .quantity input.qty {
  max-width: 5em;
}

@media (max-width: 600px) {
  .wrap {
    padding: 0 20px;
  }
  .shop-main {
    padding: 36px 0 60px;
  }
}

/* --- Checkout layout ------------------------------------------------------
   Unstyled, Woo puts billing and shipping side by side and drops the order
   summary full width underneath, so the summary started 1362px down the page
   with an empty right column above it. Same shape as the cart instead: the form
   on the left, the summary sticky on the right. */
.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.95fr);
  grid-template-rows: auto 1fr;
  column-gap: 44px;
  align-items: start;
}

.woocommerce-checkout form.checkout > #customer_details {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.woocommerce-checkout form.checkout > #order_review_heading {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 16px;
}

.woocommerce-checkout form.checkout > #order_review {
  grid-column: 2;
  grid-row: 2;
  position: sticky;
  top: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 26px;
}

/* Billing and "ship to a different address" stack now that the form column is
   narrower; Woo floats them at 48% each, which is unreadable at this width. */
.woocommerce-checkout #customer_details .col2-set,
.woocommerce-checkout #customer_details .col-1,
.woocommerce-checkout #customer_details .col-2 {
  width: 100%;
  float: none;
  margin: 0;
}

.woocommerce-checkout #customer_details .col-2 {
  margin-top: 26px;
}

.woocommerce-checkout form.checkout h3 {
  margin: 0 0 18px;
}

/* Two name fields side by side; everything else full width.
   Selector deliberately outspecifies WooCommerce's own
   ".woocommerce form .form-row-first { width: 47% }". Matching its specificity
   would have left these rules dead and the 47% in charge. */
body.woocommerce-checkout form.checkout .form-row-first,
body.woocommerce-checkout form.checkout .form-row-last {
  width: calc(50% - 7px);
  float: none;
  display: inline-block;
  vertical-align: top;
}
body.woocommerce-checkout form.checkout .form-row-first {
  margin-right: 10px;
}

.woocommerce-checkout form .form-row {
  margin-bottom: 16px;
  padding: 0;
}

.woocommerce-checkout form .form-row input.input-text,
.woocommerce-checkout form .form-row textarea,
.woocommerce-checkout form .form-row select {
  width: 100%;
}

/* Order table inside the summary card. */
.woocommerce-checkout #order_review table.shop_table {
  border: 0;
  background: transparent;
  margin: 0;
}
.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}
.woocommerce-checkout #order_review table.shop_table thead th {
  border-top: 0;
  padding-top: 0;
}
.woocommerce-checkout #order_review .order-total .amount {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}
.woocommerce-checkout #order_review #payment {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 8px;
  padding-top: 8px;
}
.woocommerce-checkout #order_review #payment ul.payment_methods {
  padding: 0;
  border: 0;
}
.woocommerce-checkout #order_review .form-row.place-order {
  padding: 8px 0 0;
  margin: 0;
}
.woocommerce-checkout #place_order {
  width: 100%;
  height: 52px;
  padding: 0;
}

/* The login and coupon toggles are links dressed as .woocommerce-info. Styled
   like the real notices they read as errors sitting above an empty form. */
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info,
.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top-color: var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 14px 18px;
}

/* Woo's icon font is not reliably present here, so every ::before glyph renders
   as a tofu box. Drop them rather than ship a broken character. */
.woocommerce-info::before,
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce form.checkout_coupon + .woocommerce-info::before {
  content: none;
}
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
  padding-left: 18px;
}

@media (max-width: 900px) {
  .woocommerce-checkout form.checkout {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .woocommerce-checkout form.checkout > #customer_details {
    grid-column: 1;
    grid-row: 1;
  }
  .woocommerce-checkout form.checkout > #order_review_heading {
    grid-column: 1;
    grid-row: 2;
    margin-top: 30px;
  }
  .woocommerce-checkout form.checkout > #order_review {
    grid-column: 1;
    grid-row: 3;
    position: static;
  }
}

@media (max-width: 480px) {
  body.woocommerce-checkout form.checkout .form-row-first,
  body.woocommerce-checkout form.checkout .form-row-last {
    width: 100%;
    margin-right: 0;
  }
}

/* --- Cart on mobile -------------------------------------------------------
   Woo's responsive table turns every cell into a full-width row with a
   "Product:" / "Price:" / "Quantity:" label, and hides the thumbnail outright.
   One line item came to 361px tall with no picture of the card. Each item is a
   compact card instead, thumbnail included.

   Breakpoint matches Woo's own 768px so there is no width where its responsive
   rules are on and these are not. Selectors are deliberately long: Woo's rules
   live in a media block of the same specificity, and its stylesheet is
   enqueued before this one. */
@media screen and (max-width: 768px) {
  body.woocommerce-cart table.cart tbody tr.cart_item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      'thumb name  name'
      'thumb price price'
      'thumb qty   subtotal';
    column-gap: 14px;
    row-gap: 8px;
    align-items: center;
    padding: 18px 4px;
    border-top: 1px solid var(--line);
    position: relative;
  }

  /* Woo sets text-align:right !important on every responsive cell, so this has
     to shout back. Without it the card reads right-ragged. */
  body.woocommerce-cart table.cart tbody tr.cart_item td {
    display: block;
    text-align: left !important;
    padding: 0;
    border: 0;
    clear: none;
  }

  /* The label prefixes earn their space on a wide table, not on a card where
     the value is self-evident from position. */
  body.woocommerce-cart table.cart tbody tr.cart_item td::before {
    content: none;
  }

  body.woocommerce-cart table.cart tbody tr.cart_item td.product-thumbnail {
    display: block;
    grid-area: thumb;
    width: 64px;
  }
  body.woocommerce-cart table.cart tbody tr.cart_item td.product-thumbnail img {
    width: 64px;
    min-width: 64px;
  }

  body.woocommerce-cart table.cart tbody tr.cart_item td.product-name {
    grid-area: name;
    align-self: end;
    /* Clears the absolutely positioned remove button. */
    padding-right: 32px;
  }
  body.woocommerce-cart table.cart tbody tr.cart_item td.product-name a {
    font-size: 1rem;
    line-height: 1.3;
  }

  body.woocommerce-cart table.cart tbody tr.cart_item td.product-price {
    grid-area: price;
    align-self: start;
    color: var(--muted);
    font-size: 0.92rem;
  }

  body.woocommerce-cart table.cart tbody tr.cart_item td.product-quantity {
    grid-area: qty;
  }
  body.woocommerce-cart table.cart tbody tr.cart_item td.product-quantity .quantity input {
    width: 68px;
    text-align: center;
  }

  body.woocommerce-cart table.cart tbody tr.cart_item td.product-subtotal {
    grid-area: subtotal;
    text-align: right !important;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
  }

  /* Out of the grid entirely: as a third column it sized to the subtotal beside
     it and left the product name only 150px to wrap in. */
  body.woocommerce-cart table.cart tbody tr.cart_item td.product-remove {
    position: absolute;
    top: 16px;
    right: 2px;
    width: auto;
  }

  /* The actions row is its own grid child, not part of an item card. */
  body.woocommerce-cart table.cart tbody tr td.actions {
    display: block;
    padding: 18px 4px 4px;
  }
  body.woocommerce-cart table.cart tbody tr td.actions::before {
    content: none;
  }
}

/* Terms line above the pay button. Quiet, but present and readable. */
.woocommerce-checkout .tcg-terms-note {
  margin: 4px 0 14px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.woocommerce-checkout .tcg-terms-note a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Staff product preview ------------------------------------------------
   Mobile first, because it is looked at on a phone seconds after a card is
   listed, one-handed, at a counter. */

.tcg-preview {
  max-width: 560px;
  margin: 0 auto;
}

.tcg-preview__flag {
  background: var(--paper-2);
  border-left: 3px solid var(--line-2);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tcg-preview__shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.tcg-preview__shots figure {
  margin: 0;
  text-align: center;
}

.tcg-preview__shots img {
  width: 100%;
  height: auto;
  /* Trading cards are 63 x 88mm and the intake crop already produces that, so
     nothing here should letterbox or squash. */
  aspect-ratio: 63 / 88;
  object-fit: contain;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
}

.tcg-preview__shots figcaption {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.tcg-preview h1 {
  font-size: 1.5rem;
  margin: 0 0 10px;
}

.tcg-preview__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tcg-preview__price .amount,
.tcg-preview__price .woocommerce-Price-amount {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
}

.tcg-preview__stock {
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.tcg-preview__stock.is-in  { background: #e6f4ec; color: var(--ok); }
.tcg-preview__stock.is-out { background: #fcf0ef; color: var(--accent); }

.tcg-preview__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
}

.tcg-preview__facts dt,
.tcg-preview__facts dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.tcg-preview__facts dt {
  color: var(--muted);
  padding-right: 20px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: center;
}

.tcg-preview__facts dd { text-align: right; }
.tcg-preview__facts code { font-size: 0.88rem; }

.tcg-preview__desc {
  color: var(--ink-2);
  font-size: 0.94rem;
  margin: 0 0 20px;
}

.tcg-preview__warn {
  background: #fcf0ef;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 18px;
  font-size: 0.9rem;
}

.tcg-preview__actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.tcg-preview__actions .button {
  display: block;
  text-align: center;
  min-height: 50px;
  line-height: 48px;
  font-size: 0.98rem;
}

.tcg-preview__hint {
  font-size: 0.82rem;
  color: var(--muted);
}

@media (min-width: 620px) {
  .tcg-preview__actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Payment panel --------------------------------------------------------
   Woo ships the payment section as a bare <ul> of radios with a speech-bubble
   box hanging off each one. With a single gateway that is one hidden radio, one
   orphaned label and a bubble with no arrow to point at, which reads as an
   unfinished form at the exact moment a customer is deciding whether to trust
   the shop with a card number. Rebuilt as a panel.
   -------------------------------------------------------------------------- */

.woocommerce-checkout #order_review #payment {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 20px;
}

.woocommerce-checkout #order_review #payment ul.payment_methods {
  margin: 0;
  list-style: none;
}

.woocommerce-checkout #order_review #payment li.wc_payment_method {
  margin: 0;
  padding: 0;
}

/* One gateway means nothing to choose. The radio is already hidden by Woo; the
   label becomes the panel's heading rather than a stray form label. */
.woocommerce-checkout #order_review #payment label[for='payment_method_stripe'] {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
  margin: 0 0 12px;
  padding: 0;
  cursor: default;
}

/* Card marks, drawn rather than fetched: no external request, no broken image
   if a CDN blocks, and they tint with the palette. */
.woocommerce-checkout #order_review #payment label[for='payment_method_stripe']::after {
  content: '';
  flex: 1;
  height: 22px;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='22' viewBox='0 0 112 22'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Crect width='33' height='22' rx='3' fill='%23F4F1EC'/%3E%3Ctext x='16.5' y='15' font-family='Helvetica,Arial,sans-serif' font-size='9' font-weight='700' fill='%231A1F71' text-anchor='middle'%3EVISA%3C/text%3E%3Cg transform='translate(39)'%3E%3Crect width='33' height='22' rx='3' fill='%23F4F1EC'/%3E%3Ccircle cx='13' cy='11' r='6.5' fill='%23EB001B'/%3E%3Ccircle cx='20' cy='11' r='6.5' fill='%23F79E1B' fill-opacity='.85'/%3E%3C/g%3E%3Cg transform='translate(78)'%3E%3Crect width='34' height='22' rx='3' fill='%23F4F1EC'/%3E%3Ctext x='17' y='15' font-family='Helvetica,Arial,sans-serif' font-size='8' font-weight='700' fill='%233C3C42' text-anchor='middle'%3EAMEX%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Kill the speech bubble and give the card fields a real container. */
.woocommerce-checkout #order_review #payment div.payment_box {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 16px;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-2);
  width: auto;
}

.woocommerce-checkout #order_review #payment div.payment_box::before,
.woocommerce-checkout #order_review #payment div.payment_box::after {
  content: none;
  display: none;
}

.woocommerce-checkout #order_review #payment div.payment_box > p:first-child {
  margin-top: 0;
}

/* Stripe mounts an iframe that reports its own height. Give it room to breathe
   without boxing it twice: the panel above is already the frame. */
.woocommerce-checkout #order_review .wc-stripe-upe-element,
.woocommerce-checkout #order_review #wc-stripe-upe-form {
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
}

.woocommerce-checkout #order_review #wc-stripe-upe-errors {
  color: var(--accent);
  font-size: 0.86rem;
  margin-top: 10px;
  min-height: 0;
}

.woocommerce-checkout #order_review #wc-stripe-upe-errors:empty {
  margin-top: 0;
}

/* Save-card checkbox: Woo renders it as a full form-row with the label styling
   of a required field, which oversells an optional convenience. */
.woocommerce-checkout #order_review .woocommerce-SavedPaymentMethods-saveNew {
  margin: 14px 0 0;
  padding: 0;
}

.woocommerce-checkout #order_review .woocommerce-SavedPaymentMethods-saveNew label {
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  display: inline;
}

/* --- Order button --------------------------------------------------------- */

.woocommerce-checkout #order_review .form-row.place-order {
  padding: 18px 0 0;
  margin: 0;
}

.woocommerce-checkout #place_order {
  width: 100%;
  height: 54px;
  padding: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

/* The terms line is a legal necessity, not a selling point. */
.woocommerce-checkout #order_review .tcg-terms-note,
.woocommerce-checkout #order_review .woocommerce-privacy-policy-text p {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--faint);
  margin: 0 0 12px;
}

.woocommerce-checkout #order_review .tcg-terms-note a,
.woocommerce-checkout #order_review .woocommerce-privacy-policy-text a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Wallets -------------------------------------------------------------- */

/* The plugin's own "— OR —" is an em dash rule with nothing either side of it
   once the buttons move down here. Replaced by .tcg-wallets__label. */
#wc-stripe-express-checkout-button-separator {
  display: none !important;
}

.tcg-wallets {
  margin-top: 20px;
}

/* Apple Pay renders on Apple devices, Google Pay in Chrome with a card on file,
   and neither anywhere else. A divider reading "or pay with" above an empty box
   is worse than no divider, so the label follows the plugin's own decision:
   Stripe writes display:block onto its separator once a wallet has actually
   mounted. If :has() ever fails, the label stays hidden and the buttons still
   work, which is the right way round for this to break. */
.tcg-wallets__label {
  display: none;
}

.tcg-wallets:has(#wc-stripe-express-checkout-button-separator[style*='display: block']) .tcg-wallets__label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.tcg-wallets__label::before,
.tcg-wallets__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tcg-wallets #wc-stripe-express-checkout-element {
  margin: 0;
}

/* --- Payment panel, small screens ---------------------------------------- */
@media (max-width: 780px) {
  .woocommerce-checkout #order_review #payment div.payment_box {
    padding: 14px;
  }

  .woocommerce-checkout #place_order {
    height: 56px;
  }

  .woocommerce-checkout #order_review #payment label[for='payment_method_stripe']::after {
    background-size: auto 19px;
    height: 19px;
  }
}

/* --- Empty basket ---------------------------------------------------------
   WooCommerce renders this as two stacked notices and a button floated right,
   which is what the owner saw: "removed. Undo?", "Your basket is currently
   empty.", and a black pill hanging on its own in the middle of the page. It
   reads as an error state rather than a normal, frequent moment.
   -------------------------------------------------------------------------- */

.woocommerce-cart .woocommerce:has(.cart-empty) {
  display: block;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 8px 0 24px;
}

.woocommerce-cart .cart-empty {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}

/* The line under it, added in woocommerce.php. */
.woocommerce-cart .tcg-empty-note {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 26px;
  line-height: 1.55;
}

.woocommerce-cart .return-to-shop {
  margin: 0;
}

.woocommerce-cart .return-to-shop .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* The "removed. Undo?" notice belongs with the message, not stacked above it
   in its own bordered slab. */
.woocommerce-cart .woocommerce:has(.cart-empty) .woocommerce-message {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.woocommerce-cart .woocommerce:has(.cart-empty) .woocommerce-message::before {
  content: none;
}

/* --- Order received -------------------------------------------------------
   The last page of the sale, and the one a customer screenshots. */

.woocommerce-order .woocommerce-thankyou-order-received {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 0 0 26px;
}

.woocommerce-order ul.woocommerce-order-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 34px;
  padding: 0;
  list-style: none;
}

.woocommerce-order ul.woocommerce-order-overview li {
  background: #fff;
  border: 0;
  float: none;
  margin: 0;
  padding: 15px 18px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: left;
}

.woocommerce-order ul.woocommerce-order-overview li strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-weight: 600;
}

.woocommerce-order h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 16px;
}

.woocommerce-order .woocommerce-table--order-details,
.woocommerce-order .woocommerce-order-details__title + table {
  border: 1px solid var(--line);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
}

.woocommerce-order .woocommerce-table--order-details th,
.woocommerce-order .woocommerce-table--order-details td {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.woocommerce-order .woocommerce-table--order-details thead th {
  border-top: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--paper);
}

.woocommerce-order .woocommerce-customer-details address {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  font-style: normal;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .woocommerce-order ul.woocommerce-order-overview {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- My account -----------------------------------------------------------
   Untouched until now, which meant WooCommerce's default: a bulleted list of
   links beside a paragraph, on a page a customer reaches to check where their
   order is. Same two-column shape as the basket, same card treatment as
   everywhere else.
   -------------------------------------------------------------------------- */

/* Two columns only when there is a navigation to fill the first one, and every
   child placed by name rather than by the order it happens to arrive in.
   Stated positively and explicitly because the identical mistake had just been
   fixed on the basket the same afternoon and was repeated here anyway: the
   notices wrapper is a third child, so on source order alone it took column
   one, the navigation was pushed into column two and the content dropped to the
   row below. The page looked like it had been shaken. */
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.woocommerce-account .woocommerce > .woocommerce-notices-wrapper {
  grid-column: 1 / -1;
}

/* WooCommerce floats these two at 30% and 68%. A grid ignores the float and
   honours the width, so both sat shrunken inside their columns: the navigation
   came out 70px wide in a 232px column, the content 579px in an 852px one, with
   a 202px hole between them. Placed and widened together. */
.woocommerce-account .woocommerce > .woocommerce-MyAccount-navigation {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  float: none;
}

.woocommerce-account .woocommerce > .woocommerce-MyAccount-content {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  float: none;
}

/* An empty notices wrapper still opens a row and a 40px gap. */
.woocommerce-account .woocommerce > .woocommerce-notices-wrapper:empty {
  display: none;
}

/* Logged out there is no navigation to sit beside, so one narrow column. A
   login form stretched across 1180px looks abandoned. */
.woocommerce-account .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) {
  max-width: 430px;
  margin: 0 auto;
}

/* --- Navigation --- */

.woocommerce-account .woocommerce-MyAccount-navigation {
  position: sticky;
  top: 20px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.woocommerce-account .woocommerce-MyAccount-navigation li {
  margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.2s var(--t), color 0.2s var(--t);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  background: #fff;
  color: var(--ink);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background: var(--accent-ink);
  color: #fff;
}

/* Logging out is not a peer of the pages above it. */
.woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout a {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Content --- */

.woocommerce-account .woocommerce-MyAccount-content {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 30px;
}

.woocommerce-account .woocommerce-MyAccount-content > p:first-child {
  margin-top: 0;
}

.woocommerce-account .woocommerce-MyAccount-content h2,
.woocommerce-account .woocommerce-MyAccount-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 14px;
}

/* --- Orders table --- */

.woocommerce-account .woocommerce-orders-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  margin: 0;
}

.woocommerce-account .woocommerce-orders-table th,
.woocommerce-account .woocommerce-orders-table td {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  font-size: 0.95rem;
}

.woocommerce-account .woocommerce-orders-table thead th {
  border-top: 0;
  background: var(--paper);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a {
  margin: 0 6px 0 0;
}

/* Nothing ordered yet is a normal state, not an error. */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Message {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* --- Addresses --- */

/* Two addresses, so two columns. auto-fit opened a third on a 790px content
   pane and left it empty. */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

/* WooCommerce clears its floats with ::before and ::after on this container.
   In a grid a pseudo-element is a grid item like any other, so the two of them
   took cells: the billing address was pushed into column two and shipping
   dropped to the row below it. Two empty boxes, invisible, holding the layout
   apart. */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses::before,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses::after {
  content: none;
  display: none;
}

/* WooCommerce floats these and gives them a percentage width, the same trap as
   the two panes above: the float is ignored in a grid, the width is not, and
   the cards came out 121px wide inside 251px columns. */
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Address {
  width: 100%;
  float: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.woocommerce-account .woocommerce-Address-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

/* "Edit" is one word and should stay one word. It carries a visually hidden
   "Billing address" after it for screen readers, which is why the link wrapped
   into three lines beside a heading doing the same. */
.woocommerce-account .woocommerce-Address-title .edit {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.woocommerce-account .woocommerce-Address-title .edit .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 620px) {
  .woocommerce-account .woocommerce-MyAccount-content .woocommerce-Addresses {
    grid-template-columns: minmax(0, 1fr);
  }
}

.woocommerce-account .woocommerce-Address-title h2,
.woocommerce-account .woocommerce-Address-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.woocommerce-account .woocommerce-Address address {
  font-style: normal;
  line-height: 1.65;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* --- Forms (login, register, account details, address edit) --- */

.woocommerce-account form .form-row {
  margin: 0 0 16px;
  padding: 0;
}

.woocommerce-account form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Outspecifies this stylesheet's own generic
   ".woocommerce form .form-row input.input-text" at (0,4,1), which sizes inputs
   by padding and left them 55px beside a 50px button. Not a fight worth having
   twice: written here at (0,5,2) so the field and the button it sits above are
   deliberately the same height. */
body.woocommerce-account .woocommerce form .input-text,
body.woocommerce-account .woocommerce form input[type='text'],
body.woocommerce-account .woocommerce form input[type='email'],
body.woocommerce-account .woocommerce form input[type='tel'],
body.woocommerce-account .woocommerce form input[type='password'],
body.woocommerce-account .woocommerce form select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: border-color 0.25s var(--t);
}

body.woocommerce-account .woocommerce form .input-text:focus,
body.woocommerce-account .woocommerce form select:focus {
  outline: none;
  border-color: var(--ink);
}

/* Woo wraps password fields in a span with a reveal button. */
.woocommerce-account form .password-input {
  display: block;
  position: relative;
  width: 100%;
}

.woocommerce-account form .show-password-input {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.woocommerce-account form .woocommerce-form-login__rememberme,
.woocommerce-account form .woocommerce-form__label-for-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 14px;
}

body.woocommerce-account .woocommerce form .woocommerce-form-login__submit,
body.woocommerce-account .woocommerce form button.button {
  width: 100%;
  height: 50px;
  padding: 0 24px;
  justify-content: center;
}

.woocommerce-account .lost_password {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.woocommerce-account .lost_password a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The logged-out heading is a bare <h2> above the form. */
.woocommerce-account .woocommerce > h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 18px;
}

.woocommerce-account .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) form.login {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 26px 24px;
  margin: 0;
}

@media (max-width: 860px) {
  /* Matching the :has() above, which is (0,3,0). Written as ".woocommerce"
     alone this was (0,2,0) and lost, so a phone kept the desktop two columns
     and squeezed the content into 63px beside a 232px sidebar. The children
     need releasing from their placement too, or they sit side by side in a
     single-column grid. */
  .woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .woocommerce-account .woocommerce > .woocommerce-MyAccount-navigation,
  .woocommerce-account .woocommerce > .woocommerce-MyAccount-content {
    grid-column: 1;
    grid-row: auto;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation {
    position: static;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation li--customer-logout {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .woocommerce-account .woocommerce-MyAccount-content {
    padding: 22px 20px;
  }
  .woocommerce-account .woocommerce-orders-table thead {
    display: none;
  }
  .woocommerce-account .woocommerce-orders-table tr {
    display: block;
    border-top: 1px solid var(--line);
    padding: 12px 4px;
  }
  .woocommerce-account .woocommerce-orders-table tr:first-child {
    border-top: 0;
  }
  .woocommerce-account .woocommerce-orders-table td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    padding: 5px 12px;
  }
  .woocommerce-account .woocommerce-orders-table td::before {
    content: attr(data-title);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
}

/* --- Agreeing to the terms at checkout ------------------------------------
   Quiet, and unmissable. Small print sitting where the eye already goes on the
   way to the button, but with a target a thumb can hit and an error that says
   what to do rather than failing silently. */
.woocommerce-checkout .tcg-terms {
  display: block;
  margin: 4px 0 14px;
  padding: 0;
}

.woocommerce-checkout .tcg-terms label.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  /* Checkbox labels elsewhere on this form are semibold, which on a line of
     small print reads as shouting. This one is meant to be noticed and then
     agreed with, not announced. */
  font-weight: 400;
  /* The whole line is the target, not just the 16px box. */
  min-height: 44px;
  padding: 6px 0;
  margin: 0;
  cursor: pointer;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted, #5c5c66);
}

.woocommerce-checkout .tcg-terms input[type='checkbox'] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent, #c8392b);
  cursor: pointer;
}

.woocommerce-checkout .tcg-terms__text {
  flex: 1 1 auto;
}

/* The links are the point of the sentence, so they read as links. */
.woocommerce-checkout .tcg-terms a {
  color: var(--ink, #17171a);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.woocommerce-checkout .tcg-terms a:hover {
  color: var(--accent, #c8392b);
}

.woocommerce-checkout .tcg-terms abbr.required {
  border: 0;
  color: var(--accent, #c8392b);
  text-decoration: none;
}

/* Unticked and submitted: the row itself says so, not only the notice at the
   top of a long page. */
.woocommerce-checkout .tcg-terms.woocommerce-invalid label.checkbox {
  color: var(--accent, #c8392b);
}
.woocommerce-checkout .tcg-terms.woocommerce-invalid input[type='checkbox'] {
  outline: 2px solid var(--accent, #c8392b);
  outline-offset: 2px;
  border-radius: 3px;
}

/* The only country we ship to.
   WooCommerce renders it as a select with one option and strips its border and
   padding, because it is not really a choice. That left a 174px, 29px, 17px
   line sitting among 335px, 55px fields, reading as something half-finished.
   Present it as what it is: the value, on its own line, aligned with the labels
   above it. */
.woocommerce-checkout form .form-row select.country_to_state--single,
.woocommerce-checkout form .form-row .country_to_state--single {
  width: 100%;
  padding: 4px 0 0;
  border: 0;
  background: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink, #17171a);
  /* One option: opening it achieves nothing. The value still submits. */
  pointer-events: none;
}

/* --- The card panel while it is still loading -----------------------------

   Two things were visible for the first second of every checkout, and one
   second is long enough for a customer to see a broken form and stop.

   Stripe creates a helper input so it can read our computed styles and match
   them inside its iframe. It sets opacity:0 on it, but not before the browser
   has painted it once, and our field styling gives it a border, so a thin
   bordered box appeared under the card fields. It is a measuring tool and is
   never meant to be seen. */
#wc-stripe-hidden-style-input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* The iframe reports its own height and grows to about 380px once the fields
   are laid out. Starting from nothing, the panel drew short, cut "Security
   code" in half and left the rest of the box empty until it caught up.
   Reserving the room means the box is the right size from the first paint and
   nothing jumps. Not a fixed height: Stripe still sizes itself, this is only a
   floor for the moment before it does. */
.woocommerce-checkout #order_review .wc-stripe-upe-element {
  min-height: 300px;
}

/* Where the cardholder name went. Quiet, at the top of the card panel, before
   anyone has had time to look for a field that is not there. */
.woocommerce-checkout .tcg-card-note {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--faint, #6e6e78);
}

/* The empty rectangle under the card fields.
   WooCommerce Stripe wraps the "save payment information" checkbox in a
   fieldset with no class, then hides the checkbox itself for a guest. The
   fieldset stays behind with the browser's own 2px groove border and draws an
   empty box under the card form, which reads as something that failed to load. */
.woocommerce-checkout #order_review #payment fieldset:not([class]) {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

/* And with nothing inside it left to show, it should not hold space either. */
.woocommerce-checkout #order_review #payment fieldset:not([class]):has(> .form-row[style*='display: none']:only-child) {
  display: none;
}

/* Delivery choices in the checkout summary get the same treatment as the cart.
   The rows were already 46 and 68px and the label selects the radio, so the
   target was never really 13px, but a 13px dot next to 17px text looks like an
   afterthought and is a poor thing to aim at deliberately. */
.woocommerce-checkout #order_review #shipping_method li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 3px 0;
}

.woocommerce-checkout #order_review #shipping_method li input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent, #c8392b);
}

.woocommerce-checkout #order_review #shipping_method li label {
  flex: 1 1 auto;
  text-align: left;
  line-height: 1.45;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Advanced Shipment Tracking, in the shop's colours

   The plugin ships its own palette and it is not ours: the tracking number
   renders in Material light blue (#03a9f4) and the Track button in a dark blue
   (#005b9a). On a page where everything else is ink, cream and the shop's red,
   two blues from a different design system are the first thing the eye lands
   on, and they land on it because they are wrong rather than because they are
   important.

   Everything here is colour and spacing. The plugin's markup and behaviour are
   left alone, so an update cannot break the shop, only restyle it.
   --------------------------------------------------------------------------- */

.woocommerce-account .tracking_number,
.woocommerce-account .ast-tracking-number,
.woocommerce-account .tracking_number a {
  color: var(--ink, #17171a);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.woocommerce-account .tracking_number a:hover {
  color: var(--accent, #c8392b);
  text-decoration: underline;
}

.woocommerce-account .track-button,
.woocommerce-account a.track-button,
.woocommerce-account button.track-button {
  background: var(--ink, #17171a) !important;
  border-color: var(--ink, #17171a) !important;
  color: #fff !important;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  /* 44px, so it is a real target on a phone rather than a decoration. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}
.woocommerce-account .track-button:hover {
  background: var(--accent, #c8392b) !important;
  border-color: var(--accent, #c8392b) !important;
}

/* The tracking panel itself: same card as everything else on these pages. */
.woocommerce-account .ast-tracking-info,
.woocommerce-account .wcast-tracking-info,
.woocommerce-account .tracking-info-block {
  background: var(--paper, #faf8f4);
  border: 1px solid var(--line, #e9e6e0);
  border-radius: 10px;
}

/* ---------------------------------------------------------------------------
   Account details form

   The password fieldset carried the browser's default 2px groove border, which
   is a 1997 inset ridge sitting in the middle of a page built from flat cards.
   And the fields inside it came out 757px against 790px for the fields above,
   because the fieldset's own padding narrowed them, so one form had two column
   widths and looked ragged down the right edge.
   --------------------------------------------------------------------------- */

.woocommerce-account .woocommerce-EditAccountForm fieldset {
  border: 1px solid var(--line, #e9e6e0);
  border-radius: 10px;
  padding: 18px 20px 4px;
  margin: 26px 0 0;
  background: var(--paper, #faf8f4);
}
.woocommerce-account .woocommerce-EditAccountForm fieldset legend {
  padding: 0 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink, #17171a);
}
/* Only the rows that are meant to be full width.
   The first attempt at this set width:100% on every .woocommerce-form-row in
   the form, which also caught form-row-first and form-row-last: first name and
   last name stopped sitting side by side and became two full-width fields, one
   above the other. The two-column pair is deliberate and it stays. */
.woocommerce-account .woocommerce-EditAccountForm .woocommerce-form-row-wide,
.woocommerce-account .woocommerce-EditAccountForm fieldset .woocommerce-form-row {
  width: 100%;
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
   Signed-out account page

   The login card sat hard against the left of a 1200px container with two
   thirds of the row empty beside it, because the grid that lays out the
   navigation and the content on the signed-in pages still applied when there
   was no navigation to lay out.
   --------------------------------------------------------------------------- */

.woocommerce-account:not(.logged-in) .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) {
  max-width: 460px;
  margin-inline: auto;
}
.woocommerce-account .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.woocommerce-account .woocommerce-form-login__rememberme input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink, #17171a);
}

/* ---------------------------------------------------------------------------
   The "link my guest orders" notice on the orders page

   WooCommerce offers it as a .woocommerce-info with a full primary button, so
   on a page whose entire purpose is the list of orders below it, the loudest
   thing was an optional side errand for people who had checked out as a guest.
   The feature is worth keeping, especially here where most people will buy
   without an account first. Its weight is not.

   Outlined rather than filled, so it reads as available rather than as the
   thing to do next. Nothing is hidden.
   --------------------------------------------------------------------------- */

.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button {
  background: transparent;
  color: var(--ink, #17171a);
  box-shadow: inset 0 0 0 1px var(--line, #d7d2c9);
}
.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-info .button:hover {
  background: var(--ink, #17171a);
  color: #fff;
  box-shadow: none;
}

/* Collection PIN on the customer's own order page. */
.tcg-pin {
  margin: 26px 0 0;
  padding: 16px 18px;
  background: var(--paper, #faf8f4);
  border-left: 4px solid var(--accent, #c8392b);
  border-radius: 10px;
}
.tcg-pin h2 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #5c5c66);
}
.tcg-pin__n {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink, #17171a);
  user-select: all;
}
.tcg-pin__h {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted, #5c5c66);
}
