/* Carat & Grace — PDP. Figma 9:44 (gallery 708 | info 520, gap 64) / 9:669 (mobile). */

.cg-pdp__crumb { padding-block: 20px; }
.cg-pdp__main { display: grid; grid-template-columns: 708fr 520fr; gap: 64px; align-items: start; padding-bottom: 96px; }

/* ---------------------------------------------------------------- gallery */
.cg-pdp__gal { position: sticky; top: calc(var(--cg-header-sticky-h) + 20px); }
.cg-gal { display: grid; grid-template-columns: 84px 1fr; gap: 14px; }
.cg-gal__thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 760px; overflow-y: auto; scrollbar-width: none; }
.cg-gal__thumbs::-webkit-scrollbar { display: none; }
.cg-gal__th { position: relative; border: 1px solid transparent; }
/* store photos are 4:3 on white (1600x1200, every type sampled): the box takes their shape and shows the
   whole photo, instead of a tall cream box that cut the sides off every ring (theme-changes-playbook C3) */
.cg-gal__th .cg-media { aspect-ratio: 4 / 3; background: var(--cg-white); }
.cg-gal__th .cg-media > img { object-fit: contain; }
.cg-gal__th.is-on { border-color: var(--cg-line-strong); }
.cg-gal__play { position: absolute; inset: 0; display: grid; place-content: center; background: rgba(22,17,26,.3); color: var(--cg-inverse); }
.cg-gal__main { position: relative; min-width: 0; }
.cg-gal__tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.cg-gal__stage { aspect-ratio: 4 / 3; background: var(--cg-white); }
.cg-gal__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.cg-gal__slide.is-on { opacity: 1; }
.cg-gal__slide img, .cg-gal__slide video { width: 100%; height: 100%; object-fit: contain; }
.cg-gal__badge { position: absolute; top: 16px; left: 16px; padding: 6px 10px; background: var(--cg-sale); color: var(--cg-inverse); }
.cg-gal__3d { position: absolute; inset: 0; background: var(--cg-image); }
.cg-gal__3d iframe { width: 100%; height: 100%; border: 0; }
/* the 3D viewer's own corner mark is covered by ours, and its blank start by our cover (C4) */
.cg-tryon__f { position: relative; }
.cg-gal__dots { display: none; }

@media (max-width: 1023px) {
  .cg-pdp__main { grid-template-columns: 1fr; gap: 32px; }
  .cg-pdp__gal { position: static; }
}
@media (max-width: 767px) {
  .cg-gal { grid-template-columns: 1fr; gap: 10px; }
  .cg-gal__thumbs { flex-direction: row; order: 2; max-height: none; overflow-x: auto; }
  .cg-gal__th { flex: 0 0 64px; }
  .cg-gal__stage { aspect-ratio: 4 / 3; }
  .cg-gal__dots { display: flex; justify-content: center; gap: 6px; padding-top: 12px; }
  .cg-gal__dot { width: 6px; height: 3px; background: var(--cg-line); }
  .cg-gal__dot.is-on { width: 20px; background: var(--cg-text); }
}

/* ---------------------------------------------------------------- info */
.cg-pdp__info { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cg-pdp__h { max-width: 20ch; }
.cg-pdp__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cg-rate { display: inline-flex; align-items: center; gap: 8px; }
.cg-pricebox--lg .cg-price { font-family: var(--cg-display); font-weight: 400; font-size: 36px; line-height: 1; }
.cg-pricebox--lg .cg-price-was { font-size: 15px; }
.cg-pdp__short { color: var(--cg-text-2); max-width: 52ch; }
/* Harsh, 5 Nov: the description now prints its own HTML, so give its paragraphs, lists and
   headings room. `p { margin: 0 }` in the reset would otherwise run them together. A plain-text
   description has no element children, so this matches nothing and changes nothing today. */
.cg-pdp__short > * + *, .cg-details__t > * + * { margin-top: 1em; }
.cg-pdp__opts { display: flex; flex-direction: column; gap: 26px; }

.cg-gpnote { padding: 14px 18px; background: var(--cg-porcelain); border-left: 2px solid var(--cg-rose); }
.cg-gpnote__t { color: var(--cg-text-2); }

.cg-opt__tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-otile {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 72px; padding: 10px 14px; border: 1px solid var(--cg-line);
}
.cg-otile:hover { border-color: var(--cg-rose); }
.cg-otile.is-on { border-color: var(--cg-line-strong); background: var(--cg-white); }
.cg-opt__guide { margin-left: auto; }
.cg-select {
  width: 100%; height: 48px; padding-inline: 16px; border: 1px solid var(--cg-line);
  background: var(--cg-white); font-size: 14px;
}

/* add to cart */
.cg-pdp__addrow { display: flex; gap: 10px; align-items: stretch; }
.cg-qty--lg { height: 54px; }
.cg-qty--lg .cg-qty__b { width: 42px; height: 100%; }
.cg-qty__i { width: 44px; border: 0; text-align: center; font-size: 14px; -moz-appearance: textfield; }
.cg-qty__i::-webkit-outer-spin-button, .cg-qty__i::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cg-pdp__cta { flex: 1 1 auto; }
.cg-pdp__wish { width: 54px; border: 1px solid var(--cg-line-strong); }
.cg-pdp__wish:hover { border-color: var(--cg-rose); }
/* saved: the same rose, filled heart as a listing card's — it had no saved look, so a click seemed to do nothing */
.cg-pdp__wish[aria-pressed='true'] { color: var(--cg-rose); border-color: var(--cg-rose); }
.cg-pdp__wish[aria-pressed='true'] svg { fill: currentColor; }
.cg-pdp__err { color: var(--cg-sale); padding-top: 8px; }

.cg-shipline { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--cg-line); }
.cg-shipline svg { color: var(--cg-rose); flex: 0 0 auto; }

.cg-badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cg-badges li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 8px; }
.cg-badges img, .cg-badges svg { color: var(--cg-rose); }
.cg-badges em { font-style: normal; color: var(--cg-text-2); }
@media (max-width: 767px) { .cg-badges { grid-template-columns: repeat(2, 1fr); } }

/* FIX3: the accordion's own top rule went with the first row's (cng-collection.css) — it was the line
   the user circled above "Shipping & returns". */
.cg-pdp__acc { }
.cg-pdp__help { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- the details */
.cg-details { display: grid; grid-template-columns: 640fr 800fr; min-height: 640px; background: var(--cg-porcelain); }
.cg-details__m img { width: 100%; height: 100%; object-fit: cover; }
.cg-details__c { display: flex; align-items: center; }
.cg-details__in { display: flex; flex-direction: column; gap: 20px; padding: 80px 96px; max-width: 700px; }
.cg-details__t { color: var(--cg-text-2); }
.cg-specs { margin: 10px 0 0; }
.cg-specs__r { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--cg-line); }
.cg-specs__r dt { font-size: 14px; color: var(--cg-text-2); }
.cg-specs__r dd { margin: 0; font-size: 14px; text-align: right; }
@media (max-width: 1023px) {
  .cg-details { grid-template-columns: 1fr; min-height: 0; }
  .cg-details__m { aspect-ratio: 16 / 10; height: auto; width: 100%; }
  .cg-details__in { padding: 40px var(--cg-gutter) 48px; }
}

/* ---------------------------------------------------------------- mobile sticky bar */
.cg-stick {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; display: none;
  align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--cg-pearl); border-top: 1px solid var(--cg-line);
}
.cg-stick__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cg-stick__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-stick__b { flex: 0 0 auto; }
@media (max-width: 767px) {
  .cg-stick.is-on { display: flex; }
  .cg-call { bottom: 84px; }
  .cg-top-btn { bottom: 142px; }
}

/* ---------------------------------------------------------------- shopper inputs */
.cg-field {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--cg-line); background: var(--cg-white); color: var(--cg-text);
  font: inherit; font-size: 14px;
}
.cg-field:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: -1px; }
.cg-otile__m { width: 44px; height: 44px; }
.cg-otile__m img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- Try On */
.cg-tryon { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(22,17,26,.72); }
.cg-tryon__box { position: relative; width: min(560px, 100%); background: var(--cg-white); padding: 18px; }
.cg-tryon__x { position: absolute; top: 10px; right: 10px; }
.cg-tryon__f { aspect-ratio: 3 / 4; background: var(--cg-image); }
.cg-tryon__f iframe { width: 100%; height: 100%; border: 0; }
.cg-tryon__n { margin-top: 10px; text-align: center; }
.cg-gal__tryon { margin-left: auto; }

/* ---------------------------------------------------------------- education (§8) */
.cg-edu { padding-block: 84px; background: var(--cg-porcelain); }
.cg-edu__in { display: grid; gap: 40px; }
.cg-edu__h { max-width: 52ch; }
.cg-edu__g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cg-edu__c { display: flex; flex-direction: column; gap: 10px; padding: 28px 24px; background: var(--cg-white); border: 1px solid var(--cg-line); }
.cg-edu__c h3 { margin: 0; }

/* ---------------------------------------------------------------- the 4Cs (§8.3) */
.cg-4cs { padding-block: 84px; }
.cg-4cs__h { margin-bottom: 40px; }
/* margin-bottom removed with the "full 4Cs guide" link it used to separate (4 Nov 2026) */
.cg-4cs__g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cg-4cs__c { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--cg-line-strong); }
.cg-4cs__c h3 { margin: 0; }
.cg-4cs__k { color: var(--cg-accent); }

@media (max-width: 1023px) {
  .cg-edu__g, .cg-4cs__g { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .cg-edu { padding-block: 56px; }
  .cg-4cs { padding-block: 56px; }
  .cg-edu__g, .cg-4cs__g { grid-template-columns: 1fr; gap: 16px; }
  .cg-tryon__box { width: 100%; }
}
/* "Explore more <type>" under the related rail (theme-changes-playbook C5) */
.cg-rail-sec__more { margin-top: 28px; text-align: center; }

/* reassure row under the buy area (pdp-system §3 item 3) */
.cg-pdp__reassure { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0 4px; padding: 0; list-style: none; color: var(--cg-text-2); }
.cg-pdp__reassure li { display: inline-flex; align-items: center; gap: 7px; }
.cg-pdp__reassure svg { color: var(--cg-accent); flex: none; }
.cg-pdp__reassure a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--cg-line); }
.cg-pdp__reassure a:hover { color: var(--cg-text); border-color: currentColor; }
/* the store's own badge icons (IGI-badge-rule.md §1), sized evenly */
.cg-badges__i { width: 28px; height: 28px; object-fit: contain; }

/* product title (user, 2026-10-26 "title font is too big"): store titles run long ("Yellow Gold Round Brilliant
   Lab-Grown Diamond Tennis Necklace with Three-Prong Setting"), so a smaller display size and a wider line — two or
   three lines instead of five */
.cg-pdp__h.cg-d3 { font-size: clamp(24px, 1.9vw, 32px); line-height: 1.22; letter-spacing: -0.005em; max-width: 30ch; text-wrap: balance; }
@media (max-width: 767px) { .cg-pdp__h.cg-d3 { font-size: 22px; max-width: none; } }

/* "The details" photo (user, 2026-10-26 "the product image sometimes crops — fit it in the box"): the whole piece,
   never cropped — the store's photos are 4:3 on white, so the box is white, the photo is contained, and on phones the box
   is 4:3 to match */
.cg-details__m { background: var(--cg-white); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cg-details__m img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
@media (min-width: 1024px) { .cg-details__m img { padding: 24px; } }
@media (max-width: 1023px) { .cg-details__m { aspect-ratio: 4 / 3; } }
/* FIX3 (user, 2026-11-16: "image not set properly"): on desktop this panel used to stretch to whatever
   height the spec table happened to be (855px on a long one), so a 4:3 photo sat in it with deep white
   bands above and below — worst on a close-up, which then looked cut off at the sides. The panel now keeps
   the photos' own 4:3 shape and is centred in the row, so the picture fills it. object-fit stays contain:
   jewellery is never cropped to fill a box. */
@media (min-width: 1024px) { .cg-details__m { aspect-ratio: 4 / 3; align-self: center; } }

/* A video thumb is the video's own first frame, not preview_image (pdp-video-autoplay-rule #8): it
   sits in the thumb exactly where the <img> did, and the click goes through it to the button. */
.cg-gal__th .cg-media > video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }

/* PDP buttons and dropdowns (whitemoon-pdp-buttons-dropdowns.md §2d, §4b, §6) ------------------- */

/* what an option tile adds over the cheapest in its group, under the value name */
/* The two .cg-chip__add rules that were here went with the label itself: an option tile no longer
   carries an "INCLUDED" / "+$x" second line (pdp-option-addon-label-remove.md, Harsh 4 Nov 2026). */

/* the one toast: a ring or band cannot be added without a size */
.cg-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 120;
  max-width: calc(100vw - 32px); padding: 13px 22px;
  background: var(--cg-onyx); color: var(--cg-pearl);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 14px 34px -16px rgba(30, 22, 32, .6);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.cg-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* a disabled quantity button still reads as a button, it just does not invite a click */
.cg-qty__b:disabled { opacity: .35; cursor: not-allowed; }
.cg-qty__b:disabled:hover { background: none; }

/* the length guide */
.cg-lenmodal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; background: rgba(22, 17, 26, .55); }
.cg-lenmodal[hidden] { display: none; }
.cg-lenmodal__box { position: relative; width: min(460px, 100%); max-height: 86vh; overflow-y: auto; padding: 30px 28px; background: var(--cg-white); }
.cg-lenmodal__x { position: absolute; top: 12px; right: 12px; }
.cg-lenmodal__h { margin: 6px 0 18px; }
.cg-lenmodal__l { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cg-lenmodal__l button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 14px; border: 1px solid var(--cg-line); background: var(--cg-white); text-align: left; cursor: pointer; }
.cg-lenmodal__l button:hover { border-color: var(--cg-rose); }
.cg-lenmodal__l em { font-style: normal; }
.cg-lenmodal__f { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--cg-line); }
@media (max-width: 600px) { .cg-lenmodal__box { padding: 24px 18px; } }
