/* Конструктор букета (/constructor). Токены – из main.css. */

.bld { padding: 0 0 118px; }
.bld__wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.bld__main { min-width: 0; }
.bld :focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; }

/* --- Шапка ------------------------------------------------------------------ */
.bld__head { padding: 22px 0 4px; }
.bld__crumbs { margin-bottom: 10px; }
.bld__title {
  font-size: clamp(25px, 3.6vw, 40px);
  line-height: 1.12;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.bld__lead {
  margin: 0 0 14px;
  color: var(--font-secondary);
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 560px;
}
.bld-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  width: min(100%, 440px);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.bld-mode__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--font-secondary);
  font: 600 14px/1.1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.bld-mode__btn:hover { color: var(--font-primary); }
.bld-mode__btn[aria-selected="true"] {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 2px 10px rgba(150, 90, 90, .16);
}

/* --- Разделы ------------------------------------------------------------------ */
.bld-sec { margin-top: 24px; }
.bld-sec--presets { margin-top: 16px; }
.bld-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.2;
}
.bld-h span { font: 500 13px 'Inter', sans-serif; color: var(--font-secondary); }
.bld-h--sm { font-size: 15px; font-family: 'Inter', sans-serif; font-weight: 600; color: var(--font-secondary); margin-bottom: 8px; }

/* Быстрый старт */
.bld-presets {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--container-pad));
  padding: 2px var(--container-pad) 6px;
  scroll-snap-type: x proximity;
}
.bld-presets::-webkit-scrollbar { display: none; }
.bld-preset {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--font-primary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.bld-preset:hover { border-color: var(--btn-border); box-shadow: var(--shadow-card); }
.bld-preset:active { transform: scale(.98); }
.bld-preset__art { width: 44px; height: 53px; flex-shrink: 0; }
.bld-preset__art svg { width: 100%; height: 100%; display: block; }
.bld-preset__txt { display: flex; flex-direction: column; gap: 1px; }
.bld-preset__txt strong { font-size: 14px; font-weight: 600; }
.bld-preset__txt em { font-style: normal; font-size: 12px; color: var(--font-secondary); white-space: nowrap; }

/* --- Цветы ------------------------------------------------------------------ */
.bld-stems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}
.bld-stem { position: relative; min-width: 0; }
.bld-stem__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .2s ease;
}
.bld-stem.is-on .bld-stem__media {
  box-shadow: inset 0 0 0 2.5px var(--primary), 0 8px 18px rgba(200, 75, 107, .18);
}
.bld-stem__pic {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bld-stem__pic:focus-visible { outline-offset: -4px; border-radius: 16px; }
.bld-stem__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.bld-stem.is-on .bld-stem__pic img { transform: scale(1.02); }
@media (hover: hover) { .bld-stem__pic:hover img { transform: scale(1.05); } }
.bld-stem__pic.is-full { cursor: default; }
.bld-stem__plus {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(80, 30, 40, .2);
  transition: transform .15s ease;
}
.bld-stem__pic:active .bld-stem__plus { transform: scale(.9); }
.bld-stem.is-on .bld-stem__plus,
.bld-stem__badge { display: none; }
.bld-step {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: stretch;
  height: 44px;
  padding: 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 4px 14px rgba(80, 30, 40, .18);
}
/* Полоса над счетчиком ловит промахи: касание чуть выше «−» не добавляет цветок. */
.bld-step::before { content: ''; position: absolute; left: -4px; right: -4px; top: -10px; height: 10px; }
.bld-step[hidden] { display: none; }
.bld-step__btn,
.bld-step__val {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Кружок 32 px нарисован внутри, а нажать можно по всей высоте 44 px. */
.bld-step__btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border-radius: 50%;
  background: var(--primary-light);
  transition: background .15s ease;
}
.bld-step__btn svg { position: relative; }
.bld-step__btn:hover::before,
.bld-step__btn:active::before { background: var(--primary-soft); }
.bld-step__btn:disabled { opacity: .35; cursor: default; }
.bld-step__btn:focus-visible, .bld-step__val:focus-visible { outline-offset: -3px; border-radius: 999px; }
.bld-step__val {
  flex-grow: 1.15;
  color: var(--font-primary);
  font: 700 16px 'Inter', sans-serif;
}
/* Число похоже на кнопку: по нему открывается быстрый выбор 1, 3, 5, 7... */
.bld-step__val span {
  display: inline-block;
  min-width: 28px;
  padding: 4px 5px;
  border-radius: 8px;
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--border);
  line-height: 1.15;
}
.bld-step__val.is-pop span { animation: bldPop .35s cubic-bezier(.2, .8, .3, 1.4); }
@keyframes bldPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.bld-stem__info { display: flex; flex-direction: column; gap: 2px; padding: 7px 2px 0; }
.bld-stem__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--font-primary);
}
.bld-stem__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.bld-stem__price { font-size: 14px; font-weight: 700; }
.bld-stem__left { font-size: 11.5px; font-weight: 600; color: #A8661F; }
.bld-stem.is-out { opacity: .6; }
.bld-stem.is-out img { filter: grayscale(.7); }
.bld-stem__out {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  font-size: 11px;
  font-weight: 600;
  color: var(--font-secondary);
}

/* --- Упаковка и лента ------------------------------------------------------- */
.bld-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--container-pad)) 12px;
  padding: 2px var(--container-pad);
}
.bld-chips::-webkit-scrollbar { display: none; }
.bld-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--font-primary);
  font: 600 13px 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.bld-chip span { color: var(--font-secondary); font-weight: 500; }
.bld-chip:hover { border-color: var(--btn-border); }
.bld-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.bld-chip[aria-pressed="true"] span { color: var(--primary); }
.bld-chips--big .bld-chip { min-height: 48px; padding: 10px 18px; font-size: 15px; }
.bld-sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.bld-sw--any { background: conic-gradient(#F2C9D4, #F6A23B, #FFFFFF, #D8C2A8, #E8505B, #F2C9D4); }
.bld-sw--tender { background: linear-gradient(135deg, #F6D3DC, #F9E6DF 60%, #E9D3EA); }
.bld-sw--bright { background: linear-gradient(135deg, #E8505B, #F6A23B); }
.bld-sw--white { background: #fff; }
.bld-sw--dry { background: linear-gradient(135deg, #D8C2A8, #B89A78); }

.bld-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 8px;
}
.bld-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bld-tile[hidden] { display: none; }
.bld-tile__pic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--font-secondary);
  transition: box-shadow .15s ease;
}
.bld-tile__pic img { width: 100%; height: 100%; object-fit: cover; }
.bld-tile--icon .bld-tile__pic { background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-soft); }
@media (hover: hover) { .bld-tile:hover .bld-tile__pic { box-shadow: inset 0 0 0 1.5px var(--btn-border); } }
.bld-tile[aria-checked="true"] .bld-tile__pic { box-shadow: inset 0 0 0 2.5px var(--primary), 0 4px 12px rgba(200, 75, 107, .18); }
.bld-tile[aria-checked="true"] .bld-tile__pic::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 12px no-repeat;
  box-shadow: 0 0 0 2px #fff;
}
.bld-tile:focus-visible { outline: none; }
.bld-tile:focus-visible .bld-tile__pic { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.bld-tile__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.22;
  font-weight: 500;
  color: var(--font-primary);
}
.bld-tile__sub {
  display: block;
  margin-top: -2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--font-secondary);
}
.bld-tile__price { margin-top: auto; padding-top: 1px; font-size: 12.5px; font-weight: 600; color: var(--font-secondary); }
.bld-tile[aria-checked="true"] .bld-tile__price { color: var(--primary-dark); }
.bld-more {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 1.5px dashed var(--btn-border);
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  font: 600 14px 'Inter', sans-serif;
  cursor: pointer;
}
.bld-more:hover { background: var(--primary-light); }
.bld-more[hidden] { display: none; }

/* --- Доверить флористу ------------------------------------------------------- */
.bld-ref {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 10px 44px 10px 10px;
  border: 1px solid var(--primary-soft);
  border-radius: 16px;
  background: var(--primary-light);
}
.bld-ref[hidden] { display: none; }
.bld-ref__img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #fff; }
.bld-ref__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.bld-ref__txt strong { font: 600 16px 'Playfair Display', serif; }
.bld-ref__txt em { font-style: normal; font-size: 12px; color: var(--font-secondary); }
.bld-ref__x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--font-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bld-ref__x:hover { color: var(--primary); }
.bld-own { margin-top: 12px; max-width: 300px; }
.bld-own[hidden] { display: none; }
.bld-own__lbl { font-size: 12px; font-weight: 500; color: var(--font-secondary); }
.bld-own__row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bld-own__row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--font-primary);
  font: 600 18px 'Inter', sans-serif;
}
.bld-own__row span { font-size: 18px; font-weight: 600; color: var(--font-secondary); }
.bld-own__row input:focus,
.bld-wish:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 75, 107, .14); }
.bld-own__row input[aria-invalid="true"] { border-color: #B04A3E; box-shadow: 0 0 0 3px rgba(176, 74, 62, .12); }
.bld-own__hint { margin: 6px 0 0; font-size: 12.5px; color: var(--font-secondary); }
.bld-wish {
  display: block;
  width: 100%;
  min-height: 86px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--font-primary);
  font: 14px/1.5 'Inter', sans-serif;
  resize: vertical;
}
.bld-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--font-secondary); }
.bld-note a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.bld-empty {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-muted);
  font-size: 14px;
  color: var(--font-secondary);
}
.bld-empty p { margin: 0 0 12px; }
.bld-empty strong { color: var(--font-primary); }
.bld-empty__acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Текст и вопросы под конструктором ----------------------------------------- */
.bld-info {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
  max-width: 720px;
  color: var(--font-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.bld-info p { margin: 0 0 12px; }
.bld-faq { margin-top: 12px; border-top: 1px solid var(--border-soft); }
.bld-faq__item { border-bottom: 1px solid var(--border-soft); }
.bld-faq__item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  list-style: none;
  cursor: pointer;
  color: var(--font-primary);
  font-size: 15px;
  font-weight: 600;
}
.bld-faq__item summary::-webkit-details-marker { display: none; }
.bld-faq__item summary::after {
  content: '+';
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 18px;
  line-height: 26px;
  text-align: center;
}
.bld-faq__item[open] summary::after { content: '−'; }
.bld-faq__item p { margin: 0 0 14px; }

/* --- Превью букета ----------------------------------------------------------- */
.bld-art { width: 100%; max-width: 250px; margin: 0 auto; aspect-ratio: 200 / 240; }
.bld-art svg, .bld-bar__art svg { width: 100%; height: 100%; display: block; }
.bld-art__ref { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.bq-head { transform-box: fill-box; transform-origin: center; }
.bq-new { animation: bqGrow .45s cubic-bezier(.2, .8, .3, 1.3) both; }
@keyframes bqGrow { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- Итог: колонка или шторка ---------------------------------------------------- */
.bld-side__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bld-side__title { margin: 0; font-size: 20px; }
.bld-side__x {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--font-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bld-side__card:focus { outline: none; }
.bld-side__count { margin: 4px 0 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--font-primary); }
.bld-side__empty { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--font-secondary); }
.bld-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bld-line { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 40px; gap: 6px; align-items: center; }
.bld-line__img { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-muted) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--border); }
.bld-line__name { min-width: 0; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.bld-line__name em { display: block; font-style: normal; font-size: 12px; color: var(--font-secondary); }
.bld-line__step { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.bld-line__step button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--font-primary);
  font: 500 19px/1 'Inter', sans-serif;
  cursor: pointer;
}
.bld-line__step button:hover { background: var(--primary-light); color: var(--primary); }
.bld-line__step button:disabled { opacity: .3; cursor: default; background: none; }
.bld-line__step b { min-width: 22px; text-align: center; font-size: 14px; }
.bld-line__x {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--font-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bld-line__x:hover { color: var(--primary); background: var(--primary-light); }
.bld-extras { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; }
.bld-extra { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 13px; }
.bld-extra > span { color: var(--font-secondary); }
.bld-extra button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-dark);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--btn-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.bld-extra em { font-style: normal; color: var(--font-secondary); white-space: nowrap; }
.bld-extra b { grid-column: span 2; font-weight: 600; }
.bld-odd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #F1DDB0;
  border-radius: 12px;
  background: #FFF8EA;
  color: #6B5326;
  font-size: 12.5px;
  line-height: 1.35;
}
.bld-odd[hidden] { display: none; }
.bld-odd__txt { flex: 1; min-width: 0; }
.bld-odd__btn {
  flex-shrink: 0;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font: 600 12.5px 'Inter', sans-serif;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(150, 110, 40, .22);
  cursor: pointer;
}
.bld-odd__btn:hover { background: var(--primary-light); }
.bld-side__foot { margin-top: 14px; }
.bld-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bld-total span { font-size: 13px; color: var(--font-secondary); }
.bld-total strong { font: 600 26px 'Playfair Display', serif; color: var(--font-primary); }
.bld-total__note { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: var(--font-secondary); }
.bld-total__note[hidden] { display: none; }
.bld-go { margin-top: 12px; }
[data-checkout].is-off { opacity: .55; box-shadow: none; }

/* --- Нижняя панель (телефон и планшет) ------------------------------------------- */
.bld-bar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  padding: 8px 8px 8px 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(80, 30, 40, .18), 0 0 0 1px rgba(42, 30, 34, .05);
}
.bld-bar__row { display: flex; align-items: center; gap: 10px; }
.bld-bar__peek {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.bld-bar__art {
  width: 48px;
  height: 58px;
  flex-shrink: 0;
  margin: -24px 0 -4px;
  padding: 2px;
  border-radius: 16px 16px 12px 12px;
  background: #fff;
  box-shadow: 0 -6px 14px rgba(80, 30, 40, .10);
}
.bld-bar__txt { display: flex; flex-direction: column; min-width: 0; }
.bld-bar__txt strong,
.bld-bar__txt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bld-bar__txt strong { font-size: 16px; line-height: 1.25; font-weight: 700; color: var(--font-primary); }
.bld-bar__txt span { font-size: 12px; color: var(--font-secondary); }
.bld-bar__chev { flex-shrink: 0; color: var(--font-muted); }
.bld-bar__go { flex-shrink: 0; min-height: 46px; padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.bld-odd--bar { margin: 0 0 8px; }

/* Шторка «Сколько?» для быстрого выбора количества */
.bld-qsheet__hint { margin: -6px 0 12px; font-size: 13px; color: var(--font-secondary); }
.bld-qsheet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bld-qsheet__n {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--font-primary);
  font: 700 17px 'Inter', sans-serif;
  cursor: pointer;
}
.bld-qsheet__n:hover { border-color: var(--btn-border); background: var(--primary-light); }
.bld-qsheet__n.is-on { border-color: var(--primary); background: var(--primary); color: #fff; }
.bld-qsheet__n:disabled { opacity: .3; cursor: default; background: #fff; }
.bld-qsheet__rm {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--font-secondary);
  font: 600 14px 'Inter', sans-serif;
  cursor: pointer;
}
.bld-qsheet__rm:hover { color: var(--primary-dark); }
.bld-qsheet__n:focus-visible, .bld-qsheet__rm:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; }

/* --- Сетки по ширине ------------------------------------------------------------- */
/* До 380 px в четыре колонки названия лент («Светло-коричневая») не помещаются. */
@media (max-width: 379px) {
  .bld-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .bld-stems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bld-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bld-mode__btn { font-size: 13px; padding: 8px 6px; gap: 5px; }
  .bld-bar__go { padding: 12px 14px; }
}
@media (max-width: 420px) {
  .bld-mode__btn svg { display: none; }
  .bld-mode__btn { padding: 8px 6px; }
}
@media (max-width: 600px) {
  .bld__crumbs { display: none; }
  .bld__head { padding-top: 14px; }
  .bld-mode { width: 100%; }
}
@media (min-width: 600px) {
  .bld-stems { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
  .bld-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 10px; }
  .bld-chips { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; }
  .bld-presets { margin: 0; padding: 2px 0 6px; flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 769px) and (max-width: 1023px) {
  .bld-stems { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bld-bar {
    left: 50%;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
  }
}

/* Телефон и планшет: итог выезжает шторкой из нижней панели */
@media (max-width: 1023px) {
  .bld-side { position: fixed; inset: 0; z-index: 99; pointer-events: none; }
  .bld-side__bg {
    position: absolute;
    inset: 0;
    background: rgba(42, 30, 34, .45);
    opacity: 0;
    transition: opacity .25s ease;
  }
  .bld-side__card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: var(--shadow-deep);
    transform: translateY(105%);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    visibility: hidden;
  }
  .bld-side.is-open { pointer-events: auto; }
  .bld-side.is-open .bld-side__bg { opacity: 1; }
  .bld-side.is-open .bld-side__card { transform: none; visibility: visible; }
  .bld-side .bld-art { max-width: 190px; }
  .bld-side .bld-odd { display: none; }
  .bld-bar__peek[aria-expanded="true"] .bld-bar__chev { transform: rotate(180deg); }
}
/* Тост встает над нижней панелью (ее высоту меряет builder.js), подвал страницы
   получает отступ, чтобы ссылки внизу не прятались под панелью. */
@media (max-width: 1023px) {
  .bld { padding-bottom: 24px; }
  body.is-bld { padding-bottom: calc(var(--bld-bar-top, 150px) + 12px); }
  body.is-bld .toast { bottom: calc(var(--bld-bar-top, 150px) + 10px); }
}

/* Компьютер: колонка «Ваш букет» справа, нижней панели нет */
@media (min-width: 1024px) {
  .bld { padding-bottom: 64px; }
  .bld__wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 40px;
    align-items: start;
  }
  .bld-side { position: sticky; top: 100px; margin-top: 28px; }
  .bld-side__bg, .bld-side__x { display: none; }
  .bld-side__card {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 18px 20px 20px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow-pop);
  }
  .bld-bar { display: none; }
  .bld-stems { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bld-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .bld-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .bq-new, .bld-step__val.is-pop span { animation: none; }
  .bld-side__card, .bld-side__bg, .bld-stem__pic img, .bld-mode__btn { transition: none; }
}

/* Подсказка про нечетное число в колонке: текст над кнопкой, кнопка не сжимает его */
.bld-side .bld-odd { flex-wrap: wrap; }
.bld-side .bld-odd__txt { flex: 1 1 100%; }
@media (min-width: 1024px) {
  .bld-art { max-width: 210px; }
  .bld-side__foot {
    position: sticky;
    bottom: -20px;
    margin: 14px -20px -20px;
    padding: 12px 20px 20px;
    background: linear-gradient(rgba(255, 255, 255, .92), #fff 30%);
    border-radius: 0 0 24px 24px;
  }
}

/* Бюджет и гамма видны целиком: переносятся на новую строку, а не уезжают вбок */
[data-budgets], [data-palettes] { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }

/* Колонка «Ваш букет» на компьютере липнет к экрану. В main.css у body стоит
   overflow-x: hidden, из-за него body становится контейнером прокрутки и sticky
   не работает. clip режет горизонтальный вылет так же, но прокрутку не заводит. */
body:has(#builder) { overflow-x: clip; }
body.is-bld { overflow-x: clip; }

/* Кнопки оформления чуть темнее фирменного: белый текст читается по AA (4.9:1). */
.bld .bld-go:not(:hover), .bld .bld-bar__go:not(:hover) { background-color: #C14465; }
.bld .bld-go { min-height: 48px; font-size: 15px; font-weight: 600; }

/* Экранный диктор: «Диантус: 5 шт», видно только ему. */
.bld-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Лист «В корзине два букета» */
.bld-both__txt { margin: -4px 0 14px; font-size: 14px; line-height: 1.5; color: var(--font-secondary); }
.bld-both__btn { min-height: 48px; font-size: 15px; font-weight: 600; }
.bld-both__btn + .bld-both__btn { margin-top: 10px; }

/* Узкий телефон: подписи вкладок в одну строку, в нижней панели больше места тексту. */
@media (max-width: 400px) {
  .bld-mode__btn { font-size: 13.5px; white-space: nowrap; padding: 8px 4px; }
  .bld-bar__chev { display: none; }
  .bld-bar__go { padding: 12px 15px; }
}
@media (max-width: 340px) {
  .bld-mode__btn { font-size: 12.5px; }
}

/* --- Доработки после второй UX-проверки ---------------------------------------- */

/* Кнопки −/+ на фото цветка: каждая 38 px шириной на всю высоту 44 px, зона
   нажатия шире еще на 4 px; число между ними. */
.bld-step { left: 2px; right: 2px; bottom: 2px; padding: 0; }
.bld-step__btn { flex: 0 0 38px; }
.bld-step__btn::after { content: ''; position: absolute; inset: -4px -4px; }
.bld-step__val { flex: 1 1 auto; min-width: 0; }
.bld-step__val span { min-width: 22px; padding: 4px 3px; }
@media (max-width: 380px) {
  .bld-step__btn { flex-basis: 36px; }
  .bld-step__val span { min-width: 0; padding: 3px 2px; font-size: 15px; }
}

/* Подсказка про нечетное число в нижней панели закрывается крестиком. */
.bld-odd__x {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: -4px -4px -4px -2px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #8A6A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bld-odd__x:hover { background: rgba(255, 255, 255, .7); }
.bld-odd__x::after { content: ''; position: absolute; inset: -6px; }
.bld-odd__x { position: relative; }

/* Тост на странице конструктора встает над нижней панелью, но при открытой
   корзине панели не видно: тогда тост внизу экрана, а не посреди формы. */
@media (max-width: 1023px) {
  body.is-bld .cart-drawer.is-open ~ .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* Телефон: в шторке «Ваш букет» итог и «Оформить» всегда видны внизу. */
@media (max-width: 1023px) {
  .bld-side__foot {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom, 0px));
    z-index: 2;
    margin: 14px -18px calc(-18px - env(safe-area-inset-bottom, 0px));
    padding: 12px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -10px 18px -12px rgba(80, 30, 40, .35);
  }
}

/* Компьютер: колонка «Ваш букет» целиком помещается в окно. Превью сжимается по
   высоте окна, список цветов прокручивается внутри, итог и кнопка – внизу и
   ничего не закрывают (раньше липкий низ перекрывал строку «Лента» при 720 px). */
@media (min-width: 1024px) {
  .bld-side__card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    overflow: hidden;
  }
  .bld-side__top { flex: none; }
  .bld-side .bld-art {
    flex: none;
    height: clamp(96px, calc(100vh - 500px), 252px);
    width: auto;
    max-width: 100%;
  }
  .bld-side__body {
    flex: 1 1 auto;
    min-height: 48px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0 -20px;
    padding: 0 20px 4px;
  }
  .bld-side .bld-odd { flex: none; }
  .bld-side__foot {
    flex: none;
    position: static;
    margin: 12px -20px -20px;
    padding: 12px 20px 20px;
    background: #fff;
    border-top: 1px solid var(--border-soft);
  }
}
