/* ============================================================
   Калькулятор стоимости кухни — Ravelis
   Разметка и логика основаны на предоставленном примере calc.html
   ============================================================ */

.calc { position: relative; }

.calc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 18px;
  align-items: start;
}

.calc__panel {
  padding: clamp(22px, 2.6vw, 34px);
  border-radius: var(--radius-2xl);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* --- Прогресс --- */

.calc__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.calc__meta-left { display: grid; gap: 4px; }
.calc__step-label { font-size: 12.5px; color: var(--muted); }
.calc__step-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.calc__progress-value { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.calc__progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 26px;
}
.calc__progress-item {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(46, 46, 46, .1);
  position: relative;
  overflow: hidden;
}
.calc__progress-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--yellow);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition);
}
.calc__progress-item.is-active::after,
.calc__progress-item.is-done::after { transform: scaleX(1); }

/* --- Шаги --- */

.calc__steps { min-height: 380px; position: relative; }

.calc__step { display: none; animation: calcFade .26s ease; }
.calc__step.is-active { display: block; }

@keyframes calcFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.calc__step h3 {
  font-size: clamp(23px, 2.8vw, 34px);
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.calc__step > p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 56ch;
}

.calc__grid { display: grid; gap: 12px; }
.calc__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --- Карточка варианта --- */

.calc-option { position: relative; }
.calc-option input { position: absolute; opacity: 0; pointer-events: none; }

.calc-card {
  height: 100%;
  min-height: 118px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  display: grid;
  gap: 10px;
  align-content: start;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition), background var(--transition);
}
.calc-card:hover { border-color: rgba(241, 180, 53, .7); box-shadow: var(--shadow-soft); }
.calc-card:active { transform: scale(.993); }

.calc-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.calc-card__title { font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.calc-card__note { display: block; margin-top: 5px; font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 500; }

.calc-card__check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: transparent;
  transition: all var(--transition);
}
.calc-card__check svg { width: 13px; height: 13px; }

.calc-option input:checked + .calc-card {
  border-color: var(--yellow);
  background: #FFFAF0;
  box-shadow: 0 0 0 2px rgba(241, 180, 53, .28);
}
.calc-option input:checked + .calc-card .calc-card__check {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--graphite);
}
.calc-option input:focus-visible + .calc-card { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Схема формы кухни */
.calc-card__shape {
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--line);
}
.calc-card__shape svg { width: 76px; height: 44px; color: var(--graphite); }
.calc-option input:checked + .calc-card .calc-card__shape { border-color: rgba(241, 180, 53, .5); }
.calc-option input:checked + .calc-card .calc-card__shape svg { color: var(--yellow-deep); }

/* --- Поле длины --- */

.calc__field { max-width: 380px; }
.calc__input-wrap { position: relative; }
.calc__input {
  width: 100%;
  min-height: 62px;
  padding: 16px 74px 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--graphite);
  transition: border-color var(--transition), background var(--transition);
}
.calc__input:focus { outline: none; border-color: var(--yellow); background: var(--white); }
.calc__input-unit {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}
.calc__hint { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.calc__error { display: none; margin-top: 8px; font-size: 13px; font-weight: 700; color: #C94B4B; }
.calc__error.is-visible { display: block; }

.calc__presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.calc__preset {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--white);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.calc__preset:hover { border-color: var(--yellow); background: #FFFAF0; }

/* --- Результат --- */

.calc__result-box {
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-xl);
  background: var(--graphite);
  color: var(--white);
  display: grid;
  gap: 8px;
}
.calc__result-label { font-size: 13px; color: var(--muted-light); }
.calc__result-price {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.05;
  color: var(--yellow);
}
.calc__result-note { margin-top: 6px; font-size: 13.5px; color: var(--muted-light); line-height: 1.55; }

.calc__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.calc__chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--milk);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.calc__included {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.calc__incl-box { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--milk); border: 1px solid var(--line); }
.calc__incl-box h4 { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 11px; }
.calc__incl-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.calc__incl-box li { font-size: 13.5px; line-height: 1.45; color: var(--muted); display: flex; gap: 8px; }
.calc__incl-box li::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--yellow); }
.calc__incl-box--out li::before { background: var(--line-strong); }

.calc__lead { margin-top: 20px; display: grid; gap: 12px; }
.calc__lead-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.calc__lead-input {
  width: 100%;
  min-height: 54px;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 15.5px;
  color: var(--graphite);
  transition: border-color var(--transition), background var(--transition);
}
.calc__lead-input::placeholder { color: rgba(46, 46, 46, .4); }
.calc__lead-input:focus { outline: none; border-color: var(--yellow); background: var(--white); }
.calc__lead .field--error .calc__lead-input { border-color: #C94B4B; }
.calc__lead .field__error { color: #C94B4B; }
.calc__lead .consent { color: var(--muted); }
.calc__lead .consent a { color: var(--graphite); }

.calc__success {
  display: none;
  margin-top: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: rgba(241, 180, 53, .16);
  border: 1px solid var(--yellow);
}
.calc__success.is-visible { display: block; }
.calc__success b { display: block; font-size: 17px; margin-bottom: 6px; }
.calc__success span { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* --- Навигация --- */

.calc__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.calc__nav-right { display: flex; gap: 10px; margin-left: auto; }

/* --- Боковая сводка --- */

.calc__summary {
  padding: 26px;
  border-radius: var(--radius-2xl);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
  display: grid;
  gap: 18px;
}

.calc__summary-badge {
  display: inline-flex;
  align-items: center;
  align-self: start;
  min-height: 30px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: var(--milk);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.calc__summary-price { display: grid; gap: 4px; }
.calc__summary-price span { font-size: 13px; color: var(--muted); }
.calc__summary-price b {
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
}

.calc__summary-list { display: grid; gap: 10px; }
.calc__summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
}
.calc__summary-list div:last-child { border-bottom: none; padding-bottom: 0; }
.calc__summary-list span:first-child { color: var(--muted); }
.calc__summary-list span:last-child { font-weight: 800; text-align: right; }

.calc__summary-note {
  padding: 15px 17px;
  border-radius: var(--radius-md);
  background: var(--glass-milk);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* --- Мобильная «липкая» сводка --- */

.calc__mobile-bar { display: none; }

@media (max-width: 980px) {
  .calc__layout { grid-template-columns: 1fr; }
  .calc__summary { position: static; order: 2; }
  .calc__grid--3,
  .calc__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc__steps { min-height: 0; }
}

@media (max-width: 640px) {
  .calc__grid--3, .calc__grid--2 { grid-template-columns: 1fr; }
  .calc__grid--4 { grid-template-columns: 1fr; }
  .calc__included { grid-template-columns: 1fr; }
  .calc__lead-row { grid-template-columns: 1fr; }
  .calc-card { min-height: 0; }
  .calc__nav { flex-direction: column-reverse; align-items: stretch; }
  .calc__nav-right { margin-left: 0; }
  .calc__nav .btn { width: 100%; }
  .calc__meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}
