/* Ringbuilt overrides for the vendored Bands builders (ring-builder.css is kept as shipped).
   Loaded after ring-builder.css. */

/* Single column (≤960px): the stage sits above the panel and sticks under the header for the
   length of the builder. As soon as the page scrolls, it loses as much height as has been scrolled
   (--rb-stage-shrink, set per frame by RingBuilderEmbed) until it reaches the compact height, so
   its bottom edge moves with the content below. The lost height is added back as margin-bottom,
   so the stage's place in the flow, and the text below, never moves. The buttons fade with
   --rb-stage-progress (0 → 1). It only rests at full or compact size: the first scroll
   away from one glides straight to the other. (The stock rules put a full-height stage in a 55vh row and kept
   130px panel padding.) */
@media (max-width: 960px) {
  .customiser {
    grid-template-rows: auto;
    --rb-stage-full: min(62svh, 560px);
    --rb-stage-compact: min(34svh, 290px);
  }
  .customiser__stage {
    position: sticky;
    top: var(--rb-header-offset, 0px);
    z-index: 3;
    height: calc(var(--rb-stage-full) - var(--rb-stage-shrink, 0px));
    margin-bottom: var(--rb-stage-shrink, 0px);
  }
  /* The 3D view keeps its full size and is scaled down with the stage instead of being resized:
     resizing a WebGL canvas clears it, which made the ring flash on every frame. */
  .customiser__viewer {
    inset: 0 0 auto;
    height: var(--rb-stage-full);
    transform: scale(var(--rb-stage-scale, 1));
    transform-origin: 50% 0;
  }
  .customiser .view-presets,
  .customiser .style-menu { opacity: calc(1 - var(--rb-stage-progress, 0) * 3); }
  .customiser.is-stage-compact :is(.view-presets, .style-menu) { visibility: hidden; pointer-events: none; }
  .customiser__panel { padding: 36px var(--rb-gutter, 20px) 56px; }
  /* The stage glide briefly sets overflow: hidden on <html>; keep a classic scrollbar's space so the
     layout doesn't jump sideways while it does. Scroll anchoring is off: the stage changes size as
     the page scrolls, and the browser's own anchoring correction nudged the page by a few pixels,
     which broke the up notch and made the page shake. (The stage keeps the flow below it fixed.) */
  html { scrollbar-gutter: stable; overflow-anchor: none; }
}

/* Between the single-column breakpoint and wide desktop, 130px side padding squeezes the panel. */
@media (min-width: 961px) and (max-width: 1280px) {
  .customiser__panel { padding-inline: clamp(40px, 6vw, 130px); }
}

/* ============ RINGBUILT THEME ============
   Re-skins the builder in the Ringbuilt design language (design/tokens.css): stone surfaces,
   Newsreader Light display type with an italic second half, DM Sans body, tiny uppercase tracked
   labels, square corners, 1px hairlines, no shadows, sage primary action, plum slider handles.
   The Bands aurora, light sweep and magnetic buttons are switched off; cinema.js isn't loaded. */

.customiser {
  --cream: var(--rb-stone);
  --cream-2: var(--rb-stone-deep);
  --blush: var(--rb-stone-deep);
  --ink: var(--rb-ink);
  --ink-soft: var(--rb-ink-soft);
  --brand: var(--rb-sage);
  --brand-2: var(--rb-sage);
  --wine: var(--rb-plum);
  --wine-2: var(--rb-plum-deep);
  --pink: var(--rb-plum);
  --line: var(--rb-line-strong);
  --font-head: var(--font-newsreader), var(--rb-font-serif);
  --font-body: var(--font-dm-sans), var(--rb-font-sans);
  --font-accent: var(--font-newsreader), var(--rb-font-serif);
  --font-mono: var(--font-dm-sans), var(--rb-font-sans);
  /* shared "lab" label: 11px, 500, uppercase, .2em */
  --rbx-lab-size: var(--rb-text-label);
  background: var(--rb-stone);
  color: var(--rb-ink);
  font-size: 14px;
}

/* -- surfaces: flat stone, no aurora -- */
.customiser::before,
.customiser::after { display: none; }
.customiser__panel { background: var(--rb-stone); border-right: 1px solid var(--rb-line); }
.customiser__stage { background: var(--rb-stone-deep); }
.hand-photo { background: var(--rb-stone-deep); }
.customiser__viewer { cursor: grab; }
.customiser__viewer:active { cursor: grabbing; }

/* -- type -- */
.customiser :is(h1, h2, h3, h4) {
  font-family: var(--font-head);
  font-weight: 300;
  text-transform: none;
  letter-spacing: -0.03em;
}

.customiser .product__title {
  font-size: clamp(38px, 3.4vw, 52px);
  line-height: 1.02;
}
.customiser .product__title em { font-style: italic; }

.customiser .sales-message {
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rb-sage);
  margin-bottom: 22px;
}

.customiser .product__price {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 18px 0 30px;
}

.customiser .divider { border-top: 1px solid var(--rb-line); }

.customiser .about { margin: 30px 0; }
.customiser .about__body {
  max-width: 520px;
  font-size: var(--rb-text-body);
  font-weight: 300;
  line-height: 1.7;
  color: var(--rb-ink-soft);
}
.customiser .about__features { margin-top: 24px; gap: 12px; }
.customiser .about__features li {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 14px;
  color: var(--rb-ink-soft);
}

.customiser .customiser__note {
  font-style: normal;
  font-size: 13px;
  line-height: 1.6;
  color: var(--rb-ink-muted);
}

/* -- section heads and field labels use the "lab" style -- */
.customiser .acc { border-bottom: 1px solid var(--rb-line); }
.customiser .acc__head,
.customiser .field-label,
.customiser .upload {
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--rb-ink);
}
.customiser .acc__head { min-height: 44px; padding: 24px 0 14px; }
.customiser details.acc:not([open]) .acc__head { padding-bottom: 24px; }
.customiser .acc--static .acc__head { padding-bottom: 12px; }
.customiser .acc--row { padding: 16px 0; }
.customiser .acc--row .acc__head { padding: 0; }
.customiser .acc__chev { color: var(--rb-ink-muted); }
.customiser .field-label .mono,
.customiser .slider-label .mono {
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--rb-ink-muted);
}

/* -- fields: square, field fill, hairline -- */
.customiser .select,
.customiser .text-input {
  height: 48px;
  border: 1px solid var(--rb-line-strong);
  border-radius: 0;
  background: var(--rb-field);
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: 14px;
}
.customiser .text-input { padding: 0 14px; }
.customiser .select:focus-visible,
.customiser .text-input:focus,
.customiser .text-input:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 2px; }
.customiser .select-wrap::after { background: var(--rb-ink-muted); }

.customiser .upload {
  border: 1px dashed var(--rb-line-strong);
  background: var(--rb-field);
}
.customiser .upload:hover { border-color: var(--rb-sage); color: var(--rb-sage); }
.customiser .upload__hint {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rb-ink-muted);
}

.customiser .slider { accent-color: var(--rb-plum); }

/* -- option chips: hairline tiles, sage when chosen -- */
.customiser .chip {
  min-height: 44px;
  border: 1px solid var(--rb-line-strong);
  border-radius: 0;
  background: var(--rb-field);
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.customiser .chip .mono { font-size: 12px; font-weight: 400; color: var(--rb-ink-muted); }
.customiser .chip:hover { border-color: var(--rb-ink); }
.customiser .chip.is-active {
  border-color: var(--rb-sage);
  background: color-mix(in srgb, var(--rb-sage) 9%, var(--rb-field));
  color: var(--rb-sage);
}
.customiser .chip.is-active .mono { color: var(--rb-sage); }
.customiser .chip:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 2px; }

/* -- metal swatches: matches the Lowen metal picker (lowenrings.com/shop/levitator) — 56px circles
      with a hairline edge; the selected one gets a 2px ink border, a 4px stone gap and a thin outer
      ring. The gradient fills and the karat reel from tone.js are kept. -- */
.customiser .tone-picker { gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.customiser .tone-item { width: auto; min-width: 56px; gap: 16px; opacity: 1; }
.customiser .tone-item:not(.is-active):hover { opacity: 1; }
.customiser .tone-swatch,
.customiser .tone-item.is-active .tone-swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  outline: 0;
}
.customiser .tone-swatch {
  border: 0.5px solid color-mix(in srgb, var(--rb-ink) 27%, transparent);
  box-shadow: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.customiser .tone-item:not(.is-active) .tone-swatch:hover { border-color: color-mix(in srgb, var(--rb-ink) 55%, transparent); }
.customiser .tone-item.is-active .tone-swatch {
  border: 2px solid var(--rb-ink);
  box-shadow:
    0 0 0 4px var(--rb-stone),
    0 0 0 5px color-mix(in srgb, var(--rb-ink) 53%, transparent);
}
.customiser .tone-swatch:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 7px; }
.customiser .tone-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--rb-ink-muted);
  transition: color 0.25s ease;
}
.customiser .tone-item.is-active .tone-label { color: var(--rb-ink); }
/* karat reel inside the smaller circle (row height stays 24px: tone.js's rowH) */
.customiser .tone-chev { padding: 2px 16px; margin: -2px 0; color: color-mix(in srgb, var(--rb-ink) 60%, transparent); }
.customiser .tone-chev:hover { color: var(--rb-ink); }
.customiser .tone-reel-mask { height: 24px; }
.customiser .tone-reel__row {
  height: 24px;
  line-height: 24px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--rb-ink);
}

/* -- Add to cart: plum brand colour, square, label type -- */
.customiser .cta {
  min-height: 44px;
  padding: 18px 24px;
  border-radius: 0;
  background: var(--rb-plum);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  transition: opacity 0.2s ease;
}
.customiser .cta:hover { background: var(--rb-plum); opacity: 0.9; }
/* Note under Add to cart: centred, Newsreader italic (like the footer tagline). */
.customiser .cta--cart + .customiser__note {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-family: var(--font-head);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.35;
}
.customiser .cta::after { display: none; }
.customiser .cta:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 2px; }

/* -- stage controls: hairline segmented control + outline button (SegmentedControl / ButtonLink) -- */
.customiser .view-presets {
  gap: 0;
  border: 1px solid var(--rb-line-strong);
  background: color-mix(in srgb, var(--rb-stone) 88%, transparent);
  backdrop-filter: blur(10px);
}
.customiser .view-presets button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.customiser .view-presets button + button { border-left: 1px solid var(--rb-line-strong); }
.customiser .view-presets button:hover { background: var(--rb-stone-shade); }
.customiser .view-presets button.is-active { background: var(--rb-ink); color: var(--rb-stone); }

.customiser .hand-btn {
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--rb-ink);
  background: color-mix(in srgb, var(--rb-stone) 88%, transparent);
  backdrop-filter: blur(10px);
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.customiser .hand-btn:hover { background: color-mix(in srgb, var(--rb-stone) 88%, transparent); border-color: var(--rb-sage); color: var(--rb-sage); }
.customiser :is(.view-presets button, .hand-btn):focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 2px; }
.customiser .view-presets button { white-space: nowrap; }

/* Stacked (≤960px): hairline between stage and panel instead of beside it. */
@media (max-width: 960px) {
  .customiser__panel { border-right: 0; }
  .customiser__stage { border-bottom: 1px solid var(--rb-line); }
  .customiser .view-presets button { padding: 0 14px; }
}

/* -- "Change styles" menu: replaces the hand try-on button in the same spot (bottom-centre of the
      stage). A native <details>; the panel opens upward. -- */
.customiser .style-menu {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.customiser .style-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px 0 24px;
  list-style: none;
  border: 1px solid var(--rb-ink);
  background: color-mix(in srgb, var(--rb-stone) 88%, transparent);
  backdrop-filter: blur(10px);
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.customiser .style-menu__toggle::-webkit-details-marker { display: none; }
.customiser .style-menu__toggle:hover { border-color: var(--rb-sage); color: var(--rb-sage); }
.customiser .style-menu__toggle:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: 2px; }
.customiser .style-menu__chev { transition: transform 0.2s ease; }
.customiser .style-menu[open] .style-menu__chev { transform: rotate(180deg); }
.customiser .style-menu[open] .style-menu__toggle { background: var(--rb-stone); }

.customiser .style-menu__panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 2 * var(--rb-gutter, 20px)));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rb-ink);
  background: var(--rb-stone);
}
.customiser .style-menu__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px 10px 10px;
  border: 0;
  background: transparent;
  color: var(--rb-ink);
  font-family: var(--font-body);
  font-size: var(--rbx-lab-size);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.customiser .style-menu__option + .style-menu__option { border-top: 1px solid var(--rb-line-strong); }
.customiser a.style-menu__option:hover { background: var(--rb-stone-shade); color: var(--rb-ink); }
.customiser .style-menu__option:focus-visible { outline: 2px solid var(--rb-sage); outline-offset: -2px; }
/* Current style: label, "Selected" tag and thumbnail all faded so it reads as disabled. */
.customiser .style-menu__option:disabled { cursor: default; color: var(--rb-ink-muted); }
.customiser .style-menu__option:disabled :is(.style-menu__label, .style-menu__tag) { color: inherit; opacity: 0.45; }
.customiser .style-menu__option:disabled .style-menu__thumb { opacity: 0.35; filter: grayscale(1); }
.customiser .style-menu__thumb {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: cover;
  background: var(--rb-stone-deep);
}
.customiser .style-menu__label { flex: 1; white-space: nowrap; }
.customiser .style-menu__tag { color: var(--rb-sage); letter-spacing: 0.16em; font-size: 10px; }
.customiser .style-menu__arrow { color: var(--rb-sage); letter-spacing: 0; font-size: 14px; }
