/*
 * builder.css — конструктор букетов (src/web/pages/builder.ts, static/builder.js).
 * Каркас — карточка букета (.bq из app.css): слева вместо фото сцена, справа колонка.
 * Токены, кнопки, чипы, состав — из app.css; здесь только сцена, карточки цветов и состояния.
 * Параллакс: сцена задаёт --px/--py (сдвиг в px), у слоя --d — глубина; внутри букета делим на
 * масштаб букета --k. Сдвиг — свойством translate, чтобы не спорить с transform раскладки.
 */

/* Страница не увеличивается двойным тапом (щипок гасит builder.js) */
html { touch-action: manipulation; }

.bb {
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.34, 1.5, 0.5, 1);
  --move: 0.75s;
}

/* ===== Сцена ========================================================= */
/* Телефон: сцена закреплена сверху — цветы выбирают под ней и видят букет. На компьютере она липнет с
   отступом, как фото карточки (.bq-media). */
.bb-media { position: sticky; top: 0; z-index: 10; }
.bb-stage {
  position: relative; height: min(52svh, 112vw);
  border-radius: 0 0 var(--radius-4xl) var(--radius-4xl);
  box-shadow: 0 10px 28px rgb(25 21 22 / 0.07);
  overflow: hidden;
}
.bb-scene {
  position: absolute; inset: 0; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 34%, #fff 0%, #fdf9f8 40%, color-mix(in srgb, var(--accent) 10%, #f7efef) 100%);
  --px: 0; --py: 0;
}
@media (min-width: 1024px) {
  /* Справа — три карточки цветов в ряд, остальное — сцене, пока она помещается в экран по высоте
     (владелец, 2026-11-16). Открытая форма сжимает сцену до четверти, как у букета (app.css §12). */
  .bq.bb { grid-template-columns: min(100dvh - 140px, 100% - 520px) minmax(480px, 1fr); }
  .bb-media { z-index: auto; top: var(--space-4xl); }
  .bb-stage {
    height: auto; aspect-ratio: 1; padding: 6px;
    border-radius: var(--radius-2xl); background: var(--card); box-shadow: var(--shadow-card); overflow: visible;
  }
  .bb-scene { inset: 6px; border-radius: var(--radius-lg); }
}

/* Пятна цвета на фоне — как свечение заглушки плитки, только медленнее */
.bb-aurora i {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  translate: calc(var(--px) * -0.6px) calc(var(--py) * -0.6px);
  animation: bb-drift 22s ease-in-out infinite alternate;
}
.bb-aurora i:nth-child(1) { left: -22%; top: -18%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.bb-aurora i:nth-child(2) { right: -26%; top: 8%; background: radial-gradient(closest-side, rgb(255 214 170 / 0.38), transparent); animation-duration: 27s; animation-direction: alternate-reverse; }
.bb-aurora i:nth-child(3) { left: 14%; bottom: -34%; background: radial-gradient(closest-side, color-mix(in oklch, var(--accent) 40%, var(--color-blue-500)) 0%, transparent); opacity: 0.16; animation-duration: 31s; }
@keyframes bb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(8%, 6%) scale(1.12); }
}

/* Тень под букетом — букет «висит» в студии */
.bb-floor {
  position: absolute; left: 50%; top: var(--floor-y, 80%); width: var(--floor-w, 40%); height: calc(var(--floor-w, 200px) * 0.14);
  translate: calc(-50% + var(--px) * 0.3px) -50%;
  background: radial-gradient(closest-side, rgb(90 40 55 / 0.16), transparent);
  transition: top var(--move) var(--ease), width var(--move) var(--ease), height var(--move) var(--ease);
}

/* ===== Букет ========================================================= */
/* Раскладка — в builder.js: у каждого цветка transform (место, поворот вдоль стебля, сплющивание к краю
   купола), --b — свет по глубине, --d — глубина для параллакса. */
.bb-bouquet { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform 0.8s var(--ease); --k: 1; }
.bb-bouquet.bb-snap { transition: none; } /* новый размер сцены после открытия и закрытия формы */
.bb-sway { position: absolute; left: 0; top: 0; rotate: var(--sway, 0deg); }
.bb-items { position: absolute; left: 0; top: 0; z-index: 3; }
.bb-it, .bb-paper { position: absolute; left: 0; top: 0; }
/* Сдвиг параллакса — у головки и у стебля по отдельности: у .bb-it нет своего слоя (ни сдвига, ни z-index),
   поэтому стебли всех цветков лежат под всеми головками, как в настоящем букете, а не поверх соседей.
   Головка сдвигается по своей глубине (дальние меньше), стебель — с бумагой и бантом (глубина 1): низ
   стебля держится узла, а верх прячется под головкой. */
.bb-paper, .bb-it__pos {
  translate: calc(var(--px) * var(--d) / var(--k) * 1px) calc(var(--py) * var(--d) / var(--k) * 1px);
}
.bb-it__stem { translate: calc(var(--px) / var(--k) * 1px) calc(var(--py) / var(--k) * 1px); }
.bb-it__pos {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  transition: transform var(--move) var(--ease);
}
.bb-it__img {
  position: absolute; max-width: none; height: auto;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
  cursor: grab;
  transition: width var(--move) var(--ease), left var(--move) var(--ease), top var(--move) var(--ease), opacity 0.2s, filter 0.4s;
}
.bb-it--head .bb-it__img { filter: var(--tint,) brightness(var(--b, 1)) drop-shadow(0 5px 7px rgb(70 25 40 / 0.22)); transform-origin: 50% 50%; }
.bb-it--stem .bb-it__img { filter: var(--tint,) brightness(var(--b, 1)) drop-shadow(0 3px 4px rgb(40 50 30 / 0.14)); transform-origin: 50% 100%; }
/* Дальние цветки и зелень по краю чуть размыты (--bl, builder.js). Блюр — только в этом классе: картинку
   с blur(0px) в фильтре Safari рисует белым прямоугольником. */
.bb-it--far.bb-it--head .bb-it__img { filter: var(--tint,) blur(var(--bl)) brightness(var(--b, 1)) drop-shadow(0 5px 7px rgb(70 25 40 / 0.22)); }
.bb-it--far.bb-it--stem .bb-it__img { filter: var(--tint,) blur(var(--bl)) brightness(var(--b, 1)) drop-shadow(0 3px 4px rgb(40 50 30 / 0.14)); }
/* Стебель — от головки до узла ленты, под всеми головками: виден в просветах и над краем бумаги */
.bb-it__stem {
  position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 50% 0; border-radius: 3px; pointer-events: none;
  background: linear-gradient(90deg, #3d5729, #7a9a54 42%, #5b793e 70%, #3a5227);
  filter: brightness(var(--b, 1));
  transition: transform var(--move) var(--ease), height var(--move) var(--ease), width var(--move) var(--ease), opacity 0.2s;
}
.bb-fresh .bb-it__pos, .bb-fresh .bb-it__img, .bb-fresh .bb-it__stem { transition: none; }
.bb-hide .bb-it__img, .bb-hide .bb-it__stem { opacity: 0; }
/* цель обмена: подсвечена и чуть приподнята */
.bb-it.bb-target .bb-it__img { /* сильнее размытия дальних (.bb-it--far) */
  scale: 1.08;
  filter: brightness(1.06) drop-shadow(0 0 3px #fff) drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 85%, transparent));
  transition: scale 0.25s var(--spring), filter 0.25s;
}

/* появился — распускается; прилетел — пружинит; убрали — улетает вверх */
/* backwards, не both: после анимации её значения не должны перебивать .bb-hide и подсветку цели */
.bb-pop .bb-it__img { animation: bb-pop 0.6s var(--spring) var(--delay, 0ms) backwards; }
.bb-pop .bb-it__stem { animation: bb-fade 0.5s var(--delay, 0ms) backwards; }
.bb-land .bb-it__img { animation: bb-land 0.5s var(--spring); }
.bb-leave { pointer-events: none; }
.bb-leave .bb-it__img { animation: bb-leave 0.4s ease-in forwards; }
.bb-leave .bb-it__stem { opacity: 0; }
@keyframes bb-pop { from { scale: 0.2; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes bb-fade { from { opacity: 0; } }
@keyframes bb-land { 0% { scale: 1.14; } 100% { scale: 1; } }
@keyframes bb-leave { to { scale: 0.4; opacity: 0; translate: 0 -30px; } }

/* Упаковка — сгенерированные слои: задние листы под цветами, передний конус, стебли и бант — над ними.
   Место и ширину (у.е.) ставит builder.js; max-width: none — глобальное img { max-width: 100% } сжало бы
   картинку в контейнере нулевой ширины. */
.bb-paper--stems { z-index: 2; pointer-events: none; }
.bb-paper--front { z-index: 4; pointer-events: none; }
/* пучок стеблей за цветами: верх растворяется, чтобы срезы не мелькали в просветах */
.bb-stems-img { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 34%); mask-image: linear-gradient(to bottom, transparent, #000 34%); }
.bb-wrap-img {
  position: absolute; max-width: none; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none;
  transition: left var(--move) var(--ease), top var(--move) var(--ease), width var(--move) var(--ease), height var(--move) var(--ease);
}
.bb-wrap-img[hidden] { display: none; }
.bb-paper--front .bb-wrap-img { filter: drop-shadow(0 -2px 6px rgb(70 40 30 / 0.16)); }
.bb-bow { filter: drop-shadow(0 4px 6px rgb(90 30 50 / 0.25)); }

/* ===== Воздух: лепестки и искры ===================================== */
.bb-petals { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* Лепесток: снаружи плывёт вверх-вниз, внутри (b) поворачивается. Анимируется только transform с
   постоянными кадрами — так её ведёт видеокарта, без перерисовки; свой угол — свойство rotate. */
.bb-petal {
  position: absolute; width: 12px; height: 16px; pointer-events: none;
  opacity: 0.7; scale: var(--s);
  translate: calc(var(--px) * var(--d) * 1px) calc(var(--py) * var(--d) * 1px);
  animation: bb-rise var(--du, 14s) ease-in-out var(--dl, 0s) infinite alternate;
}
.bb-petal b {
  display: block; width: 100%; height: 100%; rotate: var(--r);
  border-radius: 80% 8% 80% 8% / 80% 8% 80% 8%;
  background: linear-gradient(135deg, #ffe1ea, color-mix(in srgb, var(--accent) 65%, #fff));
  animation: bb-spin var(--du, 14s) ease-in-out var(--dl, 0s) infinite alternate;
}
.bb-petal--near { z-index: 4; filter: blur(3px); opacity: 0.45; }
@keyframes bb-rise { to { transform: translateY(-26px); } }
@keyframes bb-spin { to { transform: rotate(60deg); } }

/* Телефон (без мыши): сцена неподвижна, летают только лепестки — постоянная перерисовка грела телефон
   (владелец, 2026-11-09). Ближние лепестки без размытия, плашки без backdrop-filter: иначе каждый кадр с
   лепестком под плашкой фон размывался бы заново. Параллакс с покачиванием — только с мышью (builder.js). */
@media (hover: none), (pointer: coarse) {
  .bb-aurora i { animation: none; }
  .bb-petal--near { filter: none; opacity: 0.3; }
  .bb-tool, .bb-rough, .bb-greens { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .bb-tool { background: rgb(255 255 255 / 0.85); }
  .bb-greens { background: rgb(255 255 255 / 0.94); }
  .bb-rough { background: rgb(255 255 255 / 0.55); }
  /* 10 с без касаний — лепестки замирают: бесконечная анимация держит экран в перерисовке (builder.js) */
  .bb.is-idle .bb-petal, .bb.is-idle .bb-petal b { animation-play-state: paused; }
}
.bb-spark {
  position: absolute; z-index: 6; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 20%, color-mix(in srgb, var(--accent) 80%, #fff));
  animation: bb-spark 0.7s ease-out forwards;
}
@keyframes bb-spark {
  from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  to { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.2); opacity: 0; }
}

/* ===== Подписи и кнопки на сцене ===================================== */
.bb-empty {
  position: absolute; left: 50%; top: 34%; z-index: 5; translate: -50% -50%;
  width: min(15em, 80%); text-align: center; text-wrap: balance;
  font: 300 clamp(16px, 2vw, 19px) / 1.45 var(--font-display); color: var(--text-secondary);
  pointer-events: none;
}
.bb-empty[hidden] { display: none; }
.bb-tools { position: absolute; top: var(--space-2xl); right: var(--space-2xl); z-index: 8; display: flex; gap: var(--space-base); }
@media (min-width: 1024px) { .bb-tools { top: calc(6px + var(--space-2xl)); right: calc(6px + var(--space-2xl)); } }
.bb-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--space-2xl);
  border: 0; border-radius: var(--radius-full); color: var(--text);
  background: rgb(255 255 255 / 0.62); -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6);
  box-shadow: 0 2px 8px rgb(25 21 22 / 0.08);
  font-size: var(--fs-label); font-weight: var(--fw-medium); white-space: nowrap;
}
.bb-tool { cursor: pointer; transition: color var(--dur), scale var(--dur); }
.bb-tool > span { color: var(--accent); font-size: 15px; }
.bb-tool:active { scale: 0.95; }
.bb-tool--icon { width: 40px; padding: 0; justify-content: center; color: var(--color-gray-700); }
@media (hover: hover) { .bb-tool:hover { color: var(--accent); } }

/* Оформление (владелец, 2026-11-17): форма сборки уходит, на сцене вместо «Собрать за меня» и корзины —
   «Изменить букет», он закрывает форму. */
.bb-tool--edit { display: none; }
.bb.is-checkout .bb-tool--edit { display: inline-flex; }
.bb.is-checkout :is([data-surprise], [data-clear], [data-config], [data-buy], [data-greens], [data-tip]) { display: none; }
/* Низ сцены, слева: совет добавить зелень, под ним — полупрозрачное предупреждение, что картинка лишь
   набросок (владелец, 2026-11-09). На телефоне букет вписывается над ними. Пока тянут цветок, низ
   занимают подсказки. */
.bb-foot {
  position: absolute; left: var(--space-2xl); right: var(--space-2xl); bottom: var(--space-2xl); z-index: 8;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  pointer-events: none; transition: opacity 0.2s;
}
@media (min-width: 1024px) { .bb-foot { left: calc(6px + var(--space-2xl)); right: calc(6px + var(--space-2xl)); bottom: calc(6px + var(--space-2xl)); } }
.bb-rough {
  display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 6px var(--space-lg) 6px 8px;
  border-radius: 14px; background: rgb(255 255 255 / 0.4); opacity: 0.8;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: var(--fs-sm); line-height: 16px; color: var(--text-secondary); text-wrap: balance;
}

/* Совет флориста: в букете от трёх цветов нет зелени — предлагаем её одной кнопкой */
.bb-greens {
  display: flex; align-items: center; gap: var(--space-base); max-width: 26em; padding: 6px 4px 6px 6px;
  border-radius: 18px; background: rgb(255 255 255 / 0.8);
  -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6);
  box-shadow: 0 2px 10px rgb(25 21 22 / 0.1);
  font-size: 13px; line-height: 17px; color: var(--text-secondary); pointer-events: auto;
  animation: bb-greens-in 0.4s var(--ease) both;
}
.bb-greens[hidden] { display: none; }
@media (max-width: 1023.98px) { .bb-greens { align-self: stretch; max-width: none; } }
@keyframes bb-greens-in { from { opacity: 0; translate: 0 8px; } }
.bb-greens__img { flex: none; width: 36px; height: 36px; object-fit: contain; }
.bb-greens__text { margin: 0; flex: 1; text-wrap: pretty; }
.bb-greens__text b { color: var(--text); font-weight: var(--fw-semibold); }
.bb-greens__add {
  flex: none; height: 32px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-full); cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: var(--fw-semibold);
}
.bb-greens__add:active { scale: 0.95; }
.bb-greens__close {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--text-tertiary); cursor: pointer;
}

/* Перетаскивание: из карточки — сцена ждёт цветок; из букета — кольцо: за ним цветок уберут */
.bb-drop, .bb-out, .bb-swap {
  position: absolute; left: 50%; bottom: var(--space-2xl); z-index: 8; translate: -50% 8px;
  padding: var(--space-base) var(--space-2xl); border-radius: var(--radius-full);
  background: rgb(25 21 22 / 0.78); color: #fff; font-size: var(--fs-label); white-space: nowrap;
  opacity: 0; transition: opacity 0.2s, translate 0.2s; pointer-events: none;
}
.bb.is-dragging-in .bb-drop, .bb.is-dragging-out:not(.is-swap) .bb-out, .bb.is-swap .bb-swap { opacity: 1; translate: -50% 0; }
.bb-swap { background: var(--accent); }
.bb.is-dragging-in .bb-foot, .bb.is-dragging-out .bb-foot { opacity: 0; }
.bb-scene::after {
  content: ""; position: absolute; inset: 10px; z-index: 7; border-radius: var(--radius-lg); pointer-events: none;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0; transition: opacity 0.2s, background-color 0.2s;
}
.bb.is-dragging-in .bb-scene::after { opacity: 1; }
.bb.is-over .bb-scene::after { border-style: solid; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.bb-ring {
  position: absolute; left: var(--ring-x, 50%); top: var(--ring-y, 40%); z-index: 7; width: var(--ring, 300px); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; pointer-events: none;
  border: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  opacity: 0; transition: opacity 0.2s, border-color 0.2s;
}
.bb.is-dragging-out .bb-ring { opacity: 1; }
.bb.is-out .bb-ring { border-color: var(--danger); }

/* Летящий цветок и цветок под пальцем — поверх всей страницы */
.bb-flyer, .bb-ghost {
  position: fixed; z-index: 100; max-width: none; height: auto; pointer-events: none;
  filter: drop-shadow(0 14px 18px rgb(70 25 40 / 0.25));
}
.bb-ghost { left: 0; top: 0; will-change: transform; transition: opacity 0.2s, filter 0.2s; }
.bb-ghost.is-out { opacity: 0.5; filter: var(--tint,) grayscale(0.7) drop-shadow(0 8px 10px rgb(0 0 0 / 0.2)); }
.bb-ghost.is-gone { opacity: 0; scale: 0.5; transition: opacity 0.3s, scale 0.3s; }

/* ===== Колонка: карточки цветов ===================================== */
.bb-buy { padding-top: var(--space-2xl); }
@media (min-width: 1024px) { .bb-buy { padding-top: 0; } }
.bb-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--space-lg);
  margin: 0; padding: 0; list-style: none;
}
@media (min-width: 1024px) { .bb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2xl) var(--space-lg); } }
/* Колонка — ровно по карточке: иначе Safari считает квадрат картинки вместе с её отступом снизу и
   раздувает колонку на 8 px, а длинное название раздувает её везде — картинка вылезала за край */
.bb-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2px; padding: 6px 6px var(--space-lg);
  border-radius: var(--radius-2xl); background: var(--card); box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur), translate var(--dur);
}
.bb-card.is-on { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 75%, transparent), var(--shadow-card); }
.bb-card.is-lifted { translate: 0 -3px; box-shadow: 0 0 0 2px var(--accent), var(--shadow-card-hover); }
.bb-card__media {
  position: relative; aspect-ratio: 1; margin-bottom: var(--space-base); border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 42%, #fff 30%, var(--surface));
}
.bb-card__img {
  position: absolute; inset: 10px 10px 14px; width: calc(100% - 20px); height: calc(100% - 24px); object-fit: contain;
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
  filter: drop-shadow(0 4px 6px rgb(70 25 40 / 0.14));
  transition: scale 0.4s var(--spring), rotate 0.4s var(--spring);
}
@media (hover: hover) and (pointer: fine) {
  .bb-card:hover { box-shadow: var(--shadow-card-hover); translate: 0 -2px; }
  .bb-card.is-on:hover { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-card-hover); }
  .bb-card:hover .bb-card__img { scale: 1.07; rotate: -4deg; }
}
.bb-card__name { padding-inline: 4px; font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: 1.25; overflow-wrap: anywhere;
  hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 9 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; }
.bb-card__price { padding-inline: 4px; font-size: var(--fs-sm); color: var(--text-tertiary); }

/* «+» в углу; когда цветок этого цвета есть — степпер «− 3 +» на матовой подложке */
.bb-card__add, .bb-step__btn {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-full); cursor: pointer;
}
.bb-card__add {
  position: absolute; right: 6px; bottom: 6px;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: scale var(--dur) var(--spring);
}
.bb-card__add:active, .bb-step__btn:active { scale: 0.9; }
.bb-step {
  position: absolute; left: 6px; right: 6px; bottom: 6px; display: none; align-items: center; justify-content: space-between;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 0.7); -webkit-backdrop-filter: blur(10px) saturate(1.5); backdrop-filter: blur(10px) saturate(1.5);
  box-shadow: 0 2px 8px rgb(25 21 22 / 0.1);
}
.bb-card.has-n .bb-step { display: flex; }
.bb-card.has-n .bb-card__add { display: none; }
.bb-step__btn { background: none; color: var(--text); font-size: 20px; line-height: 1; }
.bb-step__btn[data-inc] { background: var(--accent); color: var(--on-accent); }
.bb-step__n { font-size: 15px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* Цвет — под ценой: словами («Цвет: белый») и кружками других цветов; у кружка — сколько уже в букете */
.bb-card__color { display: grid; gap: var(--space-base); margin-top: var(--space-base); padding-inline: 4px; }
.bb-card__color-name { font-size: var(--fs-sm); color: var(--text-tertiary); }
.bb-card__color-name span { color: var(--text-secondary); }
.bb-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-swatch {
  position: relative; width: 16px; height: 16px; padding: 0; cursor: pointer;
  border: 2px solid #fff; border-radius: 50%; background: var(--sw);
  box-shadow: 0 0 0 1px rgb(25 21 22 / 0.18);
  transition: box-shadow var(--dur), scale var(--dur) var(--spring);
}
.bb-swatch::before { content: ""; position: absolute; inset: -4px; }
.bb-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.bb-swatch__n {
  position: absolute; right: -7px; top: -8px; min-width: 13px; height: 13px; padding: 0 3px;
  border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent);
  font-size: 9px; font-weight: var(--fw-bold); line-height: 13px; text-align: center;
}
.bb-swatch__n:empty { display: none; }

/* Не собрать с букетом: ни у одного салона нет его вместе с выбранными цветами. Карточка бледная, вместо «+» и
   цены — почему; кружок такого цвета перечёркнут */
.bb-card__off { padding-inline: 4px; font-size: var(--fs-sm); line-height: 1.3; color: var(--text-tertiary); }
.bb-card.is-off .bb-card__img { opacity: 0.4; filter: grayscale(0.6); cursor: not-allowed; }
.bb-card.is-off .bb-card__add, .bb-card.is-off .bb-card__price { display: none; }
.bb-card.is-off .bb-step__btn[data-inc] { background: var(--surface); color: var(--text-tertiary); }
.bb-card.is-off .bb-card__name { color: var(--text-secondary); }
@media (hover: hover) and (pointer: fine) {
  .bb-card.is-off:hover { box-shadow: var(--shadow-card); translate: none; }
  .bb-card.is-off:hover .bb-card__img { scale: 1; rotate: 0deg; }
}
.bb-swatch.is-off { opacity: 0.45; }
.bb-swatch.is-off::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; translate: -50% 0; rotate: 45deg;
  background: var(--text-secondary); border-radius: 1px;
}

/* ===== Упаковка, состав, кнопка ====================================== */
.bb-wrap { gap: var(--space-base); }
.bb-wrap__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(25 21 22 / 0.18); }
.bb-wrap__dot--none { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--border-strong) 3px 4px); }
.bb-wrap__dot--film { background: linear-gradient(135deg, #fff 10%, rgb(205 225 240 / 0.55) 45%, #fff 60%, rgb(190 210 230 / 0.5) 90%); box-shadow: inset 0 0 0 1px rgb(25 21 22 / 0.25); }
.bb-wrap.chip--selected .bb-wrap__dot { box-shadow: 0 0 0 2px var(--on-accent); }
.bb [data-composition][hidden] { display: none; }
.bb-tip {
  margin-top: var(--space-base); padding: var(--space-lg) var(--space-2xl); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-warning) 10%, var(--card)); font-size: var(--fs-label); line-height: 1.5; color: var(--text-secondary);
}
.bb-tip[hidden] { display: none; }
.bb-tip__add { padding: 0; border: 0; background: none; cursor: pointer; font-weight: var(--fw-medium); text-align: left; white-space: normal; }
.bb-fab { animation: none; }
.bb-fab:disabled { display: none; }
@media (max-width: 1023.98px) { .bb { padding-bottom: 110px; } }

.bb-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  max-width: calc(100vw - 2 * var(--gutter)); padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-4xl); background: rgb(25 21 22 / 0.88); color: #fff;
  font-size: var(--fs-label); text-align: center; pointer-events: none;
  opacity: 0; translate: -50% 12px; transition: opacity 0.25s, translate 0.25s var(--ease);
}
.bb-toast.is-on { opacity: 1; translate: -50% 0; }
@media (min-width: 1024px) { .bb-toast { bottom: var(--space-6xl); } }

/* Меньше движения: без покачивания, перелётов и лепестков */
@media (prefers-reduced-motion: reduce) {
  .bb *, .bb *::before, .bb *::after { animation: none !important; transition: none !important; }
  .bb-petal { display: none; }
}

/* Цвет без своей картинки — подкрашенная картинка того же цветка (--tint, src/stems/builder-catalog.ts) */
.bb-card__img, .bb-flyer, .bb-ghost, .bb-greens__img { filter: var(--tint,); }

/* ===== Салон: где заказать ========================================== */
/* Карточка — .offer из app.css §12, как «Где заказать» у букета; здесь она кнопка выбора, без «Купить» */
.bb-salons .offer { width: 100%; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--space-lg); font: inherit; text-align: left; }
.bb-salons li[hidden] { display: none; }
/* Нет всех цветов: карточка бледнее, вместо цены — «!» в кружке, список — подсказкой при наведении */
.bb-salon.is-missing { cursor: default; box-shadow: none; background: var(--surface-muted); }
.bb-salon.is-missing .offer__icon, .bb-salon.is-missing .offer__name, .bb-salon.is-missing .offer__rating { opacity: 0.55; }
@media (hover: hover) { .bb-salon.is-missing:hover { box-shadow: none; translate: none; } }
.bb-salon__miss { position: relative; display: grid; }
.bb-salon__miss[hidden], .bb-salon .price[hidden] { display: none; }
.bb-salon__mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--text-tertiary); color: var(--text-secondary);
  font-size: var(--fs-label); font-weight: var(--fw-bold); line-height: 1;
}
.bb-salon__tip {
  position: absolute; right: -8px; bottom: calc(100% + var(--space-base)); z-index: 20; width: max-content; max-width: 260px;
  padding: var(--space-base) var(--space-lg); border-radius: var(--radius-lg);
  background: rgb(25 21 22 / 0.88); color: #fff; box-shadow: var(--shadow-popover);
  font-size: var(--fs-sm); font-weight: var(--fw-regular); line-height: 1.4; text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; translate: 0 4px; transition: opacity var(--dur), visibility var(--dur), translate var(--dur);
  pointer-events: none;
}
.bb-salon__miss:hover .bb-salon__tip, .bb-salon:focus-visible .bb-salon__tip { opacity: 1; visibility: visible; translate: 0 0; }
.bb-empty-city { margin: 0; font-size: var(--fs-label); line-height: 1.5; color: var(--text-tertiary); }

/* ===== Снимок для флориста (/konstruktor-buketov/{токен}/) ===== */
.sketch { display: grid; gap: var(--space-2xl); max-width: 720px; margin: 0 auto; padding: var(--space-4xl) 0 var(--space-7xl); }
.sketch__note { color: var(--text-secondary); line-height: 1.6; }
.sketch__img {
  display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain;
  border-radius: var(--radius-2xl); background: var(--card); box-shadow: var(--shadow-card);
}
.sketch__lines { display: grid; gap: var(--space-base); margin: var(--space-base) 0 0; padding: 0; list-style: none; font-size: var(--fs-label); }
.sketch__lines li { display: flex; justify-content: space-between; gap: var(--space-lg); padding-bottom: var(--space-base); border-bottom: 1px dotted var(--border); }
.sketch__lines b { font-weight: var(--fw-medium); white-space: nowrap; }

/* раздел без карточек (нет зелени в городе) и закрытая форма: display блока перебил бы hidden */
.bb .bq-block[hidden], .bb [data-checkout][hidden] { display: none; }
