/* ═════════════════════════════════════════════════════════════
   ИНТЕРАКТИВНЫЙ ИНЖЕНЕРНЫЙ КОНФИГУРАТОР СПЕЦИФИКАЦИИ (CPQ 2.0)
   ГК «ЯРИЛО» — СТИЛЬ: ТЕХНО-ИНДУСТРИАЛЬНЫЙ / B2B БЕЗ ЦЕН
   ═════════════════════════════════════════════════════════════ */

.config-page,
.config-section {
  padding: 60px 0 80px;
  background-color: var(--color-bg, #F7F7F8);
  position: relative;
}

.config-page {
  min-height: 100vh;
}

.config-header {
  margin-bottom: 32px;
}
.config-header h1,
.config-header h2 {
  font-family: 'Manrope', 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.2;
  color: #171A1C;
  margin: 10px 0 8px;
}
.config-header p {
  font-family: 'Onest', sans-serif;
  font-size: 16px;
  color: #5D5952;
  max-width: 780px;
  line-height: 1.5;
}

/* 2-колоночный лейаут */
.config-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 32px;
  align-items: start;
}

/* Левая колонка */
.config-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Блок секции */
.config-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(23, 26, 28, 0.08);
  box-shadow: 0 4px 16px rgba(23, 26, 28, 0.04);
  padding: 24px 28px;
  transition: all 0.25s ease;
  position: relative;
}
.config-card.is-disabled {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  box-shadow: none;
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.config-card.is-disabled:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}
.config-card.is-disabled .config-card__header {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}
.config-card.is-disabled .config-card__title h3 {
  color: #64748B;
  font-size: 16px;
}
.config-card.is-disabled .badge {
  opacity: 0.65;
}
.config-card.is-disabled .config-card__body {
  display: none !important;
}
.config-card:hover:not(.is-disabled) {
  border-color: rgba(217, 144, 24, 0.35);
}

/* Заголовок карточки с переключателем ДА/НЕТ */
.config-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ECEEEF;
}
.config-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.config-card__title h3 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #171A1C;
  margin: 0;
}

/* Кнопки переключателя ДА / НЕТ */
.toggle-switch-group {
  display: inline-flex;
  background: #E5E7EB;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.sw-btn {
  border: none;
  background: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  color: #6B7280;
  transition: all 0.2s ease;
}
.sw-btn:hover {
  color: #171A1C;
}
.sw-btn.sw-on.active {
  background: #D99018;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(217, 144, 24, 0.35);
}
.sw-btn.sw-off.active {
  background: #6B7280;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Подблоки полей */
.config-group {
  margin-bottom: 20px;
  transition: opacity 0.2s ease;
}
.config-group:last-child {
  margin-bottom: 0;
}
.config-group__label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8C877D;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.config-group__label span {
  color: #D99018;
}

/* Карточки наполнителей: РОВНО 3 ШТУКИ */
.cores-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.core-opt {
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #FAFBFB;
}
.core-opt:hover {
  border-color: #D99018;
  background: #FFFFFF;
  transform: translateY(-2px);
}
.core-opt.active {
  border-color: #D99018;
  background: #FFFDF9;
  box-shadow: 0 4px 12px rgba(217, 144, 24, 0.15);
}
.core-opt__thumb {
  height: 58px;
  border-radius: 6px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.core-opt__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.core-opt__title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
  color: #171A1C;
  margin-bottom: 3px;
}
.core-opt__badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #8C877D;
}
.core-opt.active .core-opt__badge {
  color: #B2720E;
  font-weight: 700;
}
.core-opt__check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: #D99018;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  color: #FFFFFF;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 10; /* Отображается поверх фото утеплителя */
}
.core-opt.active .core-opt__check {
  display: flex;
}

/* Палитра RAL */
.ral-swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ral-chip {
  width: 44px;
  height: 38px;
  border-radius: 6px;
  border: 1.5px solid #D1D5DB;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 3px;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}
.ral-chip span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 2px;
  border-radius: 2px;
  color: #171A1C;
}
.ral-chip.dark-swatch span {
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
}
.ral-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.ral-chip.active {
  border-color: #D99018;
  border-width: 2.5px;
  box-shadow: 0 0 0 2px rgba(217, 144, 24, 0.35);
  transform: scale(1.05);
}
.ral-selected-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #D99018;
  margin-top: 6px;
}

/* Сетка толщин */
.thickness-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.thick-chip {
  padding: 6px 14px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}
.thick-chip:hover {
  border-color: #D99018;
  background: #FFFFFF;
}
.thick-chip.active {
  background: #D99018;
  border-color: #D99018;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(217, 144, 24, 0.3);
}

/* Управление метражом */
.area-control-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.counter-box {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
}
.counter-btn {
  width: 36px;
  height: 38px;
  background: #F9FAFB;
  border: none;
  font-size: 16px;
  font-weight: bold;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
}
.counter-btn:hover {
  background: #E5E7EB;
  color: #D99018;
}
.counter-input {
  width: 80px;
  height: 38px;
  border: none;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 15px;
  color: #171A1C;
  outline: none;
}
.area-slider {
  flex: 1;
  height: 6px;
  accent-color: #D99018;
  cursor: pointer;
}
.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  background: #F3F4F6;
  border-radius: 4px;
  border: 1px solid #E5E7EB;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-chip:hover {
  color: #D99018;
  border-color: #D99018;
  background: #FFFFFF;
}

/* Доборные элементы (4 карточки) */
.accessories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.acc-card {
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 12px 10px;
  background: #FAFBFB;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.acc-card:hover {
  border-color: #D99018;
  background: #FFFFFF;
  transform: translateY(-2px);
}
.acc-card.active {
  border-color: #D99018;
  background: #FFFDF9;
  box-shadow: 0 4px 12px rgba(217, 144, 24, 0.15);
}
.acc-card__img {
  width: 100%;
  height: 80px;
  border-radius: 6px;
  margin-bottom: 8px;
  object-fit: contain;
  background: #FFFFFF;
}
.acc-card__title {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
  color: #171A1C;
  margin-bottom: 4px;
}
.acc-card__desc {
  font-family: 'Onest', sans-serif;
  font-size: 10.5px;
  color: #6B7280;
  line-height: 1.3;
}
.acc-card__checkbox {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #FFFFFF;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  z-index: 10; /* Отображается поверх изображения */
}
.acc-card.active .acc-card__checkbox {
  background: #D99018;
  border-color: #D99018;
}

/* Драг-энд-дроп зона */
.upload-dropzone {
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  background: #FAFBFB;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #D99018;
  background: #FFFDF9;
}
.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-dropzone__icon {
  font-size: 24px;
  margin-bottom: 4px;
  color: #D99018;
}
.upload-dropzone__text {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #171A1C;
}
.upload-dropzone__hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #8C877D;
  margin-top: 2px;
}

/* Доставка */
.delivery-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.del-opt {
  padding: 10px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #374151;
  background: #FAFBFB;
  transition: all 0.2s ease;
}
.del-opt:hover {
  border-color: #D99018;
}
.del-opt.active {
  border-color: #D99018;
  background: #FFFDF9;
  color: #171A1C;
}
.address-input-box {
  display: block;
}
.address-input-box input {
  width: 100%;
  height: 40px;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  padding: 0 12px;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  box-sizing: border-box;
}

/* ═════════════════════════════════════════════════════════════
   ПРАВАЯ КОЛОНКА: СТИКИ-ПАНЕЛЬ С ЖИВЫМ 3D И ТЕХПАСПОРТОМ
   ═════════════════════════════════════════════════════════════ */
.config-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Карточка 3D Визуализатора */
.visualizer-card {
  background: #171A1C;
  border-radius: 12px;
  padding: 20px;
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(23, 26, 28, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.visualizer-header h4 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #D99018;
  margin: 0;
}
.visualizer-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  border-radius: 6px;
}
.vis-tab-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.vis-tab-btn.active {
  background: #D99018;
  color: #FFFFFF;
  font-weight: 700;
}

/* Контейнер интерактивной 3D SVG панели */
.panel-3d-stage {
  height: 220px;
  background: radial-gradient(circle at 50% 50%, #2A2E33 0%, #171A1C 85%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-3d-svg {
  width: 95%;
  height: 95%;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
  transition: all 0.3s ease;
}
.panel-live-labels {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.7);
}
.panel-live-labels strong {
  color: #D99018;
}

/* Карточка Инженерного паспорта заказа (Спецификация) */
.passport-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(23, 26, 28, 0.1);
  box-shadow: 0 4px 20px rgba(23, 26, 28, 0.06);
  padding: 22px 24px;
}
.passport-header {
  border-bottom: 1.5px solid #F3F4F6;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.passport-header h4 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #171A1C;
  margin: 0 0 4px;
}
.passport-header span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #6B7280;
}

/* Бейдж сводки партий (Стена + Кровля) */
.passport-summary-badge {
  background: #FFFDF9;
  border: 1px solid rgba(217, 144, 24, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #171A1C;
  margin-bottom: 14px;
  line-height: 1.4;
}
.passport-summary-badge strong {
  color: #D99018;
}

/* Сетка ключевых технических метрик */
.tech-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.tech-metric-box {
  background: #FAFBFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 12px;
}
.tech-metric-box span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6B7280;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.tech-metric-box strong {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #171A1C;
}
.tech-metric-box.highlight {
  border-color: rgba(217, 144, 24, 0.4);
  background: #FFFDF9;
}
.tech-metric-box.highlight strong {
  color: #D99018;
}

/* Список подробной технической ведомости */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 12.5px;
  border-top: 1px dashed #E5E7EB;
  padding-top: 14px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #5D5952;
}
.spec-row strong {
  color: #171A1C;
  font-family: 'JetBrains Mono', monospace;
}
.spec-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ECFDF5;
  color: #059669;
  font-weight: 700;
}

/* Индикатор заполнения еврофуры */
.truck-meter {
  background: #F3F4F6;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.truck-meter__fill {
  background: linear-gradient(90deg, #D99018 0%, #10B981 100%);
  height: 100%;
  width: 65%;
  transition: width 0.3s ease;
}

/* Форма отправки ТЗ */
.passport-form {
  border-top: 1.5px solid #F3F4F6;
  padding-top: 16px;
}
.passport-form .form-group {
  margin-bottom: 10px;
}
.passport-form .form-control {
  width: 100%;
  height: 42px;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  padding: 0 12px;
  font-family: 'Onest', sans-serif;
  font-size: 13.5px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.passport-form .form-control:focus {
  border-color: #D99018;
  outline: none;
}
.btn-submit-spec {
  width: 100%;
  height: 48px;
  background: #D99018;
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(217, 144, 24, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-submit-spec:hover {
  background: #B2720E;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 144, 24, 0.45);
}
.passport-note {
  font-family: 'Onest', sans-serif;
  font-size: 11px;
  color: #8C877D;
  text-align: center;
  margin-top: 8px;
}


/* ══ 0. РЕГИОН СТРОИТЕЛЬСТВА И АВТОПОДБОР ТОЛЩИН (СП 50.13330) ══ */
.region-card {
  border-top: 3px solid #D99018;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
  margin-bottom: 24px;
}
.region-card__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.region-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #B47309;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 5px 10px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}
.region-lead-desc {
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  color: #4B5563;
  line-height: 1.5;
  margin-bottom: 14px;
}
.region-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.region-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  position: relative;
}
.region-chip:hover {
  border-color: #D99018;
  background: #FFFDF9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.region-chip.active {
  border-color: #D99018;
  background: #FFFDF7;
  box-shadow: 0 4px 14px rgba(217, 144, 24, 0.18);
}
.region-chip .region-flag {
  font-size: 16px;
  margin-bottom: 4px;
}
.region-chip .region-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #171A1C;
  line-height: 1.3;
}
.region-chip .region-climate {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6B7280;
  margin-top: 3px;
}
.region-chip.active .region-name {
  color: #B47309;
}
.region-chip.active .region-climate {
  color: #D99018;
  font-weight: 600;
}
.region-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 0.25s ease;
}
.region-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10B981;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.region-alert__text {
  font-family: 'Onest', sans-serif;
  font-size: 12.5px;
  color: #166534;
  line-height: 1.45;
}
.region-alert__text strong {
  font-weight: 700;
  color: #14532D;
}
.region-alert__text .spec-diff {
  color: #047857;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}


/* ══ ДОПОЛНИТЕЛЬНЫЕ ИНЖЕНЕРНЫЕ ПАРАМЕТРЫ (V4) ══ */

/* Сетка толщин стали */
.steel-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}
.steel-chips-grid .thick-chip {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.steel-chips-grid .thick-chip small {
  font-size: 9.5px;
  opacity: 0.8;
  font-weight: 500;
}

/* Подгруппа плотности утеплителя */
.density-subgroup {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  transition: all 0.25s ease;
}
.density-subgroup.is-hidden {
  display: none;
}
.density-subgroup__title {
  font-family: 'Onest', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.density-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.density-chip {
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: all 0.15s ease;
}
.density-chip:hover {
  border-color: #D99018;
  background: #FFFDF9;
}
.density-chip.active {
  border-color: #D99018;
  background: #FFFDF7;
  box-shadow: 0 2px 6px rgba(217, 144, 24, 0.15);
}
.density-chip strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #111827;
}
.density-chip small {
  font-family: 'Onest', sans-serif;
  font-size: 9px;
  color: #6B7280;
  line-height: 1.1;
}
.density-chip.active strong {
  color: #B47309;
}
.density-info-badge {
  font-family: 'Onest', sans-serif;
  font-size: 11.5px;
  color: #4B5563;
  background: #F3F4F6;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Уведомление о малом объеме (складские остатки) */
.small-volume-notice {
  background: #FFFBEB;
  border: 1.5px dashed #F59E0B;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}
.small-volume-notice__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #B45309;
}
.small-volume-notice__text {
  font-family: 'Onest', sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: #78350F;
}
.small-volume-notice__text strong {
  color: #92400E;
}
.small-volume-notice__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Onest', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #92400E;
  cursor: pointer;
  background: #FEF3C7;
  padding: 6px 10px;
  border-radius: 6px;
  width: fit-content;
}
.small-volume-notice__label input {
  accent-color: #D99018;
  cursor: pointer;
}

/* Инженерный выбор каркаса и расчет крепежа */
.screws-calculator-panel {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
}
.screws-calc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.screws-calc-title h4 {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1F2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.screws-simple-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: center;
}
.screws-simple-field label {
  display: block;
  font-family: 'Onest', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #4B5563;
  margin-bottom: 6px;
}
.screws-select {
  width: 100%;
  padding: 10px 12px;
  font-family: 'Onest', sans-serif;
  font-size: 12.5px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: #FFFFFF;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s ease;
}
.screws-select:focus {
  outline: none;
  border-color: #D99018;
  box-shadow: 0 0 0 2px rgba(217, 144, 24, 0.15);
}
.screws-engineer-note {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-left: 3px solid #D99018;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.screws-note-badge {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: #B45309;
  margin-bottom: 4px;
}
.screws-note-text {
  font-family: 'Onest', sans-serif;
  font-size: 11px;
  line-height: 1.35;
  color: #4B5563;
  margin: 0;
}

/* ═════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ И ТОЧНЫЙ ПОРЯДОК БЛОКОВ
   1. Заголовок -> 2. Регионы -> 3. 3D вид -> 4. Стена ->
   5. Кровля -> 6. Доборы -> 7. Проект/Логистика -> 8. Смета/Форма
   ═════════════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .config-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .config-main,
  .config-sidebar {
    display: contents;
  }

  /* Строгий порядок блоков на мобильных и планшетах */
  #card-region {
    order: 1;
  }
  #card-visualizer,
  .visualizer-card {
    order: 2;
    position: static;
    margin-bottom: 0;
  }
  #card-wall {
    order: 3;
  }
  #card-roof {
    order: 4;
  }
  #card-accessories {
    order: 5;
  }
  #card-logistics {
    order: 6;
  }
  #card-passport,
  .passport-card {
    order: 7;
    position: static;
  }

  .screws-simple-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .config-page,
  .config-section {
    padding: 36px 0 60px;
  }
  .config-card {
    padding: 18px 16px;
  }
  .config-card__header {
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }
  .config-card__title {
    flex-wrap: wrap;
    gap: 8px;
  }
  .config-card__title h3 {
    font-size: 17px;
  }
  .region-chips-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .region-chip {
    padding: 10px 8px;
  }
  .accessories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .tech-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .delivery-selector {
    flex-direction: column;
  }
  .del-opt {
    width: 100%;
    box-sizing: border-box;
  }
  .form-control {
    font-size: 16px; /* Защита от автозума на iOS */
  }
}

@media (max-width: 480px) {
  .region-chips-grid {
    grid-template-columns: 1fr;
  }
  .cores-select-grid {
    grid-template-columns: 1fr;
  }
  .quick-chips {
    gap: 4px;
  }
  .quick-chip {
    padding: 4px 6px;
    font-size: 11px;
  }
  .panel-3d-stage {
    height: 180px;
  }
  .visualizer-card {
    padding: 14px;
  }
  .passport-card {
    padding: 18px 14px;
  }
}
