/* 3. Калькулятор. Карточка одной высоты: слева путь по вопросам и живая сумма, справа вопрос или итог.
   Вопросы сменяются сдвигом, суммы считаются вверх, высота не меняется ни на одном шаге. */
.calc {
  display: grid; grid-template-columns: 290px minmax(0, 1fr); height: 660px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px rgba(27, 116, 194, .08);
}
.calc-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 32px 24px; background: linear-gradient(180deg, #F2F8FE 0%, #E6F1FB 100%); }
.calc-map { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: q; }
.calc-map li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px 6px 6px; border-radius: 14px;
  color: var(--mute); font-size: var(--t-sm); font-weight: 500; transition: background-color .3s var(--ease-std), color .3s var(--ease-std);
}
.calc-map li::before {
  counter-increment: q; content: counter(q); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid #B9CCE0; background: #fff; font-size: var(--t-xs); font-weight: 700;
  transition: background-color .3s var(--ease-std), border-color .3s var(--ease-std), color .3s var(--ease-std);
}
.calc-map li span { display: block; line-height: 1.25; }
.calc-map li small { display: block; color: var(--brand-ink); font-weight: 600; font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-map li.is-done { color: var(--ink); }
.calc-map li.is-done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: #fff; }
.calc-map li.is-now { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 8px 18px -14px rgba(15, 27, 42, .4); }
.calc-map li.is-now::before { border-color: var(--brand); color: var(--brand); }
.calc-sum { display: grid; gap: 4px; padding: 18px; border-radius: 18px; background: #fff; }
.calc-sum small { color: var(--mute); font-size: var(--t-xs); font-weight: 500; }
.calc-sum b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--brand-ink); }

.calc-main { display: flex; flex-direction: column; min-width: 0; padding: 32px 36px 28px; }
.calc-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calc-step { font-size: var(--t-sm); font-weight: 600; color: var(--mute); white-space: nowrap; }
.calc-bar { flex: 0 1 220px; height: 6px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.calc-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--brand); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease); }

.calc-stage { position: relative; flex: 1; min-height: 0; margin-top: 22px; overflow: hidden; }
.cq { position: absolute; inset: 0; display: flex; flex-direction: column; }
.cq.is-in { animation: cqIn .45s var(--ease) both; }
.cq.is-back { animation: cqBack .45s var(--ease) both; }
.cq.is-out { animation: cqOut .3s var(--ease-std) both; pointer-events: none; }
.cq.is-out-back { animation: cqOutBack .3s var(--ease-std) both; pointer-events: none; }
@keyframes cqIn { from { opacity: 0; transform: translateX(36px); } }
@keyframes cqBack { from { opacity: 0; transform: translateX(-36px); } }
@keyframes cqOut { to { opacity: 0; transform: translateX(-24px); } }
@keyframes cqOutBack { to { opacity: 0; transform: translateX(24px); } }
.cq h3 { font-size: clamp(24px, 2.4vw, 30px); }
.cq-hint { margin-top: 8px; color: var(--mute); font-size: var(--t-sm); }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.opts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Первый вопрос: две крупные карточки на всю высоту экрана */
.opts--big { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); max-height: 300px; }
.opts--big .opt { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 18px; padding: 26px; font-size: var(--t-xl); letter-spacing: -.01em; }
.opts--big .opt .ico { width: 40px; height: 40px; padding: 12px; border-radius: 16px; }
.opts--big .opt small { margin-top: 8px; font-size: var(--t-sm); letter-spacing: 0; }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left;
  font-size: var(--t-md); font-weight: 600; line-height: 1.25;
  transition: border-color .2s var(--ease-std), background-color .2s var(--ease-std), transform .18s var(--ease), box-shadow .25s var(--ease-std);
  animation: optIn .45s var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 45ms);
}
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } }
.opt .ico { width: 30px; height: 30px; padding: 6px; border-radius: 12px; background: var(--ice); color: var(--brand); box-sizing: content-box; transition: background-color .2s var(--ease-std), color .2s var(--ease-std); }
.opt small { display: block; margin-top: 3px; font-size: var(--t-xs); font-weight: 500; color: var(--mute); }
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--ice); box-shadow: 0 0 0 3px rgba(27, 116, 194, .12); }
.opt[aria-pressed="true"] .ico { background: var(--brand); color: #fff; }
.opt:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .opt:hover { border-color: var(--brand); } }

/* Как считает калькулятор: короткий абзац под карточкой */
.calc-how { max-width: 760px; margin: 28px auto 0; color: var(--mute); font-size: var(--t-sm); line-height: 1.55; text-align: center; text-wrap: pretty; }
.calc-how b { color: var(--ink); font-weight: 600; }
.lf .calc-how { color: var(--on-lenta); }
.lf .calc-how b { color: #fff; }

/* Итог: три модели */
.res { display: flex; flex-direction: column; height: 100%; }
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.res-head h3 { font-size: clamp(22px, 2.2vw, 28px); }
.res-head span { color: var(--mute); font-size: var(--t-sm); white-space: nowrap; }
.models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.model {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--surface); text-align: left; cursor: pointer;
  transition: border-color .25s var(--ease-std), box-shadow .25s var(--ease-std), transform .35s var(--ease);
  animation: optIn .5s var(--ease) both; animation-delay: calc(100ms + var(--i, 0) * 80ms);
}
.model.is-pick { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27, 116, 194, .14), 0 18px 32px -22px rgba(27, 116, 194, .6); transform: translateY(-3px); }
.model-badge { position: absolute; right: 12px; top: -11px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; }
.model-img { display: grid; place-items: center; height: 74px; margin: -4px -4px 0; border-radius: 12px; background: linear-gradient(180deg, #F4F8FC, #fff); overflow: hidden; }
.model-img img { max-height: 64px; width: auto; max-width: 92%; object-fit: contain; }
.model-more { align-self: flex-start; margin-top: 2px; color: var(--brand-ink); font-size: var(--t-xs); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.model-tier { color: var(--brand-ink); font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.model-name { font-weight: 700; line-height: 1.25; }
.model-name small { display: block; color: var(--mute); font-weight: 500; font-size: var(--t-xs); }
.model-pitch { color: var(--mute); font-size: var(--t-xs); line-height: 1.4; min-height: 34px; }
.model-feat { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--t-xs); font-weight: 500; }
.model-feat li { display: flex; align-items: center; gap: 8px; }
.model-feat .ico { width: 16px; height: 16px; color: var(--brand); }
/* В карточке модели одна цена: самого кондиционера. Сумма с установкой раскладывается слева в итоге (Максим 25.10) */
.model-price { display: grid; gap: 2px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.model-price span { color: var(--mute); font-size: var(--t-xs); }
.model-price b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.calc-sum-lines { display: grid; gap: 6px; margin: 0 0 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.calc-sum-lines[hidden] { display: none; }
.calc-sum-lines div { display: flex; justify-content: space-between; gap: 8px; }
.calc-sum-lines dt { color: var(--mute); }
.calc-sum-lines dd { margin: 0; color: var(--ink); font-weight: 600; }
/* На узком экране левой колонки нет: раскладка строкой под моделями */
.res-total { display: none; }
@media (max-width: 1000px) {
  .res-total { display: grid; gap: 6px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--ice); color: var(--mute); font-size: var(--t-sm); }
  .res-total div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .res-total-sum { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--ice-2); }
  .res-total b { color: var(--ink); font-weight: 600; }
  .res-total .res-total-v { color: var(--brand-ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
}
.res-foot { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.res-foot .btn { margin-left: auto; flex: none; }
.calc.is-result .calc-nav { display: none; }
.res-note { margin-top: auto; padding-top: 16px; color: var(--mute); font-size: var(--t-xs); line-height: 1.5; max-width: 560px; }
.res-note + .res-foot { margin-top: 0; padding-top: 14px; border-top: 0; }

/* Итог: установка своего кондиционера построчно */
.lines { display: grid; gap: 0; margin-top: 18px; border-radius: var(--r); background: var(--panel); padding: 8px 20px; }
.lines div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); animation: optIn .45s var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 50ms); }
.lines div:last-child { border-bottom: 0; }
.lines b { white-space: nowrap; }
.lines-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 18px; }
.lines-total span { color: var(--mute); }
.lines-total b { font-size: clamp(30px, 3vw, 40px); font-weight: 700; letter-spacing: -.03em; color: var(--brand-ink); }

.calc-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; white-space: nowrap; flex: none; border: 0; background: none; color: var(--mute); font-weight: 600; transition: color .2s var(--ease-std), opacity .2s var(--ease-std); }
.calc-back .ico { width: 18px; height: 18px; }
.calc-back[hidden] { display: inline-flex !important; visibility: hidden; }
@media (hover: hover) and (pointer: fine) { .calc-back:hover { color: var(--ink); } }
.calc-noscript { padding: 24px; }

@media (max-width: 1000px) {
  .calc { grid-template-columns: minmax(0, 1fr); height: auto; }
  .calc-aside { display: none; }
  .calc-main { height: 680px; }
}
@media (max-width: 760px) {
  .calc { border-radius: 24px; }
  .calc-main { height: 720px; padding: 22px 16px 16px; }
  .opts, .opts--3 { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
  .opts--big { grid-template-rows: none; max-height: none; flex: none; }
  .opts--big .opt { min-height: 150px; padding: 20px; font-size: var(--t-lg); }
  .opt { min-height: 60px; padding: 10px 12px; }
  .opt .ico { width: 24px; height: 24px; padding: 5px; }
  /* Три модели листаются вбок, высота карточки та же */
  .models { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-inline: -16px; padding: 14px 16px 6px; scrollbar-width: none; }
  .models::-webkit-scrollbar { display: none; }
  .model { flex: 0 0 82%; scroll-snap-align: center; }
  .res-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .res-foot .btn { width: 100%; margin-left: 0; order: -1; }
  .res-foot .calc-back { order: 2; align-self: center; }
  .res-note { display: none; }
  .calc-nav .btn { flex: 1; }
}
.model-img img { mix-blend-mode: multiply; }

/* Итог с тремя моделями выше вопросов: карточка вырастает, иначе кнопка «Оставить заявку» пряталась под край (правка Максима 24.10) */
.calc.is-result, .calc.is-result .calc-main { height: auto; min-height: 660px; }
.calc.is-result .calc-stage { overflow: visible; }
.calc.is-result .cq:last-child { position: relative; inset: auto; }
@media (max-width: 1000px) { .calc.is-result .calc-main { min-height: 0; } }
.res-acts { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.res-tel { color: var(--mute); font-size: var(--t-sm); }
.res-tel b { color: var(--brand-ink); font-weight: 600; }
@media (max-width: 760px) { .res-acts { flex-direction: column-reverse; align-items: stretch; width: 100%; gap: 8px; } .res-tel { text-align: center; } .res-note { display: block; } }
.opts--big { max-height: none; flex: none; grid-template-rows: none; }
.opts--big .opt .ico { margin-bottom: 6px; }
@media (max-width: 760px) { .opts--big { grid-template-columns: minmax(0, 1fr); } .opts--big .opt { flex-direction: row; align-items: center; min-height: 0; padding: 16px; } .opts--big .opt .ico { margin: 0; } }
.calc-sum-hint { color: var(--mute); font-size: var(--t-xs); }
.calc-sum.has-sum .calc-sum-hint { display: none; }
