/* ============================================================================
   ragazzi-product-card.css - the design's PRODUCT CARD, and nothing else.

   EXTRACTED FROM ragazzi-bestsellers.css on 2026-08-19, unchanged apart from the
   scope class and four token names. It was written there because the home
   bestsellers rail was the first thing to render `snippets/ragazzi-product-card`;
   the catalogue's product-gallery is the second, and a shared SNIPPET whose CSS
   lives in one section's stylesheet is the trap playbook §8.5 names outright -
   the second section silently loses every property it does not restate, starting
   with the ones nothing measures.

   SCOPE: `.ragazzi-cards`, which both hosts put on their grid wrapper. It is a
   class and not the bare `.product-card` on purpose: the rules were tuned at
   (0,2,0) against Dawn's card stylesheets, and dropping a level would hand ties
   to whatever Dawn links after us.

   RENAMED, mechanically:
     .ragazzi-cards  ->  .ragazzi-cards
     --sp-card-chip-gap  --sp-card-info-gap  --sp-card-info-pt  --sp-card-media-pad
       ->  --sp-card-*        (they are the CARD's spacings; the `bs` prefix
                               named the file they used to live in)

   The tokens below are exactly the ones the card rules read and the rail does
   not - checked, not assumed: of the 22 declared on the old section root, 14 are
   card-only, 7 are rail-only and ZERO are shared, which is what made the split
   safe. The rail keeps its own (`--size-card-w` is the RAIL's item width, not the
   card's, and stays behind).

   Global tokens the card also reads come from ragazzi-tokens.css as before:
   --font-body, --lh-tight, --color-black, --color-white, --color-text-muted,
   --text-card-title. `--card-image-position` is set inline per card by the
   snippet, from the product image's focal point.
============================================================================ */

/* ---------------------------------------------------------------------------
   CARD TOKENS - carried in the static's own band order.
--------------------------------------------------------------------------- */
.ragazzi-cards {
  --lh-card-desc:        1.1;
  --lh-chip:             1.27;
  --radius-none:         0;
  --size-media-h:        clamp(291.73px, calc(547px * (var(--max-vw) / var(--vw-base))), 547px);
  --sp-card-chip-gap:      clamp(5.33px, calc(10px * (var(--max-vw) / var(--vw-base))), 10px);
  --sp-card-info-gap:      clamp(10.67px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --sp-card-info-pt:       clamp(10.67px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --sp-card-media-pad:     clamp(6.77px, calc(12.7px * (var(--max-vw) / var(--vw-base))), 12.7px);
  --sp-chip-pad-x:       clamp(2.67px, calc(5px * (var(--max-vw) / var(--vw-base))), 5px);
  --sp-chip-pad-y:       clamp(2.67px, calc(5px * (var(--max-vw) / var(--vw-base))), 5px);
  --text-card-desc:      clamp(10px, calc(18px * (var(--max-vw) / var(--vw-base))), 18px);
  --text-card-price:     clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --text-card-price-sub: clamp(10px, calc(18px * (var(--max-vw) / var(--vw-base))), 18px);
  /* The price line's WEIGHT changes between the two frames and the size does
     not follow it: desktop 3080:13491 is Onest Medium at 20px, mobile
     3080:14033 is Onest SemiBold at 16px. It shipped as a flat 500 and the
     mobile card read a little light. A token rather than a second rule, because
     it is one value with two band values — the same shape as --weight-btn.
     Switched at 1024, also like --weight-btn: below that the card's price runs
     14-20px and wants the heavier cut, and putting the change at 768 instead
     would render the mobile frame's own 16px at 500, which is the combination
     that was just rejected. */
  --weight-card-price:   500;
  --text-chip:           clamp(6px, calc(12px * (var(--max-vw) / var(--vw-base))), 12px);
}

@media (max-width: 767px) {
  .ragazzi-cards {
      --lh-card-desc:        1.2;
      --lh-chip:             1.1;
      --size-media-h:        clamp(296.11px, calc(347px + (var(--max-vw) - 375px) * 0.015), 709.73px);
      --sp-card-chip-gap:      clamp(4.27px, calc(5px + (var(--max-vw) - 375px) * 0.015), 10.23px);
      --sp-card-info-gap:      clamp(8.53px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20.45px);
      --sp-card-info-pt:       clamp(8.53px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20.45px);
      --sp-card-media-pad:     clamp(7.78px, calc(9.12px + (var(--max-vw) - 375px) * 0.015), 18.65px);
      --sp-chip-pad-x:       clamp(4.27px, calc(5px + (var(--max-vw) - 375px) * 0.015), 10.23px);
      --sp-chip-pad-y:       clamp(1.71px, calc(2px + (var(--max-vw) - 375px) * 0.015), 4.09px);
      --text-card-desc:      clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);
      --text-card-price:     clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
      --text-card-price-sub: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 29px);
      --weight-card-price:   600;
      --text-chip:           clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ragazzi-cards {
      --lh-card-desc:        1.15;
      --lh-chip:             1.15;
      --size-media-h:        clamp(347px, calc(347px + (var(--max-vw) - 768px) * 0.025), 547px);
      --sp-card-chip-gap:      clamp(5px, calc(5px + (var(--max-vw) - 768px) * 0.025), 10px);
      --sp-card-info-gap:      clamp(10px, calc(10px + (var(--max-vw) - 768px) * 0.025), 20px);
      --sp-card-info-pt:       clamp(10px, calc(10px + (var(--max-vw) - 768px) * 0.025), 20px);
      --sp-card-media-pad:     clamp(9.12px, calc(9.12px + (var(--max-vw) - 768px) * 0.025), 12.7px);
      --sp-chip-pad-x:       clamp(5px, calc(5px + (var(--max-vw) - 768px) * 0.025), 5px);
      --sp-chip-pad-y:       clamp(2px, calc(2px + (var(--max-vw) - 768px) * 0.025), 5px);
      --text-card-desc:      clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 18px);
      --text-card-price:     clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 20px);
      --text-card-price-sub: clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 18px);
      --weight-card-price:   600;
      --text-chip:           clamp(10px, calc(10px + (var(--max-vw) - 768px) * 0.025), 12px);
  }
}

/* ---------------- Product card ----------------
   Height is NOT hardcoded: media height + info content reproduce Figma's
   737 / 481 exactly (547 + 190 · 347 + 134), and letting it flow means a longer
   wrap can never be clipped. */
.ragazzi-cards .product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: var(--radius-none);
  color: var(--color-black);
}

/* The cards live inside a scroll container, and `overflow-x: auto` forces
   `overflow-y` to compute to `auto` as well — so the container CLIPS an outset
   focus ring. Drawn INSIDE the card it cannot be clipped, and the card's own
   light surfaces give the black ring its contrast, so the white halo is not
   needed here. */
.ragazzi-cards .product-card:focus-visible {
  outline-offset: -3px;
  box-shadow: none;
}

/* Figma's media box is a VERTICAL auto-layout whose single child hugs its own
   content. Built as a plain block, `align-self` on the chip row has nothing to
   act on and the row stretches the full card width (measured 386 against
   Figma's 159). The node's own mechanism is the fix.

   PORT: `position: relative` + `overflow: hidden` are ours. The static paints
   the photograph as a background-image with a per-card crop; here it is a real
   <img> underneath (see below), and this is the box that holds and clips it. */
.ragazzi-cards .product-card__media {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: var(--size-media-h);
  padding: var(--sp-card-media-pad);
  background-repeat: no-repeat;
  border-radius: var(--radius-none);
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

/* PORT: replaces the static's four `.product-card--N .product-card__media`
   background rules. Those carried a hand-tuned crop per photograph
   (`background-size: 122.81% 114.99%` and friends) — values that belong to four
   specific files and mean nothing for whatever a merchant uploads. `cover` plus
   the image's OWN focal point is the same intent expressed in data the merchant
   controls; the card snippet passes the focal point in. A background-image also
   cannot carry a srcset, and responsive product images are not something to give
   up for a crop. */
.ragazzi-cards .product-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--card-image-position, 50% 50%);
}

/* The chip row is a CHILD of the media box in normal flow — the media box's
   padding is what insets it. Building it as position:absolute would break the
   9.12 / 12.7 inset relationship at fluid sizes (brief §5).
   HUG, not stretch: in Figma every one of these boxes sizes to its own content
   while a block-level DOM element would fill the card.
   `position: relative` only so the row paints above the photo. */
.ragazzi-cards .product-card__tags {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: flex-start;
  column-gap: var(--sp-card-chip-gap);
  position: relative;
}

.ragazzi-cards .product-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-chip-pad-y) var(--sp-chip-pad-x);
  background: var(--color-black);
  color: var(--color-white);
  border-radius: var(--radius-none);
  font-family: var(--font-body);
  font-size: var(--text-chip);
  font-weight: 500;
  line-height: var(--lh-chip);
  white-space: nowrap;
}

.ragazzi-cards .product-card__info {
  display: flex;
  flex-direction: column;
  row-gap: var(--sp-card-info-gap);
  padding-top: var(--sp-card-info-pt);
}

.ragazzi-cards .product-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: var(--sp-card-info-gap);
}

.ragazzi-cards .product-card__title {
  font-family: var(--font-body);
  font-size: var(--text-card-title);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--color-black);
}

.ragazzi-cards .product-card__desc {
  /* FILL in Figma (410.16 desktop / 260 mobile) — the card's width IS the wrap
     constraint that produces the 2-line / 3-line block. */
  align-self: stretch;
  font-family: var(--font-body);
  font-size: var(--text-card-desc);
  font-weight: 400;
  line-height: var(--lh-card-desc);
  color: var(--color-text-muted);
}

/* Mobile: the price block HUGs (121 wide). Desktop: Figma's own Container is
   410, i.e. full card width — restored in the desktop block below. */
.ragazzi-cards .product-card__price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  row-gap: 0;
}

.ragazzi-cards .product-card__price-main {
  font-family: var(--font-body);
  font-size: var(--text-card-price);
  font-weight: var(--weight-card-price);
  line-height: var(--lh-tight);
  color: var(--color-black);
}

.ragazzi-cards .product-card__price-sub {
  font-family: var(--font-body);
  font-size: var(--text-card-price-sub);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--color-text-muted);
}

/* PORT: not in Figma. A discounted product with only its new price shown is a
   commerce problem, not a design decision — the compare-at price rides quietly
   next to the current one, in the sub-line's own type. */
.ragazzi-cards .product-card__price-was {
  margin-left: 0.5em;
  font-size: var(--text-card-price-sub);
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

/* ============================================================
   DESKTOP (1024+)

   The h2's `max-width` deliberately stays on 1024 even though the tablet band
   gets the same cell ("hard break, max-width 794.92"): what that describes is a
   SHAPE — two lines broken after "belong" — and the <br> is the mechanism that
   produces it, the cap being inert whenever the longest line fits. Adding the
   cap at 768 does not deliver it: --size-h2-max interpolates to 335–341px there,
   NARROWER than the 715px the mobile band gives the same heading at 767, so the
   heading renders on THREE lines. Measured at 768: capped 3 lines / uncapped 2.
============================================================ */
@media (min-width: 1024px) {

  .ragazzi-cards .product-card__info {
    padding-top: var(--sp-card-info-pt);
    padding-bottom: var(--sp-card-info-pt);
  }

  /* Desktop price Container 3080:13491 is 410 wide (FILL), unlike mobile's 121. */
  .ragazzi-cards .product-card__price {
    align-self: stretch;
  }

  /* The two chips carry DIFFERENT weights in Figma, consistently across all four
     cards — per-chip design, recorded literally (brief §5). */
  .ragazzi-cards .product-card__tag:nth-child(1) { font-weight: 400; }
  .ragazzi-cards .product-card__tag:nth-child(2) { font-weight: 500; }
}


/* ============================================================================
   HOVER — ADDED, not in Figma.

   The design has no hover state anywhere on this page, so this is a decision,
   not a carry. It is written in the vocabulary the rest of the page already
   uses rather than a generic card hover: this section has NO shadows and NO
   radii on any node, so the usual lift-and-round would introduce two properties
   the design deliberately does not have. What it does have is photography and
   an underline — the header uses exactly that underline, at the same offset,
   to mark the current page — so the hover is those two and nothing else.

   `:focus-visible` gets the same treatment on purpose: a keyboard user should
   see the card respond the way a pointer user does, and the ring alone does not
   say "this is one link".

   `@media (hover: hover)` guards the zoom because a touch device keeps `:hover`
   stuck on the last card tapped; the underline is safe either way and is left
   outside the guard.
============================================================================ */
.ragazzi-cards .product-card__image {
  transition: transform 400ms ease;
}

@media (hover: hover) {
  .ragazzi-cards .product-card:hover .product-card__image {
    /* Small on purpose. The photo is already cropped to the plate, so anything
       larger starts cutting the product itself out of frame. */
    transform: scale(1.04);
  }
}


.ragazzi-cards .product-card:focus-visible .product-card__image {
  transform: scale(1.04);
}

.ragazzi-cards .product-card:hover .product-card__title,
.ragazzi-cards .product-card:focus-visible .product-card__title {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

@media (prefers-reduced-motion: reduce) {
  .ragazzi-cards .product-card__image {
    transition: none;
  }

  .ragazzi-cards .product-card:hover .product-card__image,
  .ragazzi-cards .product-card:focus-visible .product-card__image {
    transform: none;
  }
}


/* 5. The whole card is one `<a>`, and outside our own sections this theme does
      not carry the static's global `a { text-decoration: none }` — so the
      browser underlined the title, the description and the price. Seen in a
      screenshot, not in a measurement: `text-decoration` has no geometry. */
.ragazzi-cards .product-card {
  text-decoration: none;
}
