/* Смета на монтаж (/smeta-montazha-kondicionera/): инструмент мастера на объекте.
   Телефон в первую очередь: одна колонка строк, кнопки «−/+» по 48 px, итог всегда внизу экрана.
   На компьютере строки слева, итог и кнопки в липкой панели справа. Язык сайта: белые карточки, один синий, пилюли. */

/* Первый экран короткий: крошки, заголовок, подзаголовок. Карточки цены нет, чтобы смета была видна сразу */
.sm-hero { padding: 24px 0 40px; }
.sm-hero-in { max-width: calc(820px + var(--gx) * 2); }
.sm-hero .hero-sub { max-width: 640px; margin-top: 16px; }

/* Инструмент выше обычного блока: меньше воздуха сверху, чтобы на телефоне смета была на первом экране */
.sm-sec > .wrap { padding-block: 40px 56px; }
.sm { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.sm-main { display: grid; gap: 20px; min-width: 0; }

/* Шаблоны: что делаем и мощность */
.sm-pick { display: grid; gap: 12px; padding: 20px 22px; border-radius: 24px; background: #fff; box-shadow: 0 0 0 2px #DCEFFD; }
.sm-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sm-pick-l { margin-right: 4px; color: var(--mute); font-size: var(--t-sm); font-weight: 600; }
.sm-chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  background: #fff; color: var(--ink); font-size: var(--t-sm); font-weight: 600; transition: border-color .2s var(--ease-std), background-color .2s var(--ease-std), color .2s var(--ease-std);
}
.sm-chip--cls { min-width: 56px; padding: 0 14px; }
.sm-chip.is-on { border-color: var(--brand); background: var(--brand); color: #fff; }
@media (hover: hover) and (pointer: fine) { .sm-chip:not(.is-on):hover { border-color: var(--brand); } }

/* Строки сметы: название, степпер одной ширины, сумма, крестик «убрать» */
.sm-lines { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sm-line {
  display: grid; grid-template-columns: minmax(0, 1fr) 152px 104px 36px; align-items: center; gap: 12px 16px; padding: 12px 10px 12px 20px;
  border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .25s var(--ease-std), background-color .25s var(--ease-std);
}
.sm-line.is-on { box-shadow: 0 0 0 1.5px #BFDDF7, 0 12px 26px -22px rgba(27, 116, 194, .5); }
.sm-line-t { min-width: 0; }
.sm-line-t b { display: block; font-size: var(--t-md); line-height: 1.3; }
.sm-line-t small { display: block; margin-top: 2px; color: var(--mute); font-size: var(--t-xs); }
.sm-line-t small i { font-style: normal; }
.sm-sum { justify-self: end; font-size: var(--t-lg); font-weight: 700; letter-spacing: -.02em; color: var(--brand-ink); white-space: nowrap; }
.sm-del { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--mute); transition: background-color .15s var(--ease-std), color .15s var(--ease-std); }
.sm-del .ico { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .sm-del:hover { background: #FBEAE8; color: var(--err); } }
/* Строка «Часто добавляют»: название и кнопка «Добавить», без количества */
.sm-line--off { grid-template-columns: minmax(0, 1fr) auto; padding-right: 10px; background: transparent; }
.sm-line--off .sm-line-t b { font-weight: 600; }
.sm-addline { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: #fff; color: var(--brand-ink); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; transition: border-color .2s var(--ease-std), background-color .2s var(--ease-std), color .2s var(--ease-std); }
.sm-addline .ico { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .sm-addline:hover { border-color: var(--brand); background: var(--brand); color: #fff; } }

/* Степпер: всегда 152 px — «−» 44, число с единицей 56, «+» 44. Подпись единицы под числом, на ширину кнопок не влияет */
.sm-qty { display: grid; grid-template-columns: 44px 56px 44px; align-items: center; width: 152px; padding: 3px; border-radius: var(--r-pill); background: var(--panel); }
.sm-qty button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--brand-ink); box-shadow: 0 1px 2px rgba(15, 27, 42, .08); transition: background-color .15s var(--ease-std), color .15s var(--ease-std), transform .12s var(--ease-ui, var(--ease)); }
.sm-qty button:active { transform: scale(.94); }
.sm-qty button:disabled { color: #B9C4D0; box-shadow: none; background: transparent; }
.sm-qty .ico { width: 18px; height: 18px; }
.sm-qty-v { display: grid; justify-items: center; line-height: 1; }
.sm-qty input { width: 52px; padding: 6px 0; margin-block: -6px; border: 0; background: transparent; text-align: center; font-size: var(--t-md); font-weight: 700; line-height: 1.2; -moz-appearance: textfield; appearance: textfield; }
.sm-qty input::-webkit-outer-spin-button, .sm-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sm-qty input:focus-visible { outline: 2px solid var(--brand); outline-offset: -5px; border-radius: 8px; }  /* поле выше на 12 px (зона пальца), рамка фокуса прежнего размера */
.sm-qty-u { max-width: 54px; overflow: hidden; text-overflow: ellipsis; color: var(--mute); font-size: 11px; font-weight: 600; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .sm-qty button:not(:disabled):hover { background: var(--brand); color: #fff; } }

.sm-more { display: grid; gap: 10px; }
.sm-more-t { padding-left: 4px; color: var(--mute); font-size: var(--t-sm); font-weight: 600; }
.sm-add { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 48px; padding: 0 20px 0 14px; border: 1.5px dashed #B9CCE0; border-radius: var(--r-pill); background: transparent; color: var(--brand-ink); font-weight: 600; transition: border-color .2s var(--ease-std), background-color .2s var(--ease-std); }
.sm-add .ico { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .sm-add:hover { border-color: var(--brand); background: #fff; } }

/* Итог справа: липкий, как у калькулятора */
.sm-aside { position: sticky; top: 100px; display: grid; gap: 16px; padding: 24px; border-radius: 24px; background: #fff; box-shadow: 0 0 0 2px #DCEFFD, var(--shadow); }
.sm-total { display: grid; gap: 4px; }
.sm-total small { color: var(--mute); font-size: var(--t-sm); font-weight: 600; }
.sm-total b { font-size: clamp(34px, 3vw, 42px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; color: var(--brand-ink); }
.sm-total-n { color: var(--mute); font-size: var(--t-xs); }
.sm-acts { display: grid; gap: 8px; }
.sm-acts .btn { width: 100%; }
.sm-acts .ico { width: 18px; height: 18px; }
.sm-acts--mobile { display: none; }
.sm-note { color: var(--mute); font-size: var(--t-xs); line-height: 1.5; }
.sm-reset { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--mute); font-size: var(--t-sm); font-weight: 600; transition: color .2s var(--ease-std); }
.sm-reset .ico { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .sm-reset:hover { color: var(--ink); } }
.sm-bar { display: none; }
.sm-how { margin-top: 24px; }

/* Экран для клиента и выбор строки: модальные окна на весь экран, сдержанное появление */
.sm-show, .sm-pick-dlg { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: var(--ink); }
.sm-show::backdrop, .sm-pick-dlg::backdrop { background: rgba(15, 27, 42, .5); }
.sm-show[open], .sm-pick-dlg[open] { animation: smIn .25s var(--ease-ui, var(--ease)) both; }
@keyframes smIn { from { opacity: 0; transform: translateY(8px); } }
.sm-show-in { display: grid; gap: 20px; align-content: start; width: min(720px, 100%); min-height: 100%; margin: 0 auto; padding: 24px var(--gx) 40px; }
.sm-show-top, .sm-pick-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sm-show-brand { color: var(--mute); font-size: var(--t-sm); font-weight: 600; }
.sm-x { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); flex: none; }
.sm-x .ico { width: 20px; height: 20px; }
.sm-show-h { font-size: clamp(26px, 4vw, 40px); }
.sm-show-lines { display: grid; margin: 0; padding: 0; list-style: none; }
.sm-show-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: clamp(17px, 2.4vw, 22px); }
.sm-show-lines li span small { display: block; color: var(--mute); font-size: var(--t-sm); }
.sm-show-lines li b { white-space: nowrap; font-weight: 600; }
.sm-show-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 6px; }
.sm-show-total span { font-size: var(--t-lg); color: var(--mute); }
.sm-show-total b { font-size: clamp(40px, 7vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--brand-ink); }
.sm-show-note { color: var(--mute); font-size: var(--t-sm); line-height: 1.5; }

.sm-pick-in { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(720px, 100%); height: 100%; margin: 0 auto; padding: 16px var(--gx) 0; }
.sm-search { display: flex; align-items: center; gap: 10px; flex: 1; min-height: 52px; padding: 0 16px; border-radius: var(--r-pill); background: var(--panel); }
.sm-search .ico { width: 20px; height: 20px; color: var(--mute); flex: none; }
.sm-search input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; font-weight: 500; }
.sm-search input:focus { outline: none; }
.sm-pick-list { overflow: auto; padding: 16px 0 32px; overscroll-behavior: contain; }
.sm-pick-cat { margin: 18px 0 8px 4px; color: var(--mute); font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sm-pick-cat:first-child { margin-top: 0; }
.sm-pick-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; border-radius: 16px; background: none; text-align: left; font-size: var(--t-sm); font-weight: 600; transition: background-color .15s var(--ease-std); }
.sm-pick-item small { display: block; color: var(--mute); font-weight: 500; font-size: var(--t-xs); }
.sm-pick-item b { white-space: nowrap; color: var(--brand-ink); }
.sm-pick-item.is-in { color: var(--mute); }
.sm-pick-item.is-in b { color: var(--mute); }
@media (hover: hover) and (pointer: fine) { .sm-pick-item:hover { background: var(--ice); } }
.sm-pick-empty { padding: 24px 16px; color: var(--mute); }

.sm-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90; padding: 12px 20px; border-radius: var(--r-pill); background: var(--navy); color: #fff; font-size: var(--t-sm); font-weight: 600; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .25s var(--ease-std), transform .25s var(--ease-ui, var(--ease)); }
.sm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Из чего складывается цена: нумерованный список и три примера */
.sm-text { max-width: 820px; }
.sm-why { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: w; }
.sm-why li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 16px; padding: 18px 22px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.sm-why li::before { counter-increment: w; content: counter(w); grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ice); color: var(--brand-ink); font-weight: 700; }
.sm-why b { font-size: var(--t-md); }
.sm-why span { color: var(--mute); font-size: var(--t-sm); line-height: 1.55; }
.sm-ex { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.sm-ex li { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: 24px; background: var(--panel); }
.sm-ex-t { font-size: var(--t-lg); letter-spacing: -.01em; }
.sm-ex small { color: var(--mute); font-size: var(--t-sm); }
.sm-ex-rows { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--t-xs); }
.sm-ex-rows li { display: flex; justify-content: space-between; gap: 10px; padding: 0; background: none; }
.sm-ex-rows li span { color: var(--mute); }
.sm-ex-rows li b { font-weight: 600; white-space: nowrap; }
.sm-ex-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sm-ex-total b { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; color: var(--brand-ink); }
.sm-ex .link { margin-top: 2px; }

/* На этой странице своя нижняя панель: общую прячем */
.dock { display: none !important; }

@media (max-width: 1000px) {
  .sm { grid-template-columns: minmax(0, 1fr); }
  .sm-aside { display: none; }
  .sm-acts--mobile { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sm-bar {
    position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 4px calc(var(--gx) * -1) 0; padding: 10px var(--gx) calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .sm-bar-sum { display: grid; line-height: 1.1; }
  .sm-bar-sum small { color: var(--mute); font-size: var(--t-xs); font-weight: 600; }
  .sm-bar-sum b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--brand-ink); white-space: nowrap; }
  .sm-bar .btn { height: 52px; padding: 0 22px; }
  .sm-ex { grid-template-columns: minmax(0, 1fr); }
  main { padding-bottom: 0; }
}
@media (max-width: 760px) {
  .sm-hero { padding: 12px 0 28px; }
  .sm-hero .hero-sub { font-size: var(--t-md); margin-top: 12px; }
  .sm-sec > .wrap { padding-block: 24px 40px; }
  .sm-pick { padding: 14px 16px; border-radius: 20px; }
  .sm-chip { min-height: 42px; padding: 0 14px; }
  .sm-chip--cls { min-width: 48px; padding: 0 10px; }
  /* Телефон: название строкой, ниже степпер, сумма и крестик в один ряд */
  .sm-line { grid-template-columns: 152px minmax(0, 1fr) 36px; gap: 10px 10px; padding: 12px 10px 12px 14px; }
  .sm-line-t { grid-column: 1 / -1; }
  .sm-line--off { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .sm-line--off .sm-line-t { grid-column: auto; }
  .sm-sum { font-size: var(--t-md); }
  .sm-acts--mobile .btn { min-height: 52px; padding: 10px 12px; font-size: 14px; }
  .sm-why li { grid-template-columns: 34px minmax(0, 1fr); padding: 16px; }
  .sm-why li::before { width: 34px; height: 34px; }
  .sm-sec.band { margin-inline: 0; border-radius: 0; }
  .sm-bar { margin-inline: calc(var(--gx) * -1); }
  .sm-show-in { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sm-show[open], .sm-pick-dlg[open] { animation: none; } }

/* Цена строки правится прямо в смете (Максим 02.11): цена — кнопка с гаечным ключом, своя цена подсвечена,
   рядом «по прайсу …» возвращает прайсовую. Только для этой сметы, прайс в кабинете не меняется */
.sm-price { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-bottom: 1px dashed rgb(91 103 118 / .45); }
.sm-price .ico { width: 13px; height: 13px; opacity: .6; }
.sm-price.is-custom { color: #B45309; border-bottom-color: rgb(180 83 9 / .5); font-weight: 600; }
.sm-preset { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.sm-pedit { display: inline-flex; align-items: center; gap: 6px; }
.sm-pedit input { width: 110px; height: 36px; padding: 0 10px; border: 1.5px solid var(--brand); border-radius: 10px; font: 600 var(--t-sm) var(--font); text-align: right; }
/* Быстрый набор из кабинета: звёздочка у строки в «Часто добавляют» */
.sm-fav { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; color: #E0A11F; }
.sm-fav .ico { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .sm-price:hover { color: var(--ink); border-bottom-color: var(--ink); } }

.sm-show-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sm-show-acts .btn { flex: 1 1 200px; justify-content: center; }
