/* Carat & Grace — touch targets, and the theme's last-loaded responsive layer.
   Loaded LAST on purpose; see tools/cng/parts/touch.mjs. */
/* Up to 1024, not 767: a tablet is a touch screen too, and the 768 column of the responsive sweep
   had 116 controls under 24px for exactly that reason. 1023 was one pixel short — the 3 Nov sweep
   found that at exactly 1024 (iPad landscape) NOTHING here applied, so the header icons were 24x24,
   the card heart 36x36 and every small chip 36px tall. Only hit areas grow here, never a size that
   is drawn, so the layout at 768 is unchanged; at 1024 the card heart goes 36 -> 44px, which is the
   point of treating 1024 as a tablet. */
@media (max-width: 1024px) {
  .cg-ib,
  .cg-arrow { min-width: 44px; min-height: 44px; }

  .cg-card__w { width: 44px; height: 44px; }

  /* the slideshow dots are drawn 7px; the hit area is padded out around them */
  .cg-hero__dot { position: relative; }
  .cg-hero__dot::after { content: ''; position: absolute; inset: -19px; }   /* 7 + 19x2 = 45 */

  .cg-chip,
  .cg-stile,
  .cg-qty__b,
  .cg-mmenu__tab { min-height: 44px; }

  .cg-link,
  .cg-pop__no,
  .cg-line__x,
  .cg-sort select { min-height: 44px; display: inline-flex; align-items: center; }

  /* The card's metal dots are drawn 16px (the design's own size) and they are now real controls —
     a click swaps the card. The dot keeps its size; the tappable square around it is 44px. */
  /* the footer's social icons are 18px marks; same trick, the mark keeps its size */
  .cg-social a { position: relative; display: inline-flex; }
  .cg-social a::after { content: ''; position: absolute; inset: -13px; }

  .cg-mt { position: relative; }
  .cg-mt::after { content: ''; position: absolute; inset: -14px; }
  /* and they need room not to overlap each other once their hit areas are that big */
  .cg-card__mt { gap: 14px; }

  /* the builder's own controls, measured at 375 */
  .cg-ref__o,
  .cg-ref__m,
  .cg-dd__t,
  .cg-rb__sum a,
  .cg-pager__a { min-height: 44px; display: inline-flex; align-items: center; }
  .cg-dcard,
  .cg-drow { cursor: pointer; }
  .cg-drow { min-height: 64px; }

  /* footer links sit in a dense list; 36px keeps them reachable without stretching the column */
  .cg-foot__col a,
  .cg-foot__legal a { min-height: 36px; display: inline-flex; align-items: center; }
}

/* ------------------------------------------------------------------ responsive pass, 3 Nov 2026
   responsive-all-views-check.md — 40 pages swept at 360 / 375 / 414 / 768 / 1024 / 1280 / 1366 /
   1440 / 1920. Nothing below changes a colour, a font family or the desktop layout; each block
   names the finding it closes and the width it was measured at. */

/* R-1  The floating back-to-top was left stacked above a button that is no longer there.
   `.cg-top-btn` sits at 76px (78 on a phone, 142 on a phone PDP above the sticky buy bar) only to
   clear the "Call now" pill beneath it — and CONTACT-HIDE (3 Nov) commented that pill out, so the
   button now floats with an empty slot under it. It drops into the pill's place. When the real
   number arrives and the pill comes back, delete this block with it.
   cng-product.css:124 puts it at 142px at every width up to 767 — not only on a product page — so
   that override has to be answered here too. The sticky buy bar is not a sibling of the button
   (the button is a direct child of body), so the PDP case is matched with :has(), which this theme
   already uses for the drawers (cng-chrome.css:367). */
.cg-top-btn { bottom: 20px; }
@media (max-width: 767px) {
  .cg-top-btn { bottom: 20px; }
  /* clear of the sticky buy bar on a PDP. 84px was measured against a bar that never showed;
     once it did (3 Nov, Harsh), the bar turned out to be 92px tall and the button sat inside it.
     cng.js publishes the bar's real height as --cg-stick-h on every scroll, so a title that
     wraps to two lines moves the button too; the 92px fallback is the measured one-line case. */
  html:has(.cg-stick.is-on) .cg-top-btn { bottom: calc(var(--cg-stick-h, 92px) + 20px); }
}

/* R-2  Controls under 44px that the touch block above does not reach.
   Measured: `.cg-qty__b` 42x52 on every PDP at 360-1024; `.cg-chip--sm` 42-43px wide in the ring
   builder; `.cg-bigsearch .cg-btn` 104x40 on /search and 404 (cng-pages.css:22 shrinks it to 40);
   `.cg-select` 155x38 and 207x38 in the builder's filters. Only the hit box grows. */
@media (max-width: 1024px) {
  .cg-qty__b,
  .cg-chip { min-width: 44px; }
  .cg-bigsearch .cg-btn { min-height: 44px; }
  .cg-select { min-height: 44px; }
}

/* R-3  Type under 11px on a phone (§3 asks for at least 11px for a label).
   `.cg-caption` is drawn at 10px (cng-base.css:55) and appears on every page — the footer's payment
   row alone is 996 of the hits — with three places overriding it smaller still. Phone widths only,
   so the tablet and desktop drawing is untouched. */
@media (max-width: 767px) {
  .cg-caption,
  .cg-mmenu__shapes .cg-caption,
  .cg-rb__shapes .cg-caption,
  .cg-rb__f > .cg-rb__range > .cg-caption { font-size: 11px; }
}

/* R-4  The primary nav touches both screen edges at 768.
   Measured at 768: the six items need exactly 753px in a 753px row, so the first starts at x=0 and
   the last ends flush right, while every other band on the page keeps a gutter — and a hair
   narrower would overflow. Tablet only; the desktop row (40px gap, centred) is unchanged. */
@media (min-width: 768px) and (max-width: 1023px) {
  .cg-nav__list { gap: 20px; padding-inline: var(--cg-gutter); }
}

/* R-5  iOS zooms the whole page when a focused field is under 16px (§3 check 10).
   Measured on the contact form at 360-768: name / email / phone / message at 14px and the footer
   newsletter at 13px, so tapping any of them jumps the layout. Up to 1024, like the touch block
   above: an iPad zooms on focus for exactly the same reason, and the after-run still failed at 768
   while this stopped at 767. Only the text inside a field grows, 14/13px -> 16px. */
@media (max-width: 1024px) {
  .cg-select,
  .cg-field,
  .cg-sub__i,
  .cg-qty__i,
  .localization__select,
  textarea { font-size: 16px; }
}

/* R-6  At 320px the footer's email address is the one thing that will not fit.
   Walking the width from 320 to 1920 (§1, last line) flagged exactly one element at exactly one
   width: `support@caratandgrace.com` in the footer's Contact column — 156px of unbreakable text in
   a column 6px too narrow. It is also the one way left to reach the brand while the phone number is
   hidden, so it must not run off the screen.
   It has to be `anywhere`, not `break-word`: the touch block above makes these links `inline-flex`,
   so the text is an anonymous flex item whose minimum size is its min-content width — and
   `break-word` does not reduce min-content, while `anywhere` does. Measured at 320: the link stayed
   156px wide with `break-word` and still hung 6px off the edge. Both only act when the word cannot
   fit a line of its own, so nothing else in the footer changes.
   Scoped to 359 and below, and that matters: at 360 the column is 154px and the address needs 156,
   so it overhangs its own column by 2px but stays well inside the screen — while `anywhere` there
   broke it as "support@caratandgrace.co / m", which looks broken for no gain. The after
   screenshot at 360 is what showed that; the rule now applies only where the text would otherwise
   leave the viewport. 359px is a breakpoint this theme already uses. */
@media (max-width: 359px) {
  .cg-foot__col a,
  .cg-foot__tag { overflow-wrap: anywhere; max-width: 100%; }
}

/* R-7  Two leftovers the after-sweep caught, each beaten by a more specific rule.
   a) the ring builder's colour / clarity range controls stayed 38px at 768 and 1024: the plain
      `.cg-select { min-height: 44px }` above loses to
      `.cg-rb__f .cg-rb__rin .cg-select` (cng-builder.css, min-width: 768px), which sets both
      min-height and height to 38px. Matched at the same specificity here, inputs included so the
      two halves of a range still line up.
   b) four labels that are drawn small but are NOT `.cg-caption`, so the 11px rule above missed
      them: `.cg-price-save` (base.css:124),
      `.cg-hero__eb` (home.css:332, 10px on a phone) and `.cg-ph__sub` (base.css:159, 9px). */
@media (min-width: 768px) and (max-width: 1024px) {
  .cg-rb__f .cg-rb__rin input,
  .cg-rb__f .cg-rb__rin .cg-select,
  .cg-rb__adv .cg-rb__rin .cg-select { min-height: 44px; height: 44px; }
}
@media (max-width: 767px) {
  .cg-price-save,
  .cg-hero__eb,
  .cg-ph__sub { font-size: 11px; }
}
