/* Watch builder section. Shares tokens, buttons and type with styles.css. */

.build { padding-bottom: 0; background: var(--bg-raised); }
.build-intro { margin-bottom: clamp(40px, 6vw, 72px); }

.builder {
  --nav-h: 85px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
/* Let the scrolling step tabs shrink instead of widening the column. */
.builder > * { min-width: 0; }

/* Preview */
.b-stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 45%, #232327 0%, #121214 55%, var(--bg) 100%);
  overflow: hidden;
}
.b-preview {
  width: min(100%, calc(100vh - var(--nav-h) - 110px));
  aspect-ratio: 1;
}
.b-stack {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s ease, opacity 0.35s ease;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}
.b-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
}
.b-stack img[hidden] { display: block; opacity: 0; }

/* Case-back view on the rotor choice: the movement, with the rotor swinging gently about its pivot */
.b-preview { position: relative; }
.b-back {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}
.b-back img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.b-stage.is-back .b-back { opacity: 1; }
.b-stage.is-back .b-stack { opacity: 0; }
.b-rotor { animation: b-rotor-swing 7s ease-in-out infinite; }
@keyframes b-rotor-swing {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(16deg); }
}
@media (prefers-reduced-motion: reduce) { .b-rotor { animation: none; } }
.b-spec {
  margin: 0;
  max-width: 560px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Panel */
.b-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
  border-left: 1px solid var(--line);
}

.b-steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 18px clamp(20px, 3vw, 44px) 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.b-steps::-webkit-scrollbar { display: none; }
.b-steps button {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 8px 12px;
  cursor: pointer;
}
.b-steps button:hover { color: var(--text); }
.b-steps button[aria-current="step"] { color: var(--text); border-bottom-color: var(--brass); }
.b-steps .num { color: var(--brass); margin-right: 6px; font-size: 11px; }
/* Side-by-side layout: the panel is too narrow for all nine tabs in one row, so let them wrap rather than hide
   the last ones off the edge (phones keep the swipeable strip). */
@media (min-width: 981px) {
  .b-steps { flex-wrap: wrap; overflow-x: visible; gap: 0 2px; }
}

.b-body { flex: 1; padding: 28px clamp(20px, 3vw, 44px) 36px; }
.b-body h3 { font-size: clamp(30px, 3vw, 40px); }
.b-intro { color: var(--muted); margin: 8px 0 26px; max-width: 52ch; }

.b-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.b-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 10px 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.b-tile:hover { border-color: rgba(193, 154, 91, 0.5); }
.b-tile:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.b-tile[aria-checked="true"] { border-color: var(--brass); background: #17150f; }
.b-tile[aria-checked="true"]::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass);
}
.b-thumb {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 6px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #2a2a2e, #101012);
}
.b-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(var(--zoom, 1)) translate(var(--dx, 0), var(--dy, 0));
}
.b-tile-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.b-tile-note { font-size: 12px; color: var(--muted); line-height: 1.4; }
.b-tile--text { min-height: 110px; justify-content: flex-end; }
/* Collection name above a step's options, and a step's extra choice (the clasp) under them */
.b-collection { margin: 6px 0 14px; }
.b-extra { margin-top: 30px; }
.b-extra .b-intro { margin: 0 0 16px; }
/* Special request at the end of the summary */
.b-special { margin-top: 34px; }
.b-special .b-intro { margin: 0; }
.b-special .b-field { margin-top: 20px; }
/* Engraving + custom dial bundle offer */
.b-offer { margin: 16px 0 0; padding: 12px 14px; border: 1px solid rgba(193, 154, 91, 0.45); background: var(--brass-soft); font-size: 14px; line-height: 1.5; color: var(--text); max-width: 52ch; }
.b-offer strong { color: var(--brass); font-weight: 600; }
/* Small price tag on a field label, and the order total above the Reserve button */
.b-price { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid rgba(193, 154, 91, 0.55); border-radius: 2px; color: var(--brass); font-size: 10px; letter-spacing: 0.06em; vertical-align: 1px; }
.b-total { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 52ch; }
.b-total-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 14px; color: var(--muted); }
.b-total-row.is-total { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; color: var(--text); }
.b-total-row.is-total span:last-child { color: var(--brass); font-weight: 600; }
/* Delivery choice above the order total */
.b-delivery { margin: 30px 0 0; padding: 0; border: 0; max-width: 52ch; }
.b-delivery legend { padding: 0; margin-bottom: 10px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.b-delivery label { display: inline-flex; align-items: center; gap: 8px; margin: 0 22px 8px 0; font-size: 14px; color: var(--text); cursor: pointer; }
.b-delivery input { accent-color: var(--brass); width: 16px; height: 16px; margin: 0; }
.b-delivery .b-price { margin-left: 0; }
.b-delivery-note { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.b-offer-link { font: inherit; color: var(--brass); background: none; border: 0; padding: 0; margin-left: 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.b-tile--swatch { min-height: 0; justify-content: flex-start; }
.b-swatch { display: block; width: 40px; aspect-ratio: 1; border-radius: 50%; margin-bottom: 8px; box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.6); }

.b-field { display: grid; gap: 8px; margin-top: 28px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.b-field input {
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.b-field input:focus { outline: none; border-bottom-color: var(--brass); }
.b-field small { letter-spacing: 0.08em; text-transform: none; }
.b-field[hidden] { display: none; }

/* Summary */
.b-summary { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.b-summary li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.b-summary .k { display: block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.b-summary .v { font-size: 16px; }
.b-summary button {
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  flex-shrink: 0;
}
.b-summary button:hover { color: var(--text); }
.b-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.b-fine { color: var(--muted); font-size: 13px; margin-top: 18px; max-width: 46ch; }
.b-copied { color: var(--brass); font-size: 13px; min-height: 1.4em; margin: 10px 0 0; word-break: break-all; }

/* Bottom bar */
.b-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(20px, 3vw, 44px);
  background: rgba(10, 10, 11, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.b-count span { display: block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.b-count strong { font-family: var(--serif); font-weight: 500; font-size: 26px; }
.b-nav { display: flex; gap: 10px; }
.b-nav .btn { padding: 13px 22px; }
.b-nav .btn:disabled { opacity: 0.35; cursor: default; }
.b-nav .btn[hidden] { display: none; }

/* Phone and tablet: preview sticks on top, options scroll underneath */
@media (max-width: 980px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .b-stage {
    z-index: 5;
    height: auto;
    padding: 12px 16px 10px;
    gap: 6px;
    border-bottom: 1px solid var(--line);
  }
  .b-preview { width: min(72vw, 36vh, 380px); }
  .b-spec { font-size: 10px; }
  .b-panel { border-left: 0; min-height: 0; }
  .b-body { padding-top: 22px; padding-bottom: 28px; }
  .b-options { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .b-tile-note { display: none; }
}
@media (max-width: 560px) {
  .builder { --nav-h: 72px; }
  .b-count strong { font-size: 22px; }
  .b-nav .btn { padding: 11px 16px; }
}

/* ---------- Oxblood accents ---------- */
.build { background: linear-gradient(180deg, var(--bg-raised), #120709); }
.b-stage { background: radial-gradient(ellipse at 50% 45%, #4c1621 0%, #22090f 55%, #100508 100%); }
.b-tile[aria-checked="true"] { border-color: var(--brass); background: linear-gradient(160deg, #2c0f16, #170a0d); box-shadow: inset 0 0 0 1px rgba(122, 29, 43, 0.6); }
.b-tile:hover { border-color: rgba(122, 29, 43, 0.9); }
.b-steps button[aria-current="step"] { border-bottom-color: var(--oxblood); }

/* ---------- Gloss & depth ---------- */
.b-stage {
  background:
    radial-gradient(ellipse 40% 30% at 50% 22%, rgba(255, 210, 190, 0.12), transparent 70%),
    radial-gradient(ellipse at 50% 45%, #5a1a27 0%, #22090f 55%, #0b0305 100%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.7);
}
.b-stack { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.b-tile {
  background: linear-gradient(170deg, #1d1b1f, #111013);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.b-tile:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 24px rgba(0, 0, 0, 0.55); }
.b-tile[aria-checked="true"] {
  background: linear-gradient(160deg, #3a1420, #1a0a0e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(122, 29, 43, 0.7), 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(122, 29, 43, 0.35);
}
.b-tile[aria-checked="true"]::after { background: radial-gradient(circle at 35% 30%, #fff1c9, #c19a5b 55%, #7a5520); box-shadow: 0 0 8px rgba(230, 200, 130, 0.7); }
.b-thumb { background: radial-gradient(circle at 50% 35%, #36343a, #141316 70%, #0c0b0d); box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.5); }
.b-steps button[aria-current="step"] { border-image: linear-gradient(90deg, var(--oxblood), #e2c07d, var(--oxblood)) 1; }
.b-bar { background: linear-gradient(180deg, rgba(28, 20, 24, 0.9), rgba(10, 10, 11, 0.96)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 -12px 30px rgba(0, 0, 0, 0.5); }
.b-count strong { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Piano-black gloss ---------- */
.build { background: var(--piano), #030304; }
.builder { background: #030304; }
.b-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 16%),
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.045) 44%, rgba(255, 255, 255, 0.01) 52%, transparent 58%),
    linear-gradient(180deg, #151318, #060607 60%, #030304);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}
.b-tile { background: linear-gradient(170deg, #26232a 0%, #121114 40%, #070708 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px rgba(0, 0, 0, 0.55); }
.b-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015) 48%, rgba(0, 0, 0, 0) 49%), linear-gradient(180deg, rgba(24, 22, 26, 0.94), rgba(4, 4, 5, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 -14px 34px rgba(0, 0, 0, 0.6);
}

/* Phones: a slim one-line step bar ("1 / 9" and small buttons) that sits at the end of each step instead of
   sticking to the bottom of the screen, so it never covers the options */
@media (max-width: 560px) {
  .b-bar { position: static; padding: 10px 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
  .b-count span { display: none; }
  .b-count strong { font-size: 18px; }
  .b-nav { gap: 8px; }
  .b-nav .btn { padding: 11px 16px; font-size: 10px; }
}

/* request form on the summary step */
.b-request .b-field:first-child { margin-top: 20px; }
.b-request .b-actions { margin-top: 24px; }
.b-request .btn:disabled { opacity: 0.6; cursor: progress; }
