/* Catalog module additions on top of site.css + pages.css (same tokens, same class names). */

/* Size chips are checkbox labels in the GET filter form */
label.size-chip { display: grid; place-items: center; cursor: pointer; user-select: none; }
label.size-chip:has(input:checked) { background: var(--surface-ink); border-color: var(--surface-ink); color: var(--text-on-ink); }
label.size-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.facet .is-zero { color: var(--text-tertiary); }
.facet label.size-chip.is-zero { opacity: .45; }
.facet .price-range { margin-top: 4px; }

/* Applied filter chips are links (server-rendered) */
.applied a.chip { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.applied a.chip .i { width: 14px; height: 14px; }
.applied .clear { min-height: 32px; text-decoration: none; }

.pager .i.flip { transform: rotate(180deg); }
.empty a.text-btn { margin-left: 6px; }

/* Intro paragraphs keep the lede layout of the prototype */
.cat-intro .more-text p + p { margin-top: 8px; }

/* Specifications + wholesale terms, two columns on desktop (925SJ / ELF925 spec tables, Sidney terms strip) */
.cat-facts { border-top: 1px solid var(--border); }
.cat-specs { display: grid; gap: 36px; }
.cat-specs .h2 { margin-bottom: 14px; }
.cat-specs .ph-tag { margin-bottom: 8px; display: inline-block; }
.cterms-more { margin-top: 12px; }
@media (min-width: 1024px) { .cat-specs { grid-template-columns: 1fr 1fr; gap: 48px; } }
.cfaq-link { margin-top: 8px; }

/* Buying guide below the grid */
.seo .prose h2 { font: 700 20px/1.25 var(--font-display); letter-spacing: -.01em; margin-bottom: 12px; color: var(--text); }
.seo .prose h3 { font: 600 16px/1.3 var(--font-display); margin: 20px 0 8px; color: var(--text); }
.seo .prose ul { list-style: disc; padding-left: 20px; margin-top: 10px; }
.seo .prose li + li { margin-top: 6px; }
.seo .prose { font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }

/* Product page */
.matrix a.notify { font-size: 13px; color: var(--accent); text-underline-offset: 3px; white-space: nowrap; }
.matrix tbody[hidden] { display: none; }
/* Back-in-stock form on sold-out rows: a disclosure whose panel floats under the cell */
.notify-d { position: relative; display: inline-block; text-align: left; }
.notify-d > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: flex-end; min-height: 40px; white-space: nowrap; }
.notify-d > summary::-webkit-details-marker { display: none; }
.notify-d > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s; }
.notify-d[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.notify-form { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 320px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); font-size: 13.5px; }
.notify-form .notify-label { display: block; margin-bottom: 8px; color: var(--text-secondary); line-height: 1.4; white-space: normal; }
.notify-form .notify-label b { color: var(--text); }
.notify-row { display: flex; gap: 8px; }
.notify-row .input { min-height: 40px; padding: 8px 10px; font-size: 14px; flex: 1; min-width: 0; }
.notify-row .btn { min-height: 40px; flex: none; }
.notify-err { margin-top: 8px; color: var(--error); font-size: 13px; }
.notify-note { margin-top: 8px; color: var(--text-tertiary); font-size: 12px; line-height: 1.4; white-space: normal; }
.notify-ok { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--success); white-space: nowrap; }
.notify-ok svg { width: 16px; height: 16px; }
.page-product .hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 599px) {
  .notify-form { width: min(320px, calc(100vw - 32px)); }
  .notify-row .input, .notify-row .btn { min-height: 44px; }
}
.add-err { padding: 10px 12px; border-radius: var(--r-md); background: var(--danger-soft, #fdecec); color: var(--danger, #b42318); font-size: 13.5px; }
.fulfil a.link { white-space: nowrap; }
[aria-busy="true"] { cursor: progress; }
@media (max-width: 899px) { .cat-count .cf-opt { display: none; } }
/* Phones: plating tabs share one row, stock count under the name */
@media (max-width: 639px) {
  .plating-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
  .plating-tabs .chip { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; row-gap: 1px; padding: 6px 10px; border-radius: var(--r-md); white-space: normal; text-align: left; line-height: 1.2; }
  .plating-tabs .chip small { grid-column: 2; margin: 0; font-size: 11.5px; }
}
/* Hidden bar must not paint below the fold either (full-page captures, tall viewports) */
.sticky-buy:not(.is-on) { visibility: hidden; transition: transform .22s var(--ease), visibility 0s .22s; }

/* Specifications: one column now that the terms block is a single link */
.cat-specs { display: block; }
.cat-specs .spec { max-width: 760px; }
@media (min-width: 1024px) { .cat-specs { display: block; } }

/* Guide tables (stud sizes): stacked rows on phones */
.seo .prose .table-wrap { margin: 14px 0 12px; }
.seo .prose .qtable th[scope="row"] { white-space: nowrap; }
@media (max-width: 599px) {
  .qtable-stack { min-width: 0; }
  .qtable-stack thead { display: none; }
  .qtable-stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
  .qtable-stack tr:last-child { border-bottom: 0; }
  .qtable-stack th, .qtable-stack td { display: block; padding: 0; border: 0; }
  .qtable-stack td { margin-top: 4px; }
  .qtable-stack td:last-child::before { content: "Moissanite: "; color: var(--text-tertiary); }
}

/* Opening display: computed first order (earrings) */
.ods { padding: 20px 24px 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ods > p:first-child { margin: 0; max-width: 72ch; }
.ods-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 16px 0 4px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.ods-stats > div { padding: 12px 14px; background: var(--surface-alt); }
.ods-stats dt { font-size: 12.5px; color: var(--text-tertiary); }
.ods-stats dd { margin-top: 2px; font: 700 20px/1.2 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .ods-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ods-group { margin-top: 20px; }
.ods-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 4px; }
.ods-group h3 span { font: 400 13px/1.4 var(--font-body, inherit); color: var(--text-tertiary); }
.ods-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.ods-t { min-width: 0; }
.ods-t a { color: var(--text); text-decoration: none; }
.ods-t a:hover { color: var(--accent); text-decoration: underline; }
.ods-t .mono { display: block; margin-top: 2px; font-size: 12px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.ods-p { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ods-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.ods-add p { flex: 1 1 240px; margin: 0; }
@media (max-width: 599px) {
  .ods { padding: 16px; }
  .ods-add .btn { width: 100%; }
}

/* Buying guide as blocks: heading left, content right (same grid as the FAQ) */
.gsec { display: grid; gap: 14px; }
.gsec + .gsec { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border-soft); }
.gsec-h .h2 { margin: 0; }
.seo .gsec-b.prose { max-width: none; }
.gsec-b.prose > p, .gsec-b.prose > ul { max-width: 72ch; }
.gsec-b.prose > :first-child { margin-top: 0; }
.seo .gsec-b.prose h3 { margin-top: 28px; }
.gsec-b .table-wrap { margin: 0 0 14px; }
.gsec-b .table-wrap + p { margin-top: 0; }
@media (min-width: 900px) {
  .gsec { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; }
  .gsec + .gsec { margin-top: 56px; padding-top: 56px; }
}
.ods-group h3 { font: 600 16px/1.3 var(--font-display); color: var(--text); }
.ods-lines { list-style: none; margin: 0; padding: 0; }

/* Live guide tables (computed from today's catalog) */
.gsec-b .ltable-wrap { margin: 14px 0 6px; }
.ltable { min-width: 0; }
.ltable th, .ltable td { padding: 11px 14px; }
.ltable td, .ltable td:last-child, .ltable td:nth-child(2) { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.ltable .num { text-align: right; white-space: nowrap; }
.ltable tbody th { font-weight: 600; }
.ltable tbody th a, .ltable td a { color: var(--text); text-decoration: none; }
.ltable tbody th a:hover, .ltable td a:hover { color: var(--accent); text-decoration: underline; }
.ltable-note { margin-top: 6px; }
@media (max-width: 599px) {
  .ltable thead { display: none; }
  .ltable tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
  .ltable tr:last-child { border-bottom: 0; }
  .ltable th, .ltable td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; text-align: left; }
  .ltable tbody th { margin-bottom: 4px; }
  .ltable td { padding-top: 3px; font-size: 13.5px; }
  .ltable td::before { content: attr(data-label); color: var(--text-tertiary); font-weight: 400; }
  .ltable td.num { text-align: right; }
}

/* ===== rv-pdp: product page "About this item" and buy box (round 3) ===== */
.pdp-about { border-top: 1px solid var(--border); }
.pdp-about .gsec-b > .spec { max-width: 760px; }
.pdp-about .gsec-b.acc { max-width: 760px; }
.spec-note { margin-top: 12px; color: var(--text-secondary); line-height: 1.5; }
.tell { position: relative; max-width: 72ch; padding: 16px 16px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.tell p { margin: 0 0 12px; color: var(--text); }
.tell .copy { min-height: 36px; }
.pairs { list-style: none; padding-left: 0; }
.seo .prose .pairs { list-style: none; padding-left: 0; }
.pairs li { padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.run-form { margin: 10px 0 4px; }
.cart-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.cart-hint svg.i { width: 16px; height: 16px; margin-top: 2px; color: var(--success); flex: none; }
.cart-hint b { color: var(--text); font-variant-numeric: tabular-nums; }
.pdp-price .price .from { font-size: 14px; color: var(--text-secondary); }
.pdp-price .price b { white-space: nowrap; } /* "$25.90–$31.20" never breaks at the dash */
@media (max-width: 599px) { .pdp-price .price .from { display: block; } }
@media (max-width: 599px) {
  .tell { padding: 14px; }
  .run-form .btn { width: 100%; }
}

/* lead 2026-10-18: guide blocks never widen the page on phones — grid children may shrink, wide tables scroll inside their own box */
.gsec, .gsec-h, .gsec-b { min-width: 0; }
.gsec-b .table-wrap, .gsec-b .ltable-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 899px) {
  .gsec-b .ltable { width: 100%; table-layout: fixed; }
  .gsec-b .ltable th, .gsec-b .ltable td { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
}
