/* ==========================================================================
   שי — בונה הארון (visual configurator)  ·  builder-only styles
   Loaded ONLY on build.html. Relies on tokens/components from style.css.
   ========================================================================== */

.bld-hero {
  padding-top: calc(var(--head-h) + clamp(28px, 5vw, 56px));
  padding-bottom: clamp(20px, 3vw, 36px);
  text-align: center;
}
.bld-hero .eyebrow { margin-bottom: 16px; }
.bld-hero h1 { margin-bottom: 16px; }
.bld-hero .lead { margin-inline: auto; }

/* ---- layout: preview (right) + steps (left) ---- */
.bld {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 3.4vw, 56px);
  align-items: start;
  padding-bottom: clamp(60px, 9vw, 120px);
}

/* ---- preview panel (sticky) ---- */
.bld__stage { position: sticky; top: calc(var(--head-h) + 16px); }
.bld__frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 30px 70px -46px rgba(20,17,15,.4);
}
.bld__preview { display: block; width: 100%; aspect-ratio: 600 / 660; }
.bld__preview svg { display: block; width: 100%; height: 100%; }

.bld__badge {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--ink-mute); letter-spacing: .02em;
}
.bld__badge svg { width: 15px; height: 15px; color: var(--brass); }

/* ---- summary + add (under preview) ---- */
.bsum {
  margin-top: 18px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.bsum__t { font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--ink-mute); margin-bottom: 12px; }
.bsum__list { display: grid; gap: 1px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.bsum__row { display: flex; justify-content: space-between; gap: 14px; background: var(--white); padding: 9px 2px; }
.bsum__k { font-size: 13.5px; color: var(--ink-mute); }
.bsum__v { font-size: 14.5px; font-weight: 600; color: var(--ink); text-align: start; }

.bld__cta { margin-top: 16px; }
.bld__msg { margin-top: 12px; font-size: 14.5px; min-height: 1.2em; text-align: center; }
.bld__msg.is-ok { color: #3d7a4e; }

/* ---- steps ---- */
.bld__steps { display: grid; gap: clamp(18px, 2.2vw, 30px); }
.bstep { border-bottom: 1px solid var(--line-soft); padding-bottom: clamp(16px, 2vw, 26px); }
.bstep:last-child { border-bottom: 0; }
.bstep__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.bstep__n {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--brass); color: var(--brass);
  border-radius: 50%; font-family: var(--serif); font-size: 14px;
}
.bstep__title { font-size: 1.28rem; font-weight: 500; line-height: 1.2; }
.bstep__hint { font-size: 13.5px; color: var(--ink-mute); margin-top: 2px; }
.bstep__val {
  margin-inline-start: auto; align-self: center;
  font-size: 13.5px; font-weight: 600; color: var(--brass);
  background: var(--brass-tint); padding: 4px 12px; border-radius: 40px;
  white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis;
}

.bopts { display: flex; flex-wrap: wrap; gap: 10px; }
.bopt {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line); border-radius: 44px;
  background: var(--white); color: var(--ink-soft);
  font-size: 14.5px; font-weight: 600;
  transition: border-color var(--med), color var(--med), background var(--med), box-shadow var(--med);
}
.bopt:hover { border-color: var(--ink-mute); color: var(--ink); }
.bopt.is-on {
  border-color: var(--ink); color: var(--ink); background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.bopt--swatch { padding-inline-start: 10px; }
.bopt__dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.bopt__dot--none {
  position: relative; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}
.bopt__dot--none::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: linear-gradient(45deg, transparent 44%, #c33 45%, #c33 55%, transparent 56%);
}
.bopt.is-on .bopt__dot { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 0 0 2px var(--ink); }

/* ---- back link ---- */
.bld-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-mute); margin-bottom: 4px;
  transition: color var(--med);
}
.bld-back:hover { color: var(--ink); }

/* highlight the builder nav entry */
.nav__build { color: var(--brass-lt) !important; font-weight: 600; }
.hdr.is-stuck .nav__build { color: var(--brass) !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  /* One column, and re-order so the CHOICES sit right under the picture.
     display:contents lets the preview and the summary be ordered separately. */
  .bld { display: flex; flex-direction: column; gap: 0; }
  .bld__stage { display: contents; }

  .bld__frame {
    order: 1;
    position: sticky; top: calc(var(--head-h) - 12px); z-index: 20;
    width: fit-content; margin-inline: auto;
    background: var(--paper);
    box-shadow: 0 14px 22px -18px rgba(20,17,15,.5);
  }
  /* portrait card sized by height, so there are no empty side bars */
  .bld__preview { height: 36vh; width: auto; aspect-ratio: 600 / 660; }
  .bld__badge { display: none; }               /* saves vertical space on phones */

  .bld__steps { order: 2; padding-top: 22px; }
  .bld__panel { order: 3; padding-top: 8px; }
  .bsum { margin-top: 0; }
}

@media (max-width: 560px) {
  .bld__preview { height: 32vh; }
  .bstep__val { display: none; }
  .bopt { padding: 10px 15px; font-size: 13.6px; }
  .bstep__head { gap: 11px; margin-bottom: 13px; }
  .bstep__n { width: 26px; height: 26px; font-size: 13px; }
  .bstep__title { font-size: 1.14rem; }
}
