/* Native WooCommerce presentation for the standalone theme. */
.fm-woocommerce-shell { max-width: 110rem; }
.woocommerce .woocommerce-breadcrumb { margin: 0 0 2rem; color: var(--fm-ink-muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { margin-bottom: 2rem; font-size: .78rem; }
.woocommerce .woocommerce-ordering select { min-height: 2.75rem; padding: .5rem 2.5rem .5rem .75rem; border: 1px solid var(--fm-rule-strong); background: var(--fm-bg); color: var(--fm-ink); }
.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 4.5rem) clamp(1.25rem, 3vw, 2.5rem); margin: 2.5rem 0; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { float: none; width: auto; margin: 0; }
/* woocommerce-smallscreen.css only loads below 768px and reaches the product
   items through `ul.products[class*="columns-"]`, which outranks the rule
   above. Its legacy `width: 48%; float: left` then squeezed each card to
   barely half of its grid column. Match that selector so the grid wins. */
.woocommerce ul.products[class*="columns-"] li.product { float: none; width: auto; }
.woocommerce ul.products li.product a { text-decoration: none; }
.woocommerce ul.products li.product img { aspect-ratio: 4 / 5; object-fit: cover; margin: 0 0 1rem; background: var(--fm-surface-sunk); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: .6rem 0 .4rem; color: var(--fm-primary); font: 400 clamp(1.25rem, 2vw, 1.75rem)/1.25 var(--fm-font-serif); }
.woocommerce ul.products li.product .price { color: var(--fm-ink-muted); font-size: .82rem; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
  min-height: 2.8rem; padding: .75rem 1.1rem; border: 1px solid var(--fm-primary); border-radius: 2px;
  background: var(--fm-primary); color: var(--fm-bg); font-weight: 600;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--fm-attention-token); border-color: var(--fm-attention-token); color: var(--fm-bg); }
.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .9fr); gap: clamp(2rem, 6vw, 7rem); }
.woocommerce div.product div.images, .woocommerce div.product div.summary { float: none; width: auto; }
.woocommerce div.product .product_title { color: var(--fm-primary); font-size: clamp(2.7rem, 5vw, 5.5rem); font-weight: 400; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--fm-attention-token); }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related { grid-column: 1 / -1; }

/* ============================================================
   R5-2 — the product tab row, in this site's design language.
   ============================================================

   WooCommerce ships a bare underlined list of links. These rules give
   the tab row the same tokens as every other control on the site: one
   type family, one colour ramp, one spacing scale, one border
   treatment, one radius.

   The panel markup and the class names WooCommerce's own script looks
   for are untouched, so the bundled keyboard navigation — arrow keys,
   Home, End — keeps working exactly as before. */

.woocommerce div.product .woocommerce-tabs {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--fm-rule);
  padding-top: clamp(1.25rem, 2.5vw, 2rem);
}

.woocommerce div.product .woocommerce-tabs .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  padding: 0;
  list-style: none;
}

.woocommerce div.product .woocommerce-tabs .tabs li {
  margin: 0;
  float: none;
}

.woocommerce div.product .woocommerce-tabs .tabs li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--fm-control-min);
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--fm-rule-strong);
  border-radius: var(--fm-radius-sm);
  background: transparent;
  color: var(--fm-ink);
  font-family: var(--fm-font-mono);
  font-size: 0.72rem;
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.woocommerce div.product .woocommerce-tabs .tabs li a:hover {
  border-color: var(--fm-primary);
  color: var(--fm-primary);
}

.woocommerce div.product .woocommerce-tabs .tabs li a:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}

/* The active tab is the one WooCommerce marks with `.active`. */
.woocommerce div.product .woocommerce-tabs .tabs li.active a {
  border-color: var(--fm-primary);
  background: var(--fm-primary);
  color: var(--fm-bg);
}

.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}

.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel h2 {
  color: var(--fm-primary);
  font: 400 var(--fm-text-2xl) / var(--fm-leading-snug) var(--fm-font-serif);
  margin: 0 0 1rem;
}

/* The lone-description case: product details presented directly, with
   no tab strip at all. */
.woocommerce div.product .fm-product-details {
  grid-column: 1 / -1;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--fm-rule);
  padding-top: clamp(1.25rem, 2.5vw, 2rem);
}

/* R5-7 — ONE Description language.
   A product with two labels shows "Description" as a tab label; a product
   with only a Description shows "Product details" as a section heading.
   Both name the SAME content, so both must be drawn in the same language.
   The tab label is the reference: the WooCommerce tab strip's own
   typography (sitewide.css) is left exactly as R5-5 left it — active
   11.8:1, inactive 6.01:1 on the card surface — and the lone-description
   heading adopts that label's scale, family, weight, tracking and colour,
   plus the same 2px attention rule that marks the open tab.

   The description COPY is unified with it, because the tab strip presents
   that copy as 14px muted sans on a 70ch measure while the section
   presented it as 16px ink serif on 52rem: two voices for one paragraph.
   The panel's inner h2 is aligned with the tab panel's h2; the h3/h4
   inside both presentations then agree on their own, without a rule.

   Scope: the `.fm-product-details*` selectors only. No global h1/h2/h3/h4
   rule is touched, and the WooCommerce tab strip's own typography is not
   touched. */
.woocommerce div.product .fm-product-details__title {
  color: var(--fm-primary);
  font: 500 var(--fm-text-sm) / var(--fm-leading-normal) var(--fm-font-sans);
  letter-spacing: .02em;
  margin: 0 0 var(--fm-space-5);
  position: relative;
  width: fit-content;
}
/* The open-label marker: the same 2px attention rule the active tab label
   carries, under the same text width. */
.woocommerce div.product .fm-product-details__title::after {
  background: var(--fm-attention-token);
  bottom: -.4rem;
  content: '';
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}
.woocommerce div.product .fm-product-details__panel {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--fm-ink-muted);
  font-size: var(--fm-text-sm);
  line-height: 1.7;
  max-width: 70ch;
}
.woocommerce div.product .fm-product-details__panel h2 {
  color: var(--fm-primary);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 var(--fm-space-3);
  text-transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .woocommerce div.product .woocommerce-tabs .tabs li a { transition: none; }
}
.woocommerce table.shop_table { border: 1px solid var(--fm-rule); border-collapse: collapse; border-radius: 0; }
.woocommerce table.shop_table th, .woocommerce table.shop_table td { border: 1px solid var(--fm-rule); padding: 1rem; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select { min-height: 2.8rem; padding: .65rem; border: 1px solid var(--fm-rule-strong); background: var(--fm-surface); }
.woocommerce .woocommerce-message, .woocommerce .woocommerce-info, .woocommerce .woocommerce-error { border-top-color: var(--fm-primary); background: var(--fm-surface); }
.woocommerce nav.woocommerce-pagination ul { border: 0; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; margin: .2rem; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span { min-width: 2.75rem; min-height: 2.75rem; display: grid; place-items: center; border: 1px solid var(--fm-rule); }
@media (max-width: 53.124rem) {
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* `1fr` resolves to `minmax(auto, 1fr)`, so the single track takes the
     min-content width of its widest child and pushes the whole product column
     past the shell padding. Pinning the track minimum to 0 keeps the gallery,
     variation select, drive field, upload dropzone and add-to-cart control
     inside the same content width. */
  .woocommerce div.product { grid-template-columns: minmax(0, 1fr); }
  .woocommerce div.product > *,
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary,
  .woocommerce div.product form.cart,
  .woocommerce div.product form.cart > *,
  .woocommerce div.product .variations,
  .woocommerce div.product .variations td select,
  .woocommerce div.product .products-uploads-dragandrophandler { min-width: 0; max-width: 100%; }
  /* The upload dropzone is authored content-box with its own padding and
     dashed border, so it rendered 10px wider than every neighbouring field
     even with max-width applied. */
  .woocommerce div.product .products-uploads-dragandrophandler,
  .woocommerce div.product .products-uploads-dragandrophandler-inner { box-sizing: border-box; }
  /* The plugin gives its wrapper `margin: 15px 5px`, which shifted the whole
     dropzone 5px right of the drive field and quantity controls beside it. */
  .woocommerce div.product .products-uploads-dragandrophandler-container { margin-inline: 0; }
  .woocommerce div.product .variations td select,
  .woocommerce div.product form.cart input.input-text,
  .woocommerce div.product form.cart .single_add_to_cart_button { box-sizing: border-box; width: 100%; }
  .woocommerce div.product div.images img { margin-inline: auto; }
}
@media (max-width: 35rem) {
  /* Mobile catalogues read as two columns; a single column left half the
     content width empty at every phone and tablet width. */
  .woocommerce ul.products { gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 1.05rem; }
  .woocommerce ul.products li.product a.button { display: block; width: 100%; }
}

/* Product action buttons follow the existing V2 commerce button system above.
   WooCommerce's own `button.button.alt` rule and the upload plugin's
   `products-uploads-text-browser a` rule are more specific than the theme's
   single-product rules, so the button colour and font are re-asserted with a
   tighter scope instead of source order alone. */
.woocommerce div.product button.button.single_add_to_cart_button,
.woocommerce div.product .products-uploads-text-browser a {
  align-items: center;
  background: var(--fm-primary);
  border: 1px solid var(--fm-primary);
  border-radius: 2px;
  color: var(--fm-bg);
  display: inline-flex;
  font-family: var(--fm-font-sans);
  font-size: .9rem;
  font-weight: 600;
  justify-content: center;
  line-height: 1.4;
  min-height: 2.8rem;
  padding: .75rem 1.1rem;
  text-decoration: none;
  text-transform: none;
}
.woocommerce div.product button.button.single_add_to_cart_button:hover,
.woocommerce div.product button.button.single_add_to_cart_button:focus-visible,
.woocommerce div.product .products-uploads-text-browser a:hover,
.woocommerce div.product .products-uploads-text-browser a:focus-visible {
  background: var(--fm-primary-hover);
  border-color: var(--fm-primary-hover);
  color: var(--fm-bg);
}
.woocommerce div.product button.button.single_add_to_cart_button:focus-visible,
.woocommerce div.product .products-uploads-text-browser a:focus-visible {
  outline: 2px solid var(--fm-attention-token);
  outline-offset: 2px;
}
.woocommerce div.product button.button.single_add_to_cart_button.disabled,
.woocommerce div.product button.button.single_add_to_cart_button:disabled {
  background: var(--fm-surface-sunk);
  border-color: var(--fm-rule-strong);
  color: var(--fm-ink-muted);
}

/* The Description tab button is authored with an inline style block in the
   product copy. An author inline style can only be replaced from a stylesheet,
   so this single element needs !important; no other rule in this file uses it. */
.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description p > a {
  background: var(--fm-primary) !important;
  border: 1px solid var(--fm-primary) !important;
  border-radius: 2px !important;
  color: var(--fm-bg) !important;
  display: inline-flex !important;
  align-items: center;
  font-family: var(--fm-font-sans) !important;
  font-size: .9rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  margin-top: 1rem !important;
  min-height: 2.8rem;
  padding: .75rem 1.1rem !important;
  text-decoration: none !important;
  text-transform: none !important;
}
.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description p > a:hover,
.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description p > a:focus-visible {
  background: var(--fm-primary-hover) !important;
  border-color: var(--fm-primary-hover) !important;
  color: var(--fm-bg) !important;
}

/* ============================================================
   R5-CLS-01 — stabilise the WooCommerce product gallery while
   its FlexSlider initialises.

   WooCommerce 11.1.0 builds the gallery's FlexSlider track at
   200% x slideCount and then defers the gallery slide sizing by
   100 ms (setTimeout in its FlexSlider fork). During that window
   the first gallery slide — which carries no sizing rule of its
   own — stretches to the full track width, so the gallery renders
   at roughly four times its settled height. Below 850px the
   product layout is a one-column grid, so that transient height
   pushes `div.summary.entry-summary` entirely out of the
   viewport: CLS = 0.3913 on the product page.

   Constraining the gallery slides to the gallery column makes the
   gallery measure its settled height from the first paint. The
   settled rendering is unchanged. */

.woocommerce div.product div.images {
    container-type: inline-size;
}

.woocommerce div.product div.images
.woocommerce-product-gallery__image {
    float: left;
    max-width: 100cqw;
}
