/* ════════════════════════════════════════════════════════
   bouquet-builder.css — конструктор авторского букета

   Раскладка — как карточка товара (product.css): крошки, 50/50,
   прилипающий эскиз слева. Слева — раскраска, справа — четыре шага.
   ════════════════════════════════════════════════════════ */
body.bouquet-builder-page {
  padding-top: var(--paloma-header-offset, calc(34px + 88px));
}
.bb {
  --bb-ink: #2b2522;
  --bb-line: rgba(27, 26, 24, 0.1);
  --bb-line-strong: rgba(27, 26, 24, 0.2);
  --bb-muted: rgba(27, 26, 24, 0.58);
  --bb-accent: #E7385A;
  --bb-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
main.bb { overflow: visible; overflow-x: clip; }

/* ── раскраска ───────────────────────────────────────── */
.bb .pdp-gallery { top: calc(var(--bb-head, 88px) + 24px); }
.bb-canvas { background: #FBF9F6; }
.bb-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 3% 4%; box-sizing: border-box; }
#bbArt path.f {
  fill: #FFFFFF; stroke: var(--bb-ink); stroke-width: 1.15px;
  stroke-linejoin: round; stroke-linecap: round;
  transition: fill .9s var(--bb-ease) var(--d, 0ms);
}
#bbArt path.l { fill: none; stroke: var(--bb-ink); stroke-width: .8px; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
#bbArt path.film { fill-opacity: .66; }
#bbArt path.mass { stroke: none; }
#bbArt path.thin { stroke-width: .75px; }
#bbArt .bb-shadow { fill: rgba(27, 26, 24, 0.06); stroke: none; }
#bbArt text { font-family: var(--logo, var(--font-display, "Italiana")), serif; fill: var(--bb-ink); }
#bbArt .bb-g { animation: bbIn .45s ease both; }
@keyframes bbIn { from { opacity: 0; } }

.bb-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2;
  margin: 0; padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 6px 20px -10px rgba(27, 26, 24, 0.3);
  font-size: 12px; color: var(--bb-ink);
  animation: bbHint 2.4s ease-in-out infinite;
}
.bb-hint[hidden] { display: none; }
@keyframes bbHint { 50% { transform: translate(-50%, -3px); } }
.bb-shuffle {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--bb-line-strong); background: rgba(255, 255, 255, 0.92); color: var(--bb-ink); cursor: pointer;
  transition: border-color .22s, transform .4s var(--bb-ease);
}
.bb-shuffle:hover { border-color: var(--bb-ink); transform: rotate(-20deg); }
.bb-shuffle svg { position: absolute; inset: 0; margin: auto; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bb-toast {
  position: absolute; left: 50%; top: 16px; z-index: 3; transform: translate(-50%, -8px);
  padding: 11px 16px; border-radius: 6px; background: var(--color-text, #1B1A18); color: #FFFFFF;
  font-size: 13px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .35s ease;
}
.bb-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.bb-caption { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--bb-muted); text-align: center; }

/* ── четыре шага ─────────────────────────────────────── */
.bb-panel .pdp-info__name { margin-bottom: 12px; }
.bb-lead { margin: 0 0 26px; font-size: 15px; line-height: 1.6; color: var(--bb-muted); }
.bb-step { padding: 22px 0 24px; border-top: 1px solid var(--bb-line); }
.bb-step__head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.bb-step__n { font-family: var(--font-mono, var(--mono, "JetBrains Mono"), monospace); font-size: 11px; letter-spacing: .14em; color: var(--bb-accent); }
.bb-step__t { margin: 0; font-family: var(--font-sans, var(--sans, "Manrope"), sans-serif); font-size: 16px; font-weight: 500; letter-spacing: .01em; color: var(--color-text, #1B1A18); }
.bb-step__v { margin-left: auto; font-size: 13px; color: var(--bb-muted); text-align: right; }
.bb-sub { margin: -6px 0 12px; font-size: 13px; color: var(--bb-muted); }
.bb-sub--gap { margin: 20px 0 10px; }

.bb-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bb-size {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 4px 11px; border: 1px solid var(--bb-line-strong); border-radius: 14px;
  background: #FFFFFF; color: var(--color-text, #1B1A18); cursor: pointer; font: inherit;
  transition: border-color .22s, box-shadow .22s, background .22s;
}
.bb-size b { font-family: var(--font-sans, var(--sans, "Manrope")), sans-serif; font-size: 18px; font-weight: 500; line-height: 1.2; letter-spacing: .04em; }
.bb-size span { font-size: 11px; color: var(--bb-muted); }
.bb-size em { font-style: normal; font-size: 12px; font-weight: 500; margin-top: 4px; }
.bb-size:hover { border-color: var(--bb-ink); }
.bb-size.is-active { border-color: var(--bb-ink); box-shadow: inset 0 0 0 1px var(--bb-ink); }

.bb-pals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bb-pal {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 4px 10px; border: 1px solid transparent; border-radius: 14px;
  background: none; cursor: pointer; font: inherit; color: var(--color-text, #1B1A18);
  transition: border-color .22s, background .22s;
}
.bb-pal { min-width: 0; }
.bb-pal:hover { background: #FAF7F3; }
.bb-pal.is-active { border-color: var(--bb-ink); background: #FFFFFF; }
.bb-pal__dots { display: flex; }
.bb-pal__dots i { width: 22px; height: 22px; border-radius: 50%; margin-left: -7px; box-shadow: 0 0 0 2px #FFFFFF, inset 0 0 0 1px rgba(27, 26, 24, .1); }
.bb-pal__dots i:first-child { margin-left: 0; }
.bb-pal__name { font-size: 11px; line-height: 1.25; text-align: center; color: var(--bb-muted); }
.bb-pal.is-active .bb-pal__name { color: var(--color-text, #1B1A18); }

.bb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-chips .pdp-size-btn.is-muted { opacity: .4; }

.bb-wraps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bb-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px 12px; border: 1px solid var(--bb-line-strong); border-radius: 14px;
  background: #FFFFFF; color: var(--color-text, #1B1A18); cursor: pointer; font: inherit;
  transition: border-color .22s, box-shadow .22s;
}
.bb-wrap svg { width: 30px; height: 30px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.bb-wrap b { font-size: 13px; font-weight: 500; }
.bb-wrap em { font-style: normal; font-size: 11px; color: var(--bb-muted); }
.bb-wrap:hover { border-color: var(--bb-ink); }
.bb-wrap.is-active { border-color: var(--bb-ink); box-shadow: inset 0 0 0 1px var(--bb-ink); }

.bb-buy {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 18px 0; border-top: 1px solid var(--bb-line); background: #FFFFFF;
}
.bb-buy__sum span { display: block; font-family: var(--font-mono, var(--mono, "JetBrains Mono"), monospace); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--bb-muted); }
.bb-buy__sum b { display: block; margin-top: 4px; font-family: var(--font-mono, var(--mono, "JetBrains Mono"), monospace); font-size: 20px; font-weight: 500; white-space: nowrap; }
.bb-buy__btn { flex: 1; padding: 17px 20px; font-size: 12px; letter-spacing: .18em; }
.bb-note { margin: 4px 0 0; font-size: 12px; line-height: 1.55; color: var(--bb-muted); }

.bb-dialog .pdp-size-btn[aria-pressed="true"],
.bb-dialog .bb-msgr input:checked + .pdp-size-btn {
  background: var(--color-text, #1B1A18); color: #FFFFFF; border-color: var(--color-text, #1B1A18);
}
.bb-cardtext { margin-bottom: 14px; }

/* Поля — рамка и радиус как у пилюль сайта */
.bb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bb-field { display: flex; flex-direction: column; margin: 0 0 18px; }
.bb .bb-input, .bb-dialog .bb-input {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 13px 18px;
  border: 1px solid var(--bb-line-strong, rgba(27, 26, 24, 0.22)); border-radius: 24px;
  background: #FFFFFF; color: var(--color-text, #1B1A18);
  font-family: inherit; font-size: 14px; line-height: 1.4; resize: none;
  transition: border-color .22s;
}
.bb .bb-input:focus, .bb-dialog .bb-input:focus { outline: none; border-color: var(--color-text, #1B1A18); }
.bb-check { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; cursor: pointer; }
.bb-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--color-text, #1B1A18); }
.bb-check--small { font-size: 12px; color: var(--bb-muted, rgba(27, 26, 24, 0.65)); }
.bb-check--small a { color: inherit; }


/* ── окно отправки ────────────────────────────────────── */
.bb-dialog {
  --bb-line: rgba(27, 26, 24, 0.1); --bb-line-strong: rgba(27, 26, 24, 0.22); --bb-muted: rgba(27, 26, 24, 0.65); --bb-accent: #E7385A;
  position: fixed; inset: 0; margin: auto; height: fit-content; box-sizing: border-box;
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  padding: 36px 32px 32px; border: 0; border-radius: 12px; background: #FFFFFF; color: #1B1A18;
  font-family: var(--sans, "Montserrat", sans-serif);
  box-shadow: 0 30px 80px -30px rgba(27, 26, 24, 0.45);
}
.bb-dialog[open] { animation: bbDlg .45s cubic-bezier(0.22, 1, 0.36, 1); }
.bb-dialog::backdrop { background: rgba(27, 26, 24, 0.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes bbDlg { from { opacity: 0; transform: translateY(16px); } }
.bb-dialog__close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--bb-line-strong); background: #FFFFFF; cursor: pointer; display: grid; place-items: center;
  transition: background .22s, border-color .22s, color .22s;
}
.bb-dialog__close:hover { background: var(--bb-accent); border-color: var(--bb-accent); color: #FFFFFF; }
.bb-dialog__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.bb-dialog__title {
  margin: 0 0 18px; padding-right: 44px;
  font-size: clamp(26px, 3vw, 34px); font-weight: 400; line-height: 1; letter-spacing: -0.02em;
}
.bb-compose { margin-bottom: 18px; }
.bb-compose .pdp-info__row:last-of-type { margin-bottom: 0; }
.bb-dialog__price { margin: 0 0 22px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bb-muted); }
.bb-dialog__price b { display: block; margin-top: 6px; font-size: 24px; font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: #1B1A18; }
.bb-msgr label { cursor: pointer; }
.bb-msgr input { position: absolute; opacity: 0; pointer-events: none; }
.bb-msgr input:focus-visible + .pdp-size-btn { outline: 2px solid var(--bb-accent); outline-offset: 2px; }
.bb-form__error { min-height: 16px; margin: 4px 0 12px; font-size: 12px; color: #C82847; }
.bb-form__submit { width: 100%; padding: 16px; font-size: 12px; letter-spacing: 0.18em; }
.bb-form__submit.is-busy { opacity: .6; pointer-events: none; }
.bb-done { position: relative; text-align: center; }
.bb-done .bb-dialog__title { padding: 0; }
.bb-done .pdp-info__desc { max-width: 34ch; margin: 0 auto 24px; }
.bb-done__bouquet { width: 180px; margin: 0 auto 16px; animation: bbFloat 3.5s ease-in-out infinite; }
.bb-done__bouquet svg { display: block; width: 100%; height: auto; }
@keyframes bbFloat { 50% { transform: translateY(-6px) rotate(1.5deg); } }
.bb-petals { position: absolute; inset: -36px -32px auto; height: 420px; overflow: hidden; pointer-events: none; }
.bb-petals i {
  position: absolute; top: -20px; left: var(--x); width: 10px; height: 14px; border-radius: 60% 0 60% 0;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(27, 26, 24, .12);
  transform: rotate(var(--r)); animation: bbPetal var(--dur) var(--del) cubic-bezier(.3, .1, .5, 1) forwards;
}
@keyframes bbPetal { to { transform: translate(30px, 440px) rotate(calc(var(--r) + 540deg)); opacity: 0; } }

/* ── адаптив ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .bb .pdp-layout { gap: 20px; }
  .bb-canvas { aspect-ratio: 1 / 1; }
  .bb-caption { display: none; }
  .bb-row2 { grid-template-columns: 1fr; gap: 0; }
  .bb-buy { padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .bb-sizes, .bb-pals { gap: 6px; }
  .bb-size b { font-size: 16px; }
  .bb-pal__dots i { width: 18px; height: 18px; margin-left: -6px; }
  .bb-buy { gap: 12px; }
  .bb-buy__sum b { font-size: 17px; }
  .bb-buy__btn { padding: 16px 12px; letter-spacing: .12em; }
  .bb-dialog { padding: 30px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .bb *, .bb-dialog * { animation: none !important; transition: none !important; }
}
#bbArt text.bb-rib { font-family: var(--font-sans, "Manrope"), sans-serif; font-weight: 500; fill: #8C7B6A; }

#bbArt text.bb-print { font-family: var(--logo, var(--font-display, "Italiana")), serif; fill: #8C857D; opacity: .45; }
.bb-more {
  display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 0;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--color-text, #1B1A18);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(27, 26, 24, .3);
}
.bb-more:hover { color: var(--bb-accent); }
.bb-chips--more { margin-top: 12px; }
.bb-picked { display: contents; }
.bb-search { margin-top: 12px; }
.bb-found:not(:empty) { margin-top: 12px; }
