/* Bed configurator – DOMTENTA */
.sg-bed-calc {
  --sg-bc-bg: #FFFFFF;
  --sg-bc-surface: #F4F4F5;
  --sg-bc-surface-2: #EBEBED;
  --sg-bc-surface-3: #E0E0E3;
  --sg-bc-border: #D4D4D8;
  --sg-bc-text: #1A1A1E;
  --sg-bc-text-dim: #6B6B78;
  --sg-bc-text-muted: #9B9BA8;
  --sg-bc-accent: #0078a1;
  --sg-bc-accent-dark: #006285;
  --sg-bc-accent-soft: rgba(0,120,161,0.08);
  --sg-bc-green: #22C55E;
  --sg-bc-radius: 10px;
  --sg-bc-radius-lg: 16px;

  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--sg-bc-text);
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ─── */
.sg-bed-calc__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.sg-bed-calc__logo {
  width: 36px;
  height: 36px;
  background: var(--sg-bc-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.sg-bed-calc__reset {
  background: none;
  border: 1px solid var(--sg-bc-border, #D4D4D8);
  border-radius: 18px;
  padding: 6px 14px 6px 10px;
  font-size: 13px;
  line-height: 1;
  color: var(--sg-bc-text-dim, #71717A);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.sg-bed-calc__reset span {
  font-size: 17px;
  line-height: 1;
}
.sg-bed-calc__reset:hover {
  color: var(--sg-bc-accent, #0078a1);
  border-color: var(--sg-bc-accent, #0078a1);
  background: rgba(0,120,161,.06);
}

/* Кнопка-админка: видна только когда include добавил data-admin="1" */
.sg-bed-calc__admin-clear {
  margin-left: 8px;
  background: #fff;
  border: 1px dashed #6366F1;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  line-height: 1;
  color: #4F46E5;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.sg-bed-calc__admin-clear:hover { background: #EEF2FF; }
.sg-bed-calc__admin-clear:disabled { opacity: .6; cursor: wait; }

.sg-bed-calc__header-text h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
}
.sg-bed-calc__header-text p {
  font-size: 13px;
  color: var(--sg-bc-text-dim);
  margin: 2px 0 0;
}

/* ─── LAYOUT ─── */
.sg-bed-calc__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.sg-bed-calc__grid > [data-bc-config],
.sg-bed-calc__grid > [data-bc-price] {
  min-width: 0;
}
.sg-bed-calc__grid > [data-bc-config] { width: 100%; }

@media (max-width: 900px) {
  .sg-bed-calc__grid { grid-template-columns: 1fr; }
}

/* ─── SECTIONS (accordion) ─── */
.sg-bed-calc__section {
  background: var(--sg-bc-surface);
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 0;
  margin-bottom: 8px;
  transition: border-color 0.2s;
  overflow: hidden;
}
.sg-bed-calc__section:hover {
  border-color: #888;
}

.sg-bed-calc__section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.sg-bed-calc__section-hdr:hover {
  background: var(--sg-bc-surface-2);
}

.sg-bed-calc__section-chevron {
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: var(--sg-bc-text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sg-bed-calc__section.is-open .sg-bed-calc__section-chevron {
  transform: rotate(180deg);
}

.sg-bed-calc__section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.sg-bed-calc__section.is-open .sg-bed-calc__section-body {
  max-height: 600px;
}

.sg-bed-calc__section-body-inner {
  padding: 12px 16px 14px;
}

.sg-bed-calc__section-hint {
  font-size: 12px;
  color: var(--sg-bc-text-dim);
  margin-left: 4px;
  line-height: 1.25;
}
.sg-bed-calc__section.is-open .sg-bed-calc__section-hint {
  display: none;
}

.sg-bed-calc__section-num {
  width: 22px;
  height: 22px;
  background: var(--sg-bc-accent-soft);
  color: var(--sg-bc-accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.sg-bed-calc__section-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* ─── OPTION CARDS ─── */
.sg-bed-calc__opts {
  display: grid;
  gap: 6px;
}
.sg-bed-calc__opts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-bed-calc__opts.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sg-bed-calc__opts.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 5+ опций — максимум 4 в ряд, остальные переносятся на новую строку,
   чтобы текст не обрезался узкими колонками. */
.sg-bed-calc__opts.cols-5,
.sg-bed-calc__opts.cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Исключение: «Тип кровати» — всегда в один ряд (подписи короткие, помещаются). */
.sg-bed-calc__opts.cols-5:has(.sg-bed-calc__opt[data-bc-group="type"]) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.sg-bed-calc__opts.cols-6:has(.sg-bed-calc__opt[data-bc-group="type"]) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.sg-bed-calc__opt { min-width: 0; }

@media (max-width: 900px) {
  .sg-bed-calc__opts.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sg-bed-calc__opts.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sg-bed-calc__opts.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-bed-calc__opts.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-bed-calc__opts.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-bed-calc__opts.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Лейблы опций — разрешаем перенос */
  .sg-bed-calc__opt-label {
    white-space: normal;
    line-height: 1.25;
    word-break: break-word;
  }
  .sg-bed-calc__opt.has-icon {
    gap: 8px;
    padding-right: 22px;
  }
  .sg-bed-calc__opt-icon {
    flex: 0 0 28px;
    width: 28px;
  }
}

/* На мобильных лейблы опций переносятся вместо обрезания */
@media (max-width: 600px) {
  .sg-bed-calc__opt-label {
    white-space: normal !important;
    line-height: 1.25;
  }

  /* Все шаги — 1 колонкой, чтобы тексты не ломались в столбик букв.
     Исключение: "Тип кровати" — там остаются 2 колонки (короткие подписи + bed-иконки). */
  .sg-bed-calc__opts {
    grid-template-columns: 1fr !important;
  }
  .sg-bed-calc__opts:has(.sg-bed-calc__opt[data-bc-group="type"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.sg-bed-calc__opt {
  background: var(--sg-bc-surface-2);
  border: 2px solid transparent;
  border-radius: var(--sg-bc-radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}
.sg-bed-calc__opt:hover {
  background: var(--sg-bc-surface-3);
  border-color: #999;
}
.sg-bed-calc__opt.is-sel {
  border-color: var(--sg-bc-accent);
  background: var(--sg-bc-surface-2);
}
.sg-bed-calc__opt-label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 1px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sg-bed-calc__opt-sub {
  font-size: 11px;
  color: #1090b8;
}
.sg-bed-calc__opt.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.sg-bed-calc__opt-check {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: var(--sg-bc-accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
.sg-bed-calc__opt.is-sel .sg-bed-calc__opt-check {
  display: flex;
}

/* ─── OPTION ICONS ─── */
.sg-bed-calc__opt.has-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 26px;
}
.sg-bed-calc__opt-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52525B;
}
.sg-bed-calc__opt-icon:has(.sg-bed-calc__opt-icon-svg--bed) {
  flex: 0 0 56px;
  width: 56px;
  height: 36px;
}
.sg-bed-calc__opt.is-sel .sg-bed-calc__opt-icon {
  color: var(--sg-bc-accent);
}
.sg-bed-calc__opt-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sg-bed-calc__opt-icon-svg--bed { color: inherit; }
.sg-bed-calc__opt.is-sel .sg-bed-calc__opt-icon-svg--bed { filter: none; }
.sg-bed-calc__opt-text {
  flex: 1 1 auto;
  min-width: 0;
}
.sg-bed-calc__toggle.has-icon .sg-bed-calc__toggle-info {
  flex: 1 1 auto;
  min-width: 0;
}
.sg-bed-calc__toggle-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 24px;
  margin-right: 10px;
  color: #52525B;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-bed-calc__toggle.is-on .sg-bed-calc__toggle-icon {
  color: var(--sg-bc-accent);
}

/* ─── FLOATING TOOLTIP (rendered in <body>, escapes overflow clipping) ─── */
.sg-bed-calc__opt-tip-floating {
  position: fixed;
  transform: translateX(-50%);
  background: #1f1f23;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: 6px;
  max-width: 280px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.sg-bed-calc__opt-tip-floating.is-shown { opacity: 1; }
.sg-bed-calc__opt-tip-floating::before {
  content: "";
  position: absolute;
  left: var(--sg-tip-arrow, 50%);
  top: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1f1f23;
}

/* ─── HOVER TOOLTIP UNDER OPTION (kept for backward compat) ─── */
.sg-bed-calc__opt-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: #1f1f23;
  color: #fff;
  font-size: 11px;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 260px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.sg-bed-calc__opt-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1f1f23;
}
.sg-bed-calc__opt:hover .sg-bed-calc__opt-tip {
  opacity: 1;
}

/* ─── LOCKED (preset) SECTIONS ─── */
.sg-bed-calc__section.is-locked .sg-bed-calc__opt.is-sel {
  opacity: 1;
  pointer-events: none;
  cursor: default;
}
.sg-bed-calc__section.is-locked .sg-bed-calc__opt.is-disabled {
  display: none;
}

/* ─── TOGGLE ROWS ─── */
.sg-bed-calc__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sg-bc-surface-2);
  border-radius: var(--sg-bc-radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.sg-bed-calc__toggle:hover { background: var(--sg-bc-surface-3); }

.sg-bed-calc__toggle-info .sg-bed-calc__toggle-label {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}
.sg-bed-calc__toggle-info .sg-bed-calc__toggle-sub {
  font-size: 11px;
  color: var(--sg-bc-text-dim);
  margin-top: 2px;
  line-height: 1.3;
}

.sg-bed-calc__toggle-sw {
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: var(--sg-bc-surface-3);
  border: 2px solid var(--sg-bc-border);
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}
.sg-bed-calc__toggle-sw::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sg-bc-text-dim);
  top: 1px;
  left: 1px;
  transition: all 0.2s;
}
.sg-bed-calc__toggle.is-on .sg-bed-calc__toggle-sw {
  background: var(--sg-bc-accent);
  border-color: var(--sg-bc-accent);
}
.sg-bed-calc__toggle.is-on .sg-bed-calc__toggle-sw::after {
  background: var(--sg-bc-bg);
  left: 18px;
}
.sg-bed-calc__toggle.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── QUANTITY (inline in price panel) ─── */
.sg-bed-calc__qty-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sg-bed-calc__qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--sg-bc-radius);
  background: var(--sg-bc-surface-2);
  border: 1px solid var(--sg-bc-border);
  color: var(--sg-bc-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sg-bed-calc__qty-btn:hover {
  background: var(--sg-bc-surface-3);
  border-color: var(--sg-bc-accent);
}
.sg-bed-calc__qty-val {
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  font-weight: 700;
  min-width: 36px;
  max-width: 72px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--sg-bc-text);
  padding: 4px 6px;
  box-sizing: border-box;
}
.sg-bed-calc__qty-val:hover {
  border-color: var(--sg-bc-border);
  background: var(--sg-bc-bg);
}
.sg-bed-calc__qty-val:focus {
  outline: none;
  border-color: var(--sg-bc-accent);
  background: var(--sg-bc-bg);
}

/* ─── PRICE PANEL (sticky right column) ─── */
.sg-bed-calc__price-panel {
  position: sticky;
  top: 16px;
}

.sg-bed-calc__price-card {
  background: var(--sg-bc-surface);
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 18px;
  margin-bottom: 10px;
}

.sg-bed-calc__price-hdr {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--sg-bc-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sg-bed-calc__pl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
}
.sg-bed-calc__pl-label { color: var(--sg-bc-text-dim); }
.sg-bed-calc__pl-value { font-weight: 600; }
.sg-bed-calc__pl.is-added .sg-bed-calc__pl-value { color: var(--sg-bc-accent); }

/* Строка аддон-товара (лестница/ограждение): label · qty (read-only) · сумма */
.sg-bed-calc__pl--addon {
  column-gap: 8px;
}
.sg-bed-calc__pl--addon .sg-bed-calc__pl-label { flex: 1 1 auto; }
.sg-bed-calc__pl--addon .sg-bed-calc__pl-qty {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--sg-bc-text-dim);
  white-space: nowrap;
}
.sg-bed-calc__pl--addon .sg-bed-calc__pl-value { flex: 0 0 auto; }

.sg-bed-calc__hr {
  border: none;
  border-top: 1px solid var(--sg-bc-border);
  margin: 8px 0;
}

.sg-bed-calc__total-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  column-gap: 12px;
  row-gap: 4px;
  padding: 4px 0;
}
.sg-bed-calc__total-label {
  font-size: 13px;
  color: var(--sg-bc-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.sg-bed-calc__total-value {
  font-family: 'Unbounded', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--sg-bc-accent);
  letter-spacing: -0.02em;
  text-align: right;
  margin-left: auto;
}
.sg-bed-calc__per-unit {
  text-align: right;
  font-size: 11px;
  color: var(--sg-bc-text-dim);
  margin-top: 2px;
}
.sg-bed-calc__meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--sg-bc-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sg-bed-calc__meta .sg-bed-calc__pl {
  font-size: 12px;
}
.sg-bed-calc__meta .sg-bed-calc__pl-label {
  color: var(--sg-bc-text-dim);
}
.sg-bed-calc__meta .sg-bed-calc__pl-value {
  font-weight: 600;
  color: var(--sg-bc-text);
}
.sg-bed-calc__pl-mute {
  font-weight: 400;
  color: var(--sg-bc-text-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* Temporarily hide icons in "Тип кровати" step (kept in JS for future re-enable) */
.sg-bed-calc__opt[data-bc-group="type"] .sg-bed-calc__opt-icon { display: none !important; }

/* Center content in "Тип кровати" cells */
.sg-bed-calc__opt[data-bc-group="type"] {
  justify-content: center;
  text-align: center;
  padding-left: 12px;
  padding-right: 12px;
}
.sg-bed-calc__opt[data-bc-group="type"] .sg-bed-calc__opt-text {
  flex: 0 1 auto;
  text-align: center;
}
.sg-bed-calc__opt[data-bc-group="type"] .sg-bed-calc__opt-label {
  text-align: center;
}

/* "!" tooltip mark on option cards — same size as check, stacked under it when selected */
.sg-bed-calc__opt.has-tip { position: relative; }
.sg-bed-calc__opt-tipmark {
  position: absolute;
  top: 4px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #B0B0B5;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.sg-bed-calc__opt.is-sel .sg-bed-calc__opt-tipmark {
  top: 20px;
}
.sg-bed-calc__opt.is-disabled .sg-bed-calc__opt-tipmark {
  background: #999;
}

.sg-bed-calc__cta {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--sg-bc-radius);
  background: var(--sg-bc-accent);
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}
.sg-bed-calc__cta:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.sg-bed-calc__cta.is-in-cart {
  background: #22C55E;
}
.sg-bed-calc__cta.is-in-cart:hover {
  filter: brightness(1.05);
}

.sg-bed-calc__cta-sec {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  background: transparent;
  color: var(--sg-bc-text);
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
}
.sg-bed-calc__cta-sec:hover {
  border-color: var(--sg-bc-accent);
  background: var(--sg-bc-surface-3);
}

/* ─── CONFIG SUMMARY TAGS ─── */
.sg-bed-calc__summary {
  background: var(--sg-bc-surface);
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 14px 16px;
}
.sg-bed-calc__summary h3 {
  font-size: 11px;
  color: var(--sg-bc-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  padding: 0;
}
.sg-bed-calc__tag {
  display: inline-block;
  background: var(--sg-bc-surface-2);
  border: 1px solid var(--sg-bc-border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  margin: 2px 3px 2px 0;
  color: var(--sg-bc-text-dim);
}
.sg-bed-calc__tag.is-active {
  background: var(--sg-bc-accent-soft);
  border-color: var(--sg-bc-accent);
  color: var(--sg-bc-accent);
}

/* ─── BED VISUAL ─── */
.sg-bed-calc__visual {
  background: var(--sg-bc-surface);
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  overflow: hidden;
}
.sg-bed-calc__visual svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* ─── LOADING STATE ─── */
.sg-bed-calc__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--sg-bc-text-dim);
  font-size: 14px;
}
.sg-bed-calc__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sg-bc-surface-3);
  border-top-color: var(--sg-bc-accent);
  border-radius: 50%;
  animation: sg-bed-calc-spin 0.8s linear infinite;
}
@keyframes sg-bed-calc-spin {
  to { transform: rotate(360deg); }
}

/* ─── ERROR STATE ─── */
.sg-bed-calc__error {
  padding: 40px 20px;
  text-align: center;
  color: var(--sg-bc-accent);
  font-size: 14px;
}

/* ─── NO MATCH ─── */
.sg-bed-calc__no-match {
  background: var(--sg-bc-surface);
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 32px 18px;
  text-align: center;
  margin-bottom: 10px;
}
.sg-bed-calc__no-match-icon {
  font-size: 28px;
  color: var(--sg-bc-accent);
  margin-bottom: 8px;
}
.sg-bed-calc__no-match-text {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.sg-bed-calc__no-match-hint {
  font-size: 12px;
  color: var(--sg-bc-text-dim);
}

/* ─── PRODUCT IMAGE ─── */
.sg-bed-calc__product-img {
  background: #fff;
  border: 1px solid var(--sg-bc-border);
  border-radius: var(--sg-bc-radius);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sg-bed-calc__product-img img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
}

/* ─── PRODUCT INFO ─── */
.sg-bed-calc__product-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
}
.sg-bed-calc__product-model {
  font-size: 12px;
  color: var(--sg-bc-text-dim);
  margin-bottom: 8px;
}

/* ─── MATCH COUNT ─── */
.sg-bed-calc__match-count {
  font-size: 13px;
  color: var(--sg-bc-text-dim);
  margin-bottom: 4px;
}
.sg-bed-calc__total-value--range {
  font-size: 16px;
  white-space: nowrap;
  /* Range (когда выбран не до конца) — выравнивание по левому краю,
     чтобы и цена, и подсказка под ней начинались от того же края, что и лейбл */
  margin-left: 0;
  text-align: left;
}

/* В режиме диапазона строка-контейнер тоже левая, без space-between */
.sg-bed-calc__total-row:has(.sg-bed-calc__total-value--range) {
  justify-content: flex-start;
}

/* Подсказка под диапазоном — тоже слева (только в incomplete-карточке,
   где есть match-count перед per-unit) */
.sg-bed-calc__match-count ~ .sg-bed-calc__per-unit {
  text-align: left;
}

/* ─── CTA as link ─── */
a.sg-bed-calc__cta {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #fff;
}
.sg-bed-calc__cta--outline {
  background: transparent;
  border: 1px solid var(--sg-bc-accent);
  color: var(--sg-bc-accent);
}
.sg-bed-calc__cta--outline:hover {
  background: var(--sg-bc-accent);
  color: #fff;
}
a.sg-bed-calc__cta--outline { color: var(--sg-bc-accent); }
a.sg-bed-calc__cta--outline:hover { color: #fff; }

/* ─── PRICE TIERS ─── */
.sg-bed-calc__tiers {
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--sg-bc-text-dim);
  border: 1px solid var(--sg-bc-border);
  border-radius: 6px;
  overflow: hidden;
}
.sg-bed-calc__tier {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
}
.sg-bed-calc__tier + .sg-bed-calc__tier {
  border-top: 1px solid var(--sg-bc-border);
}
.sg-bed-calc__tier.is-active {
  background: var(--sg-bc-accent);
  color: #fff;
  font-weight: 600;
}

/* ─── STICKY MOBILE BAR (показывается только на мобиле) ─── */
.sg-bed-calc__sticky-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

@media (max-width: 600px) {
  .sg-bed-calc__sticky-bar {
    display: flex;
  }

  /* Чтобы низ калькулятора не уезжал под фикс-бар */
  .sg-bed-calc__root,
  .sg-bed-calc {
    padding-bottom: 80px;
  }
}

.sg-bed-calc__sticky-bar:active {
  background: #fafafa;
}

.sg-bed-calc__sticky-bar-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.sg-bed-calc__sticky-bar-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Серый фон только у плейсхолдера (когда у товара нет картинки) */
.sg-bed-calc__sticky-bar-img--ph {
  background: #f0f0f0;
}

.sg-bed-calc__sticky-bar-info {
  flex: 1 1 auto;
  min-width: 0;
}

.sg-bed-calc__sticky-bar-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1e;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.sg-bed-calc__sticky-bar-sub {
  font-size: 12px;
  color: #71717a;
  margin-top: 2px;
}

.sg-bed-calc__sticky-bar.is-ready .sg-bed-calc__sticky-bar-sub {
  color: #0078a1;
  font-weight: 600;
}

.sg-bed-calc__sticky-bar-cta {
  flex-shrink: 0;
  background: #0078a1;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sg-bed-calc__sticky-bar-cta:active {
  background: #006285;
}

.sg-bed-calc__sticky-bar-arrow {
  flex-shrink: 0;
  font-size: 24px;
  line-height: 1;
  color: #c4c4c8;
}
