/* Bookflow widget — STRUCTURE ONLY.
   Every colour, radius and font comes from a --bf-* token, so a client can
   reskin the widget without forking its layout. Ship this file unchanged;
   define the tokens in a skin (widget-skin.css) or in the host page's own
   stylesheet. Fallbacks keep it legible if a token is missing. */

#bf-widget {
  --_brand:   var(--bf-brand, #0b6ca6);
  --_on:      var(--bf-on-brand, #fff);
  --_bg:      var(--bf-bg, #fff);
  --_panel:   var(--bf-panel, #f6f9fc);
  --_line:    var(--bf-line, #dde6ee);
  --_line2:   var(--bf-line-strong, #b9cddd);
  --_ink:     var(--bf-ink, #12212f);
  --_ink2:    var(--bf-ink-2, #4c6376);
  --_muted:   var(--bf-muted, #7b8fa1);
  --_r:       var(--bf-radius, 12px);
  --_font:    var(--bf-font, Inter, system-ui, sans-serif);
  --_mono:    var(--bf-font-mono, ui-monospace, monospace);
  --_display: var(--bf-font-display, var(--bf-font, Inter, system-ui, sans-serif));
  --_ok:      var(--bf-ok, #0f7b52);
  --_ok-bg:   var(--bf-ok-bg, #eaf7f0);
  --_ok-line: var(--bf-ok-line, #bfe3d0);

  max-width: 760px;
  margin: 0 auto;
  font-family: var(--_font);
  color: var(--_ink);
}
#bf-widget *, #bf-widget *::before, #bf-widget *::after { box-sizing: border-box; }
.bf-loading { display: grid; place-items: center; min-height: 200px; color: var(--_muted); }

/* ---------- steps ---------- */
.bf-steps { display: flex; gap: 8px; justify-content: center; margin: 0 0 24px; }
.bf-steps .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--_mono); font-size: 11px; font-weight: 700;
  background: var(--_panel); color: var(--_muted); border: 1px solid var(--_line);
}
.bf-steps .dot.on { background: var(--_brand); color: var(--_on); border-color: var(--_brand); }
.bf-steps .dot.done { background: var(--_panel); color: var(--_brand); border-color: var(--_line2); }

.bf-card {
  background: var(--_bg); border: 1px solid var(--_line);
  border-radius: var(--_r); padding: 24px;
}
.bf-h2 {
  font-family: var(--_display); font-size: 18px; font-weight: 700;
  margin: 0 0 4px; color: var(--_ink); text-align: left;
}
.bf-sub { color: var(--_muted); font-size: 14px; margin: 0 0 20px; }

/* ---------- catalog picker ---------- */
.bf-cat {
  font-family: var(--_mono); font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--_brand);
  margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--_line);
}
.bf-cat:first-child { margin-top: 0; }

.bf-item { padding: 14px 0; border-bottom: 1px solid var(--_line); }
.bf-item:last-child { border-bottom: none; }
.bf-item-top { display: flex; align-items: flex-start; gap: 16px; }
.bf-item-info { flex: 1; min-width: 0; }
.bf-item-name { font-weight: 600; font-size: 15px; }
.bf-item-desc { color: var(--_muted); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.bf-item-price {
  font-family: var(--_mono); font-size: 14px; color: var(--_brand);
  white-space: nowrap; margin-top: 3px;
}

/* stepper */
.bf-step-ctl { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.bf-step-ctl button {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--_line2);
  background: var(--_bg); color: var(--_ink); font-size: 19px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; font-family: var(--_font);
}
.bf-step-ctl button:hover:not(:disabled) { border-color: var(--_brand); color: var(--_brand); }
.bf-step-ctl button:disabled { opacity: .35; cursor: default; }
.bf-step-ctl .n {
  min-width: 46px; text-align: center; font-family: var(--_mono);
  font-size: 15px; font-weight: 600;
}
.bf-step-ctl .n.zero { color: var(--_muted); font-weight: 400; }

.bf-add-btn {
  border: 1px dashed var(--_line2); background: transparent; color: var(--_brand);
  border-radius: 9px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--_font);
}
.bf-add-btn:hover { border-color: var(--_brand); border-style: solid; }

/* size chips */
.bf-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.bf-size {
  border: 1px solid var(--_line2); background: var(--_bg); color: var(--_ink2);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer;
  font-family: var(--_font);
}
.bf-size.on { background: var(--_brand); color: var(--_on); border-color: var(--_brand); }
.bf-why {
  border: 1px solid var(--_line2); background: transparent; color: var(--_muted);
  width: 24px; height: 24px; border-radius: 50%; font-size: 12px; cursor: pointer;
  display: grid; place-items: center; font-family: var(--_font);
}
.bf-why:hover { color: var(--_brand); border-color: var(--_brand); }
.bf-def {
  margin-top: 10px; padding: 12px 14px; background: var(--_panel);
  border-left: 3px solid var(--_brand); border-radius: 0 8px 8px 0;
  font-size: 13px; line-height: 1.6; color: var(--_ink2);
}
.bf-def b { color: var(--_ink); }

/* dimension rows (rugs: many, each its own size) */
.bf-dims { margin-top: 12px; display: grid; gap: 8px; }
.bf-dim {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--_panel); border: 1px solid var(--_line);
  border-radius: 9px; padding: 10px 12px;
}
.bf-dim input[type=text], .bf-dim input[type=number] {
  border: 1px solid var(--_line2); border-radius: 7px; padding: 7px 9px;
  font-size: 14px; font-family: var(--_font); background: var(--_bg); color: var(--_ink);
  min-width: 0;
}
.bf-dim .lab { width: 64px; }
.bf-dim .num { width: 64px; text-align: center; font-family: var(--_mono); }
.bf-dim .x { color: var(--_muted); font-size: 13px; }
.bf-dim .area { font-family: var(--_mono); font-size: 13px; color: var(--_brand); min-width: 74px; }
.bf-dim .kill {
  margin-left: auto; border: 0; background: transparent; color: var(--_muted);
  font-size: 20px; cursor: pointer; width: 30px; height: 30px; line-height: 1;
}
.bf-dim .kill:hover { color: #c8342a; }
.bf-dim-sizes { display: flex; gap: 6px; }

/* ---------- sticky basket summary ---------- */
.bf-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 20px;
  background: var(--_bg); border: 1px solid var(--_line2);
  border-radius: var(--_r); padding: 14px 18px;
  box-shadow: var(--bf-bar-shadow, 0 -6px 20px rgba(0,0,0,.06));
}
.bf-bar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bf-bar .tot {
  font-family: var(--_display); font-weight: 700; font-size: 22px; color: var(--_ink);
}
.bf-bar .meta { color: var(--_muted); font-size: 13px; }
.bf-bar .grow { flex: 1; }
.bf-min { margin-top: 10px; }
.bf-min-track { height: 5px; background: var(--_panel); border-radius: 999px; overflow: hidden; }
.bf-min-fill { height: 100%; background: var(--_brand); transition: width .25s ease; }
.bf-min-note { font-size: 12px; color: var(--_muted); margin-top: 6px; }
.bf-min-note.met { color: var(--_brand); }

/* ---------- generic form / times / summary ---------- */
.bf-field { margin-bottom: 16px; }
.bf-field label {
  display: block; font-size: 13px; color: var(--_ink2); margin-bottom: 6px; font-weight: 600;
}
.bf-field input, .bf-field select, .bf-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--_line);
  border-radius: 9px; font-size: 15px; font-family: inherit;
  background: var(--_panel); color: var(--_ink);
}
.bf-field input:focus, .bf-field select:focus, .bf-field textarea:focus {
  outline: none; border-color: var(--_brand); background: var(--_bg);
}

.bf-times { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bf-time {
  border: 1px solid var(--_line); background: var(--_bg); color: var(--_ink);
  border-radius: 9px; padding: 9px 14px; cursor: pointer;
  font-family: var(--_mono); font-size: 14px;
}
.bf-time:hover { border-color: var(--_brand); color: var(--_brand); }
.bf-time.sel { background: var(--_brand); color: var(--_on); border-color: var(--_brand); }

.bf-summary {
  background: var(--_panel); border: 1px solid var(--_line);
  border-left: 3px solid var(--_brand); border-radius: var(--_r);
  padding: 18px; margin-bottom: 18px; font-size: 14px; color: var(--_ink2);
}
.bf-sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.bf-sum-line .q { color: var(--_muted); font-family: var(--_mono); font-size: 13px; }
.bf-summary .tot {
  display: flex; justify-content: space-between; font-family: var(--_display);
  font-weight: 700; font-size: 17px; color: var(--_ink);
  border-top: 1px solid var(--_line2); margin-top: 10px; padding-top: 10px;
}

.bf-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.bf-btn {
  background: var(--_brand); color: var(--_on); border: 0; border-radius: 999px;
  padding: 12px 26px; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--_font);
}
.bf-btn:disabled { opacity: .45; cursor: default; }
.bf-btn.ghost { background: transparent; color: var(--_ink2); border: 1px solid var(--_line2); }
.bf-muted { color: var(--_muted); font-size: 14px; }
.bf-err { color: #c8342a; font-size: 14px; margin-top: 10px; font-weight: 500; }

.bf-done { text-align: center; padding: 24px 0; }
.bf-done .tick {
  width: 64px; height: 64px; border-radius: 50%; background: var(--_panel);
  color: var(--_brand); display: grid; place-items: center; font-size: 32px;
  margin: 0 auto 16px;
}
.bf-ref {
  display: inline-block; margin-top: 12px; background: var(--_panel);
  border: 1px solid var(--_line); border-radius: 8px; padding: 6px 12px;
  font-family: var(--_mono); font-weight: 600;
}

@media (max-width: 560px) {
  .bf-card { padding: 18px 14px; }
  .bf-item-top { flex-wrap: wrap; }
  .bf-step-ctl { width: 100%; justify-content: flex-end; }
  .bf-actions { flex-direction: column-reverse; }
  .bf-actions .bf-btn { width: 100%; }
  .bf-dim .lab { width: 100%; }
}

/* size chip + its price + the "why" affordance read as one control */
.bf-size-label { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bf-size-label .bf-item-price { margin-top: 0; }

/* ---- promo code ---- */
/* Placed on the review step. A code box shown earlier reads as "you are paying
   too much" to everyone who has no code, and sends them hunting instead of
   booking. */
.bf-promo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.bf-promo input {
  flex: 1 1 160px; padding: 11px 12px; border: 1px solid var(--_line);
  border-radius: 9px; font-size: 15px; font-family: inherit;
  background: var(--_panel); color: var(--_ink); text-transform: uppercase;
}
.bf-promo input:focus { outline: none; border-color: var(--_brand); background: var(--_bg); }
.bf-promo.ok {
  justify-content: space-between; padding: 11px 12px; font-size: 14px;
  border: 1px solid var(--_ok-line); border-radius: var(--_r);
  background: var(--_ok-bg); color: var(--_ok);
}
.bf-sum-line.promo span:last-child { color: var(--_ok); font-weight: 600; }
.bf-err.small { font-size: 13px; flex-basis: 100%; }
.bf-link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--_muted); text-decoration: underline;
}
