/* Carat & Grace — collection, refine drawer, pager. Geometry from Figma 8:44 / 8:686. */

/* ---------------------------------------------------------------- banner */
.cg-cbanner { border-bottom: 1px solid var(--cg-line); background: var(--cg-porcelain); }
.cg-cbanner__in { display: flex; align-items: center; justify-content: center; gap: 36px; max-width: var(--cg-max); margin-inline: auto; padding: 19px var(--cg-gutter); }
.cg-cbanner__t { color: var(--cg-text-2); }
.cg-cbanner__a { display: flex; align-items: center; gap: 24px; }
.cg-cbanner__sms { display: inline-flex; align-items: center; gap: 8px; color: var(--cg-text-2); }
.cg-cbanner__sms:hover { color: var(--cg-rose); }
@media (max-width: 1023px) {
  .cg-cbanner__in { flex-direction: column; gap: 10px; padding: 14px var(--cg-gutter); text-align: center; }
  .cg-cbanner__a { gap: 18px; }
}

/* ---------------------------------------------------------------- header */
.cg-chead { padding-block: 88px 0; }
.cg-chead__in { display: grid; grid-template-columns: 704fr 560fr; gap: 64px; align-items: center; }
.cg-chead__c { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cg-chead__h { max-width: 14ch; }
.cg-chead__t { max-width: 704px; }
.cg-chead__m { aspect-ratio: 560 / 400; }
.cg-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.cg-stats li { display: flex; flex-direction: column; gap: 6px; }
.cg-stats strong { font-family: var(--cg-display); font-weight: 400; font-size: 32px; line-height: 1; }
.cg-stats em { font-style: normal; font-size: 13px; letter-spacing: .02em; color: var(--cg-text-2); }
.cg-crumb { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-crumb a:hover { color: var(--cg-rose); }
@media (max-width: 1023px) {
  .cg-chead { padding-block: 44px 0; }
  .cg-chead__in { grid-template-columns: 1fr; gap: 28px; }
  .cg-chead__m { order: -1; aspect-ratio: 16 / 10; }
}
@media (max-width: 767px) {
  .cg-stats { gap: 20px; }
  .cg-stats strong { font-size: 24px; }
}

/* ---------------------------------------------------------------- shape filter */
.cg-shapes { padding-block: 44px 0; }
.cg-shapes__h { margin-bottom: 18px; }
.cg-shapes__g { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 12px; }
.cg-stile--all { justify-content: center; }
@media (max-width: 1279px) { .cg-shapes__g { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .cg-shapes__g { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .cg-shapes__g::-webkit-scrollbar { display: none; }
  .cg-shapes__g > * { flex: 0 0 auto; padding-inline: 14px; }
}

/* ---------------------------------------------------------------- toolbar */
.cg-ctool { padding-block: 24px; }
.cg-ctool__in { display: flex; align-items: center; gap: 20px; }
.cg-ctool__chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.cg-ctool__n { margin-left: auto; white-space: nowrap; }
.cg-sort { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.cg-sort select {
  appearance: none; border: 0; background: none; padding-right: 4px;
  font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
@media (max-width: 767px) {
  .cg-ctool__in { gap: 12px; }
  /* the count after filtering stays on phones too — its own line under the toolbar (user, 2026-10-22) */
  .cg-ctool__in { flex-wrap: wrap; }
  .cg-ctool__n { order: 9; flex: 1 1 100%; margin-left: 0; }
  .cg-sort select { max-width: 130px; }
}

/* ---------------------------------------------------------------- grid + promo */
.cg-cgrid { padding-bottom: 96px; }
.cg-promo { display: flex; flex-direction: column; height: 100%; background: var(--cg-porcelain); }
.cg-promo__m { aspect-ratio: 314 / 260; }
.cg-promo__b { display: flex; flex-direction: column; gap: 10px; padding: 28px 32px 32px; }
.cg-promo__b strong { font-weight: 400; }
.cg-cgrid__more { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 56px; }
.cg-cgrid__bar { display: block; width: 260px; height: 2px; background: var(--cg-line); }
.cg-cgrid__bar i { display: block; height: 100%; background: var(--cg-rose); }

/* ---------------------------------------------------------------- pager */
.cg-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 40px; }
.cg-pager__a, .cg-pager__n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding-inline: 10px; border: 1px solid transparent; font-size: 13px;
}
.cg-pager__a { border-color: var(--cg-line); }
.cg-pager__a:hover { border-color: var(--cg-line-strong); }
.cg-pager__a.is-off { opacity: .3; }
.cg-pager__n:hover { border-color: var(--cg-line); }
.cg-pager__n.is-on { border-color: var(--cg-line-strong); font-weight: 500; }
.cg-pager__e { padding-inline: 4px; color: var(--cg-text-2); }

/* ---------------------------------------------------------------- refine drawer */
.cg-dw--refine { width: min(440px, 100vw); }
.cg-ref { display: flex; flex-direction: column; }
.cg-ref__g { border: 0; margin: 0; padding: 24px; border-bottom: 1px solid var(--cg-line); }
.cg-ref__h { padding: 0 0 18px; font-family: var(--cg-display); font-size: 20px; }
.cg-ref__o { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; cursor: pointer; }
.cg-ref__o { color: var(--cg-text); text-decoration: none; }
.cg-ref__o:hover span { text-decoration: underline; text-underline-offset: 3px; }
.cg-ref__box {
  display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px;
  border: 1px solid var(--cg-line-strong); background: var(--cg-white); color: var(--cg-accent);
}
.cg-ref__o.is-on .cg-ref__box { border-color: var(--cg-accent); background: var(--cg-blush); }
.cg-ref__o.is-on span { font-weight: 500; }
.cg-ref__m.is-on { border-color: var(--cg-accent); background: var(--cg-blush); }
.cg-ref__m { color: var(--cg-text); text-decoration: none; }
.cg-ref__metals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cg-ref__m { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--cg-line); cursor: pointer; font-size: 14px; }
.cg-ref__m:has(input:checked) { border-color: var(--cg-line-strong); background: var(--cg-white); }
.cg-ref__price { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-ref__price input { width: 100%; height: 44px; padding-inline: 14px; border: 1px solid var(--cg-line); background: var(--cg-white); font-size: 14px; }
.cg-ref__foot { display: flex; gap: 12px; margin-top: auto; }
.cg-ref__foot > * { flex: 1 1 0; }

/* ---------------------------------------------------------------- FAQ */
.cg-faq__head { text-align: center; margin-bottom: 40px; }
.cg-faq__head .cg-eyebrow { margin-bottom: 20px; }
.cg-faq__qs { max-width: 860px; margin-inline: auto; }
/* FIX3 (user, 2026-11-16: "remove this line"): the rule above the first row and the one under the last
   row were loose lines with nothing on the other side of them. Only the dividers BETWEEN rows stay. */
.cg-acc { border-bottom: 1px solid var(--cg-line); }
.cg-acc:last-child { border-bottom: 0; }
.cg-acc__h { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 65px; padding: 16px 0; text-align: left; font-size: 15px; }
.cg-acc__h svg { flex: 0 0 auto; transition: transform .25s ease; }
.cg-acc__h[aria-expanded='true'] svg { transform: rotate(45deg); }
.cg-acc__in { padding-bottom: 22px; max-width: 70ch; color: var(--cg-text-2); }
.cg-acc__in p { margin: 0 0 10px; }
.cg-acc__in p:last-child { margin-bottom: 0; }

.cg-collist .cg-tile__b { text-align: left; }

/* ---------------------------------------------------------------- listing filters (cng-lf.js, collection-filters-rules.md) */
/* the shape tile row and the toolbar sort are the desktop controls; ≤ 1024px both live in the drawer */
@media (max-width: 1024px) { .cg-lf-wide { display: none !important; } }
.cg-stile.is-dis { opacity: .4; pointer-events: none; }
.cg-ref__o, .cg-ref__m { font: inherit; font-size: 14px; text-align: left; background: none; }
.cg-ref__o { border: 0; width: 100%; }
.cg-ref__m { background: var(--cg-white); }
.cg-ref__o em, .cg-ref__m em { margin-left: auto; font-style: normal; }
.cg-ref__o.is-dis { opacity: .4; cursor: default; }
.cg-ref__o.is-dis:hover span { text-decoration: none; }
.cg-lf-wait { padding: 24px; }
.cg-lf-note { margin-top: 12px; }
.cg-lf-price__v { margin: -6px 0 14px; }
.cg-lf-rail { position: relative; height: 28px; margin: 0 9px 14px; }
.cg-lf-rail::before, .cg-lf-rail__f { content: ''; position: absolute; top: 13px; height: 2px; }
.cg-lf-rail::before { left: 0; right: 0; background: var(--cg-line); }
.cg-lf-rail__f { left: var(--a, 0%); right: var(--b, 0%); background: var(--cg-accent); }
.cg-lf-rail input[type=range] {
  position: absolute; inset: 0 -9px; width: calc(100% + 18px); height: 28px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.cg-lf-rail input[type=range]::-webkit-slider-runnable-track { background: none; height: 28px; }
.cg-lf-rail input[type=range]::-moz-range-track { background: none; }
.cg-lf-rail input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 5px; border-radius: 50%;
  border: 1px solid var(--cg-line-strong); background: var(--cg-white); cursor: grab;
}
.cg-lf-rail input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--cg-line-strong); background: var(--cg-white); cursor: grab;
}
.cg-lf-rail input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--cg-accent); outline-offset: 2px; }
.cg-ref .cg-ref__foot { position: sticky; bottom: 0; flex-wrap: wrap; background: var(--cg-white); }
.cg-lf-nomatch { flex: 1 1 100% !important; margin: 0; color: var(--cg-accent); }
.cg-ref__foot [aria-busy='true'] { opacity: .7; }
.cg-lf-clear { align-self: center; font-size: 13px; background: none; border: 0; cursor: pointer; }
/* the grid while the whole collection loads, and a card whose metal version is still loading */
.cg-grid.is-loading { opacity: .5; pointer-events: none; transition: opacity .2s; }
.cg-card--sk .cg-card__m { display: block; position: relative; overflow: hidden; background: var(--cg-image); }
.cg-card__skl { display: block; position: relative; overflow: hidden; height: 12px; width: 80%; margin: 14px 0 8px; background: var(--cg-line); }
.cg-card__skl--s { width: 40%; }

/* ---- filter shimmer (filter-shimmer.md, Harsh 5 Nov 2026) ---------------------------------
   While the filters or a filtered grid are still loading, skeleton blocks stand in their place
   and are swept by the theme's OWN .cg-shimmer (cng-base.css: a 1.1s sheen that is already
   silenced under prefers-reduced-motion, so this needs no second animation and no extra
   reduced-motion rule). Nothing new is invented: the same tint (--cg-line), the same card box
   (.cg-media--4x5) and the same .cg-grid, so the real cards land exactly where the skeletons
   were and nothing jumps. */
.cg-skf { padding: 18px 20px; }
.cg-skf__g { padding: 16px 0; border-bottom: 1px solid var(--cg-line); }
.cg-skf__g:last-child { border-bottom: 0; }
.cg-skb { display: block; position: relative; overflow: hidden; background: var(--cg-line); }
.cg-skf__h { width: 42%; height: 15px; margin-bottom: 14px; }
.cg-skf__r { height: 34px; margin-top: 8px; }
.cg-skf__r--a { width: 100%; }
.cg-skf__r--b { width: 86%; }
.cg-skf__r--c { width: 64%; }
/* the skeleton grid is a real .cg-grid, so it inherits the live column counts and gaps */
.cg-skgrid { pointer-events: none; }

/* ---------------------------------------------------------------- filters open beside the grid (desktop, user 2026-10-22)
   The sidebar takes the first column and stays in view while the grid scrolls; every other part of the listing
   (grid, "Showing", pager, empty message) is the second column. ≤ 1024px: no sidebar, the Refine drawer as before. */
.cg-lf-side { display: none; }
@media (min-width: 1025px) {
  .cg-lf-wrap { display: grid; grid-template-columns: 248px minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .cg-lf-wrap > * { grid-column: 2; }
  .cg-lf-wrap > .cg-lf-side {
    display: block; grid-column: 1; grid-row: 1 / span 12; position: sticky; top: 24px;
    max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    border: 1px solid var(--cg-line); background: var(--cg-white);
  }
  .cg-lf-side .cg-ref__t { padding: 18px 20px 0; font-family: var(--cg-display); font-size: 22px; }
  .cg-lf-side .cg-ref__g { padding: 18px 20px; }
  .cg-lf-side .cg-ref__g:last-child { border-bottom: 0; }
  .cg-lf-side .cg-ref__h { font-size: 17px; padding-bottom: 12px; }
  .cg-lf-side .cg-ref__metals { grid-template-columns: 1fr; gap: 6px; }
  .cg-lf-side .cg-ref__m { min-height: 40px; font-size: 13px; }
  .cg-lf-side .cg-ref__price { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cg-lf-side .cg-ref__price input { height: 40px; padding-inline: 10px; font-size: 13px; }
  .cg-lf-side .cg-lf-wait { padding: 20px; }
  .cg-lf-side__foot { padding: 0 20px 20px; }
  /* the filters are already open: the Refine button would only open the same thing again */
  .cg-ctool__ref { display: none; }
  /* the grid gives a column to the sidebar */
  .cg-lf-wrap .cg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1440px) { .cg-lf-wrap .cg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* the filtered count: the number in the text colour, the rest muted */
.cg-ctool__n strong, .cg-lf-side__n strong { font-weight: 600; color: var(--cg-text); }
.cg-lf-side__n { padding: 4px 20px 0; color: var(--cg-text-2); }

/* ---------------------------------------------------------------- collection description: buying guide + FAQ
   snippets/cng-col-desc.liquid (collection-description-rule.md, 2026-10-23). Intro reuses .cg-chead__t. */
.cg-cd-intro p { margin: 0 0 10px; }
.cg-cd-intro p:last-child { margin-bottom: 0; }
.cg-cd { border-top: 1px solid var(--cg-line); padding-block: 104px; }
.cg-cd__in { display: flex; flex-direction: column; gap: 96px; }
.cg-cd__two { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 64px; align-items: start; }
.cg-cd__toc { position: sticky; top: calc(var(--cg-header-sticky-h) + 24px); display: flex; flex-direction: column; gap: 14px; }
.cg-cd__toc .cg-eyebrow { margin: 0; }
.cg-cd__big { margin: 0; }
.cg-cd__ol { list-style: lower-roman; margin: 10px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.cg-cd__ol a { border-bottom: 1px solid var(--cg-line); transition: border-color .18s ease; }
.cg-cd__ol a:hover, .cg-cd__ol a:focus-visible { border-color: var(--cg-rose); }
.cg-cd__art { min-width: 0; }
.cg-cd-s { border-top: 1px solid var(--cg-line); padding-block: 28px; }
.cg-cd-s:first-child { border-top: 0; padding-top: 0; }
.cg-cd-s h2 { margin: 0 0 14px; scroll-margin-top: calc(var(--cg-header-sticky-h) + 24px); }
.cg-cd-tx { color: var(--cg-text-2); max-width: 70ch; }
.cg-cd-tx > :first-child { margin-top: 0; }
.cg-cd-tx > :last-child { margin-bottom: 0; }
.cg-cd__qs { list-style: none; margin: 0; padding: 0; min-width: 0; }
@media (max-width: 900px) {
  .cg-cd { padding-block: 72px; }
  .cg-cd__in { gap: 64px; }
  .cg-cd__two { grid-template-columns: 1fr; gap: 24px; }
  .cg-cd__toc { position: static; }
}

/* "See N pieces" (user, 2026-10-24): every filter choice waits for the button; the sidebar's foot stays in view at the
   bottom of the sticky column, and the grid dims while a choice is waiting */
@media (min-width: 1025px) {
  .cg-lf-side__foot { position: sticky; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--cg-line); background: var(--cg-white); }
  .cg-lf-side__clear { align-self: center; font-size: 13px; }
  .cg-lf-side .cg-lf-nomatch { margin: 0; color: var(--cg-sale); }
}
.cg-grid { transition: opacity .2s ease; }
.cg-grid.cg-lf-pending { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .cg-grid { transition: none; } }

/* the filter sidebar sticks just below the sticky header (2026-10-26), not under it */
@media (min-width: 1025px) {
  .cg-lf-wrap > .cg-lf-side { top: calc(var(--cg-header-sticky-h) + 16px); max-height: calc(100vh - var(--cg-header-sticky-h) - 32px); }
}

/* page numbers on phones (2026-10-26 audit: the search results' row spilled 52px at 320px): they wrap to a second line
   and the boxes narrow, so the row is never wider than the screen */
@media (max-width: 767px) {
  .cg-pager { flex-wrap: wrap; row-gap: 8px; gap: 4px; padding-inline: 4px; }
  .cg-pager__a, .cg-pager__n { min-width: 36px; padding-inline: 6px; }
}
