/* Briddhi Furniture Builder v1.0.0
 * Change the brand colours and fonts in the variables below.
 * Everything is scoped to .bb-builder so it will not affect the rest of the website.
 */
.bb-builder {
  display: block;
  width: 100%;
  --bb-ink: #1F1C19;
  --bb-text: #3E3731;
  --bb-muted: #7B7167;
  --bb-teak: #B0682F;
  --bb-teak-dark: #8E5224;
  --bb-linen: #EFE9DF;
  --bb-sand: #E3D9CA;
  --bb-line: #D9CBB5;
  --bb-white: #FFFFFF;
  --bb-wa: #1FA855;
  --bb-danger: #B23C2A;
  --bb-radius: 14px;
  --bb-font: "Jost", "Futura", "Futura PT", "Century Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bb-font-bn: "Noto Sans Bengali", "Nirmala UI", "Vrinda", sans-serif;
  font-family: var(--bb-font);
  color: var(--bb-text);
  line-height: 1.4;
  max-width: 1320px;
  margin: 0 auto;
}
.bb-builder *, .bb-builder *::before, .bb-builder *::after { box-sizing: border-box; }
.bb-builder button { font: inherit; color: inherit; cursor: pointer; margin: 0; text-transform: none; letter-spacing: normal; box-shadow: none; }
.bb-builder button:disabled { opacity: .45; cursor: not-allowed; }
.bb-builder button:focus-visible, .bb-builder canvas:focus-visible { outline: 3px solid rgba(176,104,47,.55); outline-offset: 2px; }
.bb-builder h2, .bb-builder h3, .bb-builder p, .bb-builder ul { margin: 0; padding: 0; }
.bb-builder h2, .bb-builder h3 { font-family: var(--bb-font); letter-spacing: normal; text-transform: none; line-height: 1.2; }
.bb-builder .bb-app { font-family: var(--bb-font); font-size: 15px; }
.bb-builder ul { list-style: none; }

.bb-app { background: var(--bb-white); border: 1px solid var(--bb-line); border-radius: calc(var(--bb-radius) + 6px); padding: 22px; }
.bb-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.bb-builder .bb-title { font-family: var(--bb-font); font-size: clamp(22px, 2.6vw, 32px); font-weight: 700; color: var(--bb-ink); line-height: 1.15; }
.bb-sub { margin-top: 6px !important; color: var(--bb-muted); max-width: 640px; font-size: 15px; }
.bb-bn { margin-top: 4px !important; color: var(--bb-teak); font-family: var(--bb-font-bn); font-weight: 600; font-size: 15px; }
.bb-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.bb-main { display: grid; grid-template-columns: 282px minmax(0, 1fr) 290px; grid-template-areas: "palette stage summary"; gap: 20px; align-items: start; }
.bb-palette { grid-area: palette; }
.bb-stage { grid-area: stage; min-width: 0; }
.bb-summary { grid-area: summary; background: var(--bb-linen); border-radius: var(--bb-radius); padding: 18px; position: sticky; top: 16px; }

.bb-builder .bb-step { font-family: var(--bb-font); display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--bb-ink); margin: 0 0 10px !important; }
.bb-step span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--bb-teak); color: #fff; font-size: 13px; flex: none; }
.bb-palette .bb-step:not(:first-child) { margin-top: 20px !important; }

.bb-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-part { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 6px 10px; background: var(--bb-white); border: 1.5px solid var(--bb-line); border-radius: 12px; transition: border-color .15s, transform .15s, background .15s; }
.bb-part:hover { border-color: var(--bb-teak); transform: translateY(-1px); }
.bb-part.is-armed { border-color: var(--bb-teak); background: #FBF4EC; box-shadow: 0 0 0 3px rgba(176,104,47,.18); }
.bb-thumb { width: 100%; max-width: 120px; height: auto; aspect-ratio: 120 / 96; }
.bb-pname { font-weight: 700; color: var(--bb-ink); font-size: 14px; line-height: 1.2; }
.bb-pmeta { font-size: 11px; color: var(--bb-muted); }
.bb-pprice { font-size: 13px; color: var(--bb-teak); font-weight: 700; }

.bb-finishes { display: flex; flex-direction: column; gap: 6px; }
.bb-finish { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bb-white); border: 1.5px solid var(--bb-line); border-radius: 10px; text-align: left; font-size: 14px; }
.bb-finish.is-on { border-color: var(--bb-teak); background: #FBF4EC; font-weight: 700; color: var(--bb-ink); }
.bb-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); flex: none; }

.bb-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 9px 16px; border: 1.5px solid transparent; font-size: 14px; font-weight: 600; line-height: 1.1; transition: background .15s, border-color .15s, color .15s; }
.bb-ghost { background: var(--bb-white); border-color: var(--bb-line); color: var(--bb-ink); }
.bb-ghost:hover:not(:disabled) { border-color: var(--bb-teak); color: var(--bb-teak-dark); }
.bb-icon { padding: 9px 12px; }
.bb-chip { background: var(--bb-linen); border-color: var(--bb-linen); color: var(--bb-ink); padding: 8px 14px; }
.bb-chip:hover { border-color: var(--bb-teak); }
.bb-builder .bb-primary { background: var(--bb-wa); color: #fff !important; width: 100%; padding: 14px 16px; font-size: 16px; margin-top: 14px; }
.bb-primary:hover:not(:disabled) { background: #178C46; }
.bb-primary svg { width: 22px; height: 22px; }
.bb-builder .bb-wide { width: 100%; margin-top: 8px; }
.bb-danger { background: var(--bb-white); border-color: #E6B9B0; color: var(--bb-danger); }
.bb-danger:hover { background: #FBEDEA; }
.bb-link { background: none; border: 0; padding: 0; color: var(--bb-teak-dark); text-decoration: underline; font-weight: 700; }

.bb-hint { background: var(--bb-linen); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 10px; min-height: 42px; }
.bb-hint strong { color: var(--bb-ink); }
.bb-canvaswrap { position: relative; width: 100%; border-radius: var(--bb-radius); overflow: hidden; background: var(--bb-linen); }
.bb-canvas { display: block; width: 100%; touch-action: manipulation; cursor: pointer; }
.bb-toast { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -10px); background: var(--bb-ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 92%; text-align: center; }
.bb-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.bb-toast.is-warn { background: var(--bb-danger); }

.bb-inspector { margin-top: 12px; border: 1.5px solid var(--bb-teak); border-radius: 12px; padding: 12px 14px; background: #FFFBF6; }
.bb-insp-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; padding-right: 30px; position: relative; }
.bb-insp-head strong { color: var(--bb-ink); }
.bb-x { position: absolute; right: -4px; top: -6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; font-size: 22px !important; line-height: 1; color: var(--bb-muted); }
.bb-insp-fin { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bb-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); padding: 0; }
.bb-dot.is-on { border-color: var(--bb-ink); box-shadow: 0 0 0 3px var(--bb-white) inset; }
.bb-insp-act { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.bb-size { font-size: 14px; color: var(--bb-text); margin-bottom: 10px; }
.bb-size strong { color: var(--bb-ink); }
.bb-size span { color: var(--bb-muted); font-size: 12px; }
.bb-lines li { display: grid; grid-template-columns: 34px 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--bb-line); font-size: 14px; }
.bb-lines li.bb-empty { display: block; color: var(--bb-muted); border: 0; }
.bb-q { color: var(--bb-muted); font-weight: 600; }
.bb-l { color: var(--bb-ink); font-weight: 600; }
.bb-l small { display: block; color: var(--bb-muted); font-weight: 400; font-size: 12px; }
.bb-v { font-weight: 600; white-space: nowrap; }
.bb-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.bb-total span { font-weight: 700; color: var(--bb-ink); font-size: 16px; }
.bb-total strong { font-size: 30px; color: var(--bb-teak); font-weight: 700; font-variant-numeric: tabular-nums; }
.bb-note { font-size: 12px; color: var(--bb-muted); margin-top: 6px !important; }
.bb-note-strong { color: var(--bb-text); font-size: 13px; }
.bb-tips { margin-top: 12px !important; }
.bb-tips li { font-size: 13px; background: var(--bb-white); border-left: 3px solid var(--bb-teak); padding: 7px 10px; border-radius: 6px; margin-top: 6px; }

/* Sticky total bar for phones */
.bb-bar { display: none; position: sticky; bottom: 0; z-index: 5; margin: 14px -14px -14px; padding: 10px 14px; background: rgba(255,255,255,.96); border-top: 1px solid var(--bb-line); align-items: center; justify-content: space-between; gap: 10px; border-radius: 0 0 var(--bb-radius) var(--bb-radius); }
.bb-bar span { font-size: 14px; color: var(--bb-muted); }
.bb-bar strong { display: block; font-size: 22px; color: var(--bb-teak); font-variant-numeric: tabular-nums; }
.bb-bar .bb-btn { background: var(--bb-wa); color: #fff; padding: 12px 16px; }

/* Medium width (tablet, or a narrow theme column): summary goes under the builder.
   The size is set by the script from the width of the builder itself, not the screen. */
.bb-app[data-size="m"] .bb-main { grid-template-columns: 282px minmax(0, 1fr); grid-template-areas: "palette stage" "summary summary"; }
.bb-app[data-size="m"] .bb-summary { position: static; }
/* Small width (phone, or a very narrow column): parts on top in a scrolling row, then the builder, then the summary */
.bb-app[data-size="s"] { padding: 14px; border-radius: var(--bb-radius); }
.bb-app[data-size="s"] .bb-head { margin-bottom: 12px; }
.bb-app[data-size="s"] .bb-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "palette" "stage" "summary"; gap: 14px; }
.bb-app[data-size="s"] .bb-summary { position: static; }
.bb-app[data-size="s"] .bb-parts { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.bb-app[data-size="s"] .bb-part { flex: 0 0 112px; scroll-snap-align: start; padding: 6px 4px 8px; }
.bb-app[data-size="s"] .bb-thumb { max-width: 90px; }
.bb-app[data-size="s"] .bb-pmeta { display: none; }
.bb-app[data-size="s"] .bb-finishes { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
.bb-app[data-size="s"] .bb-finish { flex: none; }
.bb-app[data-size="s"] .bb-palette .bb-step:not(:first-child) { margin-top: 14px !important; }
.bb-app[data-size="s"] .bb-bar { display: flex; }

/* Optional: [briddhi_builder layout="full"] breaks out of a narrow theme column */
.bb-builder.bb-full { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); padding: 0 16px; }
.bb-builder.bb-full .bb-app { max-width: 1320px; margin: 0 auto; }

