/* ══════════════════════════════════════════════════════════════════════════
   THE CATALOGUE SCREENS — shop, product category, product tag.

   Almost nothing. The archive's design is emitted as the concept's own class
   names by woocommerce/archive-product.php, woocommerce/content-product.php and
   inc/catalogue.php, so concept.css styles it directly: `.cathero`, `.catfacts`,
   `.catbody`, `.catgroup-head`, `.catsibs`, `.cta-band`, `.crumbs--light`,
   `.card`, `.card-img`, `.card-body`, `.card h3`, `.price .unit`, `.tier-badge`,
   `.card-cta`, `.sr-head` and `.sr-facet` were all already in there and were all
   matching nothing.

   What is left is the four places where the store's markup genuinely cannot be
   the concept's markup. Each one says which, and why. No new colours: every
   value below is either a concept.css token or a geometry the concept states
   itself.
   ══════════════════════════════════════════════════════════════════════════ */


/* ── 1 · three across, not four ────────────────────────────────────────────
   concept.css:328 is `.grid{grid-template-columns:repeat(3,1fr)}` and every
   concept grid is `.grid.grid--3`, which is now what the loop emits. But
   style.css:944 declares `repeat(4,1fr)` against `.woocommerce ul.products` —
   two classes and an element, which outguns a bare `.grid` (one class) no
   matter which stylesheet loads last. So the concept's own value is restated at
   a specificity that reaches, scoped to the two sections this theme draws.

   The 2-up step is concept.css:1992 (`.grid--3` at 900px), stated here for the
   same reason: without it the rule above would hold three columns all the way
   down to a phone. */
ul.products.grid.grid--3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
@media (max-width:900px){
  ul.products.grid.grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* …and the card has to fill the column it is given.
   WooCommerce's own woocommerce-layout.css lays the loop out as floats and
   sizes each item off the `columns-N` class the loop prints:

     .woocommerce ul.products li.product            {float:left; width:22.05%}
     .woocommerce ul.products.columns-3 li.product  {width:30.75%}

   style.css cancels the first with `float:none; width:auto` at the same
   specificity and wins on load order — which is why the four-across grid looked
   right. The `.columns-3` rule is one class heavier, so the moment
   `loop_shop_columns` was filtered to the concept's three, every card collapsed
   to 30.75% of its own grid column: a 322px column holding a 99px card.

   Restated here at a specificity that clears it. `float` and `margin` come
   along because they are the other two halves of the same float layout, and a
   grid item should carry neither.

   Both rules key off `.grid.grid--3` rather than off the two sections, because
   the theme's loop-start filter adds those classes to EVERY product loop it
   renders — related products and cross-sells included, which emit `columns-4`
   and `columns-2` and would otherwise hit the same rule from the other end. */
ul.products.grid.grid--3 > li.product{
  width:auto; float:none; margin:0;
}


/* ── 2 · the link between `.card` and `.card-body` ─────────────────────────
   The concept's card is a single `<a class="card">` with `.card-body` as a
   direct child, and `.card-body{flex:1}` (concept.css:343) is what pushes the
   "View" affordance onto the card's bottom edge so a one-line name and a
   two-line name end at the same height.

   WooCommerce puts one element in between: `woocommerce_template_loop_product_
   link_open` opens `<a class="woocommerce-LoopProduct-link">` around the whole
   card interior, and that `<a>` — not `<li class="card">` — is `.card-body`'s
   flex parent. It therefore has to carry the column itself. This is the same
   declaration style.css already makes; it is repeated rather than relied on
   because it is load-bearing for the card's geometry and the two files are
   maintained separately. */
ul.products li.product > a.woocommerce-LoopProduct-link{
  display:flex; flex-direction:column; flex:1;
  color:inherit; text-decoration:none;
}


/* ── 2b · the card title is the concept's, not WooCommerce's ───────────────
   `content-product.php` prints the concept's own bare `<h3>` — no class — so
   the only theme rule written for a loop title, style.css's
   `.woocommerce-loop-product__title`, matches nothing here, and the concept's
   `.card h3` (concept.css:344, one class + one element) is outgunned by
   woocommerce.css's

     .woocommerce ul.products li.product h3{padding:.5em 0; margin:0; font-size:1em}

   which is three classes and three elements. Measured on /shop/: the title
   rendered at font-size 17px with 8.5px of padding above and below, where the
   design says 15px and none — every card 17px taller than the design, on the
   most-viewed screen in the store.

   It is worse than a size difference. `-webkit-line-clamp` counts lines in the
   CONTENT box while `overflow:hidden` clips at the PADDING box, so the bottom
   8.5px let the line after the ellipsis show through: at 390px the shop grid
   printed "Rosen Abutment® Shoulder Regul…" with a chopped half-line of
   "Platform" bleeding underneath it. The concept's own card, measured in the
   same viewport, clamps at exactly two lines (38px) with no bleed.

   Restated here at a specificity that reaches — same weight as core's rule,
   and this file loads after woocommerce.css. Nothing new is stated: 15px, 1.4
   and 500 are concept.css:344's own values, and the padding goes back to the
   nothing the concept gives it. The clamp itself is left to concept.css. */
.woocommerce ul.products li.product h3,
.woocommerce ul.products li.product .card-body h3{
  font-size:15px; line-height:1.4; font-weight:500; padding:0;
}


/* ── 3 · the facet pills are links ─────────────────────────────────────────
   The concept's `.sr-facet` is an inert `<button>` in a static mock. On a store
   it has to filter, and a filter that is a URL is shareable, bookmarkable and
   works without JavaScript — so it is an `<a>` carrying the same class.

   An anchor is `display:inline`, where a button is `inline-block`: without this
   the 8px/15px padding concept.css:866 sets would not open the line box and the
   pills would overlap their neighbours. `.is-on` is the state the mock has no
   need for; it reuses concept.css:871's own hover values rather than
   introducing a fourth green. */
.sr-facet{
  display:inline-flex; align-items:center; text-decoration:none;
}
.sr-facet.is-on{
  border-color:var(--green-ink); color:var(--green-ink); background:var(--green-soft);
}


/* ══════════════════════════════════════════════════════════════════════════
   THE SUB-CATEGORY TILES — P3

   Nothing. concept.css:1234-1294 styles `.subcats`, `.subcats-head`,
   `.subcats-rail`, `.subcat`, `.subcat--all`, `.subcat.is-current`,
   `.subcat-img`, `.subcat-name` and `.subcat-count`, and inc/catalogue.php
   emits exactly those names — build_pages.py::subcat_tiles_html calls that
   class list "the contract the theme's archive builds against", so the archive
   builds against it and the design keeps one copy.

   An earlier revision of this file carried a rail of its own, written when no
   `c/*.html` had one yet. It is deleted rather than kept as a fallback: two
   stylesheets for one component is how a design and a store drift apart, and
   `.subcat` here would have loaded after concept.css and won every conflict.
   ══════════════════════════════════════════════════════════════════════════ */


/* ── the price-break badge has to fit the card it sits in ──────────────────
   The concept's `.tier-badge` holds "2+ save 10%". This store's holds "10% off
   from box 2", because the discount is STEPPED (C7) and the shorter sentence
   claims a saving the cart does not give — see rosen_catalogue_tier_badge().
   Nineteen characters at 11.5px measure 129px, and a 2-up card at 360px has
   124px of content box, so the longer copy is the one that can outgrow its
   card. `inline-block` cannot shrink and would simply hang over the edge; with
   a ceiling it wraps to a second line instead, which is what the extra
   line-height is for. Above 400px nothing changes — it is one line either
   way. */
.woocommerce ul.products li.product .tier-badge{
  max-width:100%; line-height:1.35;
}


/* ══════════════════════════════════════════════════════════════════════════
   BUYING FROM A CARD — K4

   `woocommerce_template_loop_add_to_cart` prints its anchor AFTER
   `woocommerce_template_loop_product_link_close`, so the button is a sibling of
   the card's link rather than a link inside a link. `li.card` is the flex
   column (concept.css:330) and the inner `<a>` carries `flex:1` from rule 2
   above, so the button lands on the card's bottom edge whatever the name does.

   The button is the concept's own `.btn.btn--sm.btn--block` — no new geometry —
   with the two corrections that class needs in a card: `.btn`'s 30px top margin
   is a hero's margin, and WooCommerce's own `.button` rules from woocommerce.css
   (its grey background, its font-size, its float) have to be cleared or the
   concept's pill renders as core's grey rectangle.
   ══════════════════════════════════════════════════════════════════════════ */
.woocommerce ul.products li.product .card-buy,
.woocommerce ul.products li.product a.card-buy{
  margin:14px 0 0; float:none; width:100%;
  padding:9px 15px; border-radius:100px;
  font-size:13.5px; font-weight:600; line-height:1.35; text-align:center;
  background:var(--green-ink); color:#fff;
  box-shadow:0 8px 20px rgba(74,115,36,.24);
}
.woocommerce ul.products li.product a.card-buy:hover{
  background:var(--green-ink); color:#fff;
  transform:translateY(-2px); box-shadow:0 14px 30px rgba(74,115,36,.32);
}

/* "Select options" opens the product page instead of adding — a different kind
   of action, so it reads as the concept's secondary button (concept.css:1607)
   rather than as the primary one. A customer should be able to tell the two
   apart before they click. */
.woocommerce ul.products li.product a.card-buy--options{
  background:transparent; color:var(--green-ink);
  border:1px solid #cfe0b6; box-shadow:none; padding:8px 15px;
}
.woocommerce ul.products li.product a.card-buy--options:hover{
  background:var(--green-soft); color:var(--green-ink); box-shadow:none;
}

/* the two states WooCommerce's add-to-cart.js drives on the button itself */
.woocommerce ul.products li.product a.card-buy.loading{opacity:.72}
.woocommerce ul.products li.product a.card-buy.added{
  background:var(--green-soft); color:var(--green-ink); box-shadow:none;
}

/* …and the "View cart" link it appends after a successful add. It is the only
   confirmation on the card that the add worked, so it is not hidden — it is the
   concept's small green link, under the button it belongs to. */
.woocommerce ul.products li.product a.added_to_cart{
  display:block; margin-top:8px; text-align:center;
  font-size:13px; font-weight:600; color:var(--green-ink); text-decoration:none;
}
.woocommerce ul.products li.product a.added_to_cart:hover{text-decoration:underline}


/* ── 4 · the notices, inside the grid section ──────────────────────────────
   `woocommerce_before_shop_loop` fires `woocommerce_output_all_notices` — the
   "added to your cart" message — and the concept's `.catbody` is a grid with a
   44px gap, so an empty notices wrapper would open a 44px hole above the first
   group heading on every page load. It only occupies space when it has
   something to say. */
.catbody > .woocommerce-notices-wrapper:empty{display:none}

/* A 320px viewport cannot hold two full purchase controls plus card padding. */
@media (max-width:360px){
  ul.products.grid.grid--3{grid-template-columns:minmax(0,1fr)}
}
.catbody > .catgroup{min-width:0}
