/* =========================================
   Калькулятор PRO.ВЫВОЗ
   Используется только внутри .calculator-page
   ========================================= */

/* Локальные переменные калькулятора.
   Не меняют variables.css и остальной сайт. */
.calculator-page {
  --calculator-cream: #fdfcf6;
  --calculator-mint: #eaf3eb;
  --calculator-mint-dark: #e1eee2;
  --calculator-yellow-light: #fbf1d2;
  --calculator-sage: #718a72;

  background: var(--calculator-cream);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

.calculator-page *,
.calculator-modal *,
.calculator-mobilebar * {
  box-sizing: border-box;
}

/* =========================================
   Основной контейнер и заголовок
   ========================================= */

.calculator-page .pv {
  max-width: 1380px;
  margin: 0 auto;
  padding: 66px 28px 90px;
}

.calculator-page .head {
  max-width: 900px;
  margin: 0 auto 31px;
  text-align: center;
}

.calculator-page .tag,
.calculator-modal .tag {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 99px;
  background: var(--calculator-sage);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.calculator-page .head h1,
.calculator-page .head h2 {
  margin: 15px 0 10px;
  color: var(--ink);
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.065em;
}

.calculator-page .head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

/* =========================================
   Сетка: каталог слева, результат справа
   ========================================= */

.calculator-page .layout {
  display: grid;
  grid-template-columns: 1.27fr 0.94fr;
  align-items: start;
  gap: 18px;
}

/* =========================================
   Каталог товаров
   ========================================= */

.calculator-page .catalog {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 31px;
  background: #fffefb;
}

.calculator-page .catalog h2,
.calculator-page .catalog h3 {
  margin: 0 0 23px;
  color: var(--ink);
  font-size: 31px;
  letter-spacing: -0.045em;
}

.calculator-page .tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.calculator-page .tabs button,
.calculator-page .floor button {
  padding: 14px 22px;
  border: 0;
  border-radius: 99px;
  background: #edf1eb;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.calculator-page .tabs button:hover,
.calculator-page .floor button:hover {
  transform: translateY(-1px);
}

.calculator-page .tabs button.active,
.calculator-page .floor button.active {
  background: var(--yellow);
}

.calculator-page .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.calculator-page .item {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 27px;
  border-radius: 23px;
  background: var(--mint);
}

.calculator-page .item:nth-child(2n) {
  background: var(--calculator-yellow-light);
}

.calculator-page .itemtop {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.calculator-page .icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}

.calculator-page .name {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.22;
}

.calculator-page .price {
  margin-top: 10px;
  color: var(--ink);
  font-size: 15px;
}

.calculator-page .counter {
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  gap: 30px;
  margin-top: auto;
  padding: 8px 13px;
  border-radius: 99px;
  background: rgb(255 255 255 / 38%);
}

.calculator-page .counter button {
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  background: #edf4ed;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.calculator-page .counter button:last-child {
  background: #eaf4ec;
}

.calculator-page .counter b {
  min-width: 18px;
  color: var(--ink);
  font-size: 16px;
  text-align: center;
}

/* =========================================
   Блок расчёта и машины
   ========================================= */

.calculator-page .result {
  position: sticky;
  top: 14px;
  min-height: 625px;
  padding: 30px;
  border-radius: 31px;
  background: linear-gradient(
    145deg,
    var(--calculator-mint),
    var(--calculator-mint-dark)
  );
}

.calculator-page .result .caption {
  color: var(--ink);
  font-size: 17px;
}

.calculator-page .truckname {
  margin-top: 10px;
  color: var(--ink);
  font-size: 43px;
  font-weight: 850;
  letter-spacing: -0.055em;
}

.calculator-page .truckbox {
  position: relative;
  max-width: 530px;
  margin: 16px auto 10px;
  text-align: center;
}

.calculator-page .badge {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 8px 18px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(17px);
}

.calculator-page .truck-img {
  display: block;
  width: 100%;
  max-height: 245px;
  object-fit: contain;
  filter: drop-shadow(0 9px 7px rgb(33 58 39 / 12%));
}

.calculator-page .meter {
  width: 78%;
  height: 14px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 99px;
  background: #ffffff;
}

.calculator-page .meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--yellow);
  transition: width 0.25s ease;
}

.calculator-page .volume {
  margin: 11px 0 25px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

/* =========================================
   Цена и кнопка заявки
   ========================================= */

.calculator-page .total {
  display: block;
  margin-top: 10px;
  padding: 24px;
  border-radius: 24px;
  background: #fffefb;
}

.calculator-page .total span {
  display: block;
  color: var(--muted);
  font-size: 15px;
}

.calculator-page .total strong {
  display: block;
  margin: 7px 0;
  color: var(--ink);
  font-size: 42px;
  letter-spacing: -0.06em;
}

.calculator-page .total small {
  color: var(--muted);
  font-size: 14px;
}

.calculator-page .order,
.calculator-modal .order {
  width: 100%;
  margin-top: 20px;
  padding: 18px;
  border: 0;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculator-page .order:hover,
.calculator-modal .order:hover {
  box-shadow: 0 8px 18px rgb(129 99 0 / 16%);
  transform: translateY(-2px);
}

.calculator-page .fine {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* =========================================
   Настройки: этаж, лифт, разборка
   ========================================= */

.calculator-page .opts {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 18px;
  padding: 22px 32px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fffefb;
}

.calculator-page .floor {
  display: flex;
  align-items: center;
  gap: 20px;
}

.calculator-page .floor label,
.calculator-page .toggle {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.calculator-page .floor button {
  min-width: 47px;
  padding: 13px;
}

.calculator-page .toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.calculator-page .toggle input {
  position: relative;
  width: 45px;
  height: 25px;
  margin: 0;
  appearance: none;
  border-radius: 99px;
  background: #cfd6cf;
  cursor: pointer;
}

.calculator-page .toggle input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  content: "";
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.calculator-page .toggle input:checked {
  background: #8ca58c;
}

.calculator-page .toggle input:checked::after {
  transform: translateX(20px);
}

/* =========================================
   Нижняя панель калькулятора
   На ПК скрыта
   ========================================= */

.calculator-mobilebar {
  display: none;
}

/* =========================================
   Модальное окно заявки
   ========================================= */

.calculator-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 15px;
  background: rgb(20 45 32 / 48%);
}

.calculator-modal.show {
  display: grid;
}

.calculator-modal .modalin {
  position: relative;
  width: min(460px, 100%);
  padding: 35px;
  border-radius: 26px;
  background: var(--calculator-cream);
}

.calculator-modal .modalin h3 {
  margin: 14px 0;
  color: var(--ink);
  font-size: 30px;
}

.calculator-modal .modalin p {
  color: var(--muted);
  line-height: 1.5;
}

.calculator-modal .modalin input {
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
}

.calculator-modal .close {
  position: absolute;
  top: 10px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  cursor: pointer;
}

/* =========================================
   Планшеты: одна колонка
   ========================================= */

@media (max-width: 900px) {
  .calculator-page .head h1,
  .calculator-page .head h2 {
    font-size: 43px;
  }

  .calculator-page .layout {
    grid-template-columns: 1fr;
  }

  .calculator-page .result {
    position: relative;
    top: auto;
    order: -1;
    min-height: 0;
  }

  .calculator-page .truck-img {
    max-height: 210px;
  }

  .calculator-page .opts {
    flex-wrap: wrap;
  }

  .calculator-page .toggle {
    padding-left: 0;
    border-left: 0;
  }
}

/* =========================================
   Телефоны
   ========================================= */

@media (max-width: 620px) {
  body {
    padding-bottom: 82px;
  }

  .calculator-page {
    padding-bottom: 82px;
  }

  .calculator-page .pv {
    padding: 28px 13px 22px;
  }

  .calculator-page .head {
    margin-bottom: 15px;
  }

  .calculator-page .tag,
  .calculator-modal .tag {
    padding: 6px 11px;
    font-size: 10px;
  }

  .calculator-page .head h1,
  .calculator-page .head h2 {
    margin: 8px 0 6px;
    font-size: 25px;
    line-height: 1.05;
    letter-spacing: -0.045em;
  }

  .calculator-page .head p {
    max-width: 310px;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.35;
  }

  /* На телефоне сначала товары, затем машина и цена */
  .calculator-page .layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .calculator-page .catalog {
    order: 1;
    padding: 16px 12px;
    border-radius: 23px;
  }

  .calculator-page .result {
    position: relative;
    z-index: auto;
    top: auto;
    order: 2;
    min-height: 0;
    padding: 15px 14px;
    border-radius: 20px;
    box-shadow: none;
  }

  .calculator-page .catalog h2,
  .calculator-page .catalog h3 {
    margin-bottom: 12px;
    font-size: 19px;
  }

  .calculator-page .tabs {
    gap: 7px;
    margin-right: -12px;
    margin-bottom: 12px;
    padding-right: 12px;
    overflow-x: auto;
  }

  .calculator-page .tabs button {
    padding: 10px 12px;
    font-size: 11px;
    white-space: nowrap;
  }

  .calculator-page .grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .calculator-page .item {
    min-height: 86px;
    padding: 11px 12px;
    border-radius: 17px;
  }

  .calculator-page .itemtop {
    align-items: center;
    gap: 13px;
  }

  .calculator-page .icon {
    width: 33px;
    height: 33px;
    font-size: 27px;
  }

  .calculator-page .name {
    font-size: 13px;
  }

  calculator-page .price {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  }

  .calculator-page .counter {
    align-self: flex-end;
    gap: 18px;
    margin: 5px 0 0 auto;
    padding: 3px 5px;
  }

  .calculator-page .counter button {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .calculator-page .counter b {
    font-size: 12px;
  }

  /* Компактный блок машины */
  .calculator-page .result .caption {
    font-size: 10px;
  }

  .calculator-page .truckname {
    margin-top: 3px;
    font-size: 25px;
  }

  .calculator-page .truckbox {
    display: grid;
    grid-template-rows: 20px 56px 14px;
    grid-template-columns: 1fr 90px;
    align-items: center;
    margin: 0;
  }

  .calculator-page .badge {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    padding: 4px 7px;
    font-size: 8px;
    transform: none;
  }

  .calculator-page .truck-img {
    grid-row: 1 / 4;
    grid-column: 1;
    width: 145px;
    height: 72px;
    max-height: none;
  }

  .calculator-page .meter {
    grid-row: 2;
    grid-column: 2;
    width: 100%;
    height: 7px;
  }

  .calculator-page .volume {
    grid-row: 3;
    grid-column: 2;
    justify-self: end;
    margin: 0;
    font-size: 8px;
    white-space: nowrap;
  }

  /* Цена на телефоне всегда видима */
  .calculator-page .result .total {
    display: block;
    margin-top: 10px;
    padding: 14px;
    border-radius: 17px;
  }

  .calculator-page .total span {
    font-size: 11px;
  }

  .calculator-page .total strong {
    margin: 4px 0;
    font-size: 29px;
  }

  .calculator-page .total small {
    display: block;
    font-size: 10px;
    line-height: 1.3;
  }

  .calculator-page .order {
    margin-top: 12px;
    padding: 14px;
    font-size: 13px;
  }

  .calculator-page .fine {
    font-size: 9px;
  }

  /* Этаж, лифт и разборка */
  .calculator-page .opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    padding: 14px;
    border-radius: 20px;
  }

  .calculator-page .floor {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }

  .calculator-page .floor label,
  .calculator-page .toggle {
    font-size: 13px;
  }

  .calculator-page .floor button {
    min-width: 38px;
    padding: 9px;
    font-size: 11px;
  }

  .calculator-page .toggle {
    width: auto;
    gap: 7px;
    padding-left: 0;
    border-left: 0;
    justify-content: space-between;
  }

  .calculator-page .toggle input {
    width: 37px;
    height: 21px;
  }

  .calculator-page .toggle input::after {
    width: 15px;
    height: 15px;
  }

  .calculator-page .toggle input:checked::after {
    transform: translateX(16px);
  }

  /* Нижняя панель калькулятора на телефонах */
  .calculator-mobilebar {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px max(9px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fffefb;
    box-shadow: 0 -6px 18px rgb(33 58 39 / 12%);
  }

  .calculator-mobilebar small {
    display: block;
    color: var(--muted);
    font-size: 10px;
  }

  .calculator-mobilebar b {
    color: var(--ink);
    font-size: 20px;
  }

  .calculator-mobilebar button {
    padding: 13px 16px;
    border: 0;
    border-radius: 99px;
    background: var(--yellow);
    color: var(--ink);
    font-family: Inter, Arial, sans-serif;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .calculator-modal .modalin {
    padding: 26px 20px;
  }
}
/* На телефонах блок расчёта занимает всю ширину контейнера */
@media (max-width: 620px) {
  .calculator-page .result {
    width: 100%;
    align-self: stretch;
  }
}
/* Защита калькулятора от горизонтального выхода за экран */
.calculator-page,
.calculator-page .pv,
.calculator-page .layout,
.calculator-page .catalog,
.calculator-page .result,
.calculator-page .opts {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 620px) {
  .calculator-page {
    width: 100%;
    overflow-x: hidden;
  }

  .calculator-page .tabs {
    max-width: 100%;
  }

  .calculator-page .tabs button {
    flex: 0 0 auto;
  }

  .calculator-page .toggle {
    min-width: 0;
  }

  .calculator-mobilebar {
    max-width: 100%;
    overflow: hidden;
  }
}