/* calculator.css 
=============================================================================
    CALCULATOR & MODAL STYLES
============================================================================= */

/* Область затемнения */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Контейнер модального окна */
.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px; /* Ваше скругление */
  width: 90%;
  max-width: 800px; /* Ограничиваем размер */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

.modal-title {
  color: #c23e3e; /* Красный цвет */
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.8rem;
  font-weight: 700;
}

/* === Вкладки (Tabs) === */
.calc-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.calc-tab-btn {
  background: none;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.calc-tab-btn:hover {
  color: #c23e3e;
}

.calc-tab-btn.active {
  color: #c23e3e;
  border-bottom: 2px solid #c23e3e;
}

/* Показываем только активную панель вкладки */
.calc-panel {
  display: none;
}

.calc-panel.active {
  display: block;
}

/* === Поля ввода и группы === */
.calc-hint {
  font-style: italic;
  color: #888;
  margin-bottom: 20px;
  text-align: center;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.input-text,
.input-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px; /* Ваше скругление */
  box-sizing: border-box;
  font-size: 16px;
  transition: border-color 0.2s;
}

.input-text:focus,
.input-select:focus {
  border-color: #c23e3e;
  outline: none;
}

textarea.input-text {
  resize: vertical;
  min-height: 80px;
  margin-top: 10px;
}

/* Группа чекбоксов */
.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: 400;
  margin-bottom: 5px;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

/* === Результат и Цены === */
.calc-result {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid #c23e3e;
  border-radius: 8px;
  background: #fffafa;
  text-align: center;
}

.price-info p {
  margin: 5px 0;
}

.total-price-box {
  font-size: 2rem;
  font-weight: 700;
  color: #c23e3e;
  margin: 10px 0 20px;
}

#total-price {
  display: inline-block;
  padding: 5px 15px;
  background: #c23e3e;
  color: #fff;
  border-radius: 6px;
}
/* Убедитесь, что модалка скрыта, пока ее не откроет JS */
.modal-overlay[hidden],
.modal-form-overlay[hidden] {
  display: none !important;
}

/* Контейнер для полей в одну строку */
.calc-input-row {
  display: flex;
  gap: 20px; /* Расстояние между колонками */
  margin-bottom: 20px; /* Отступ вниз */
}

/* Каждый input-group занимает половину строки */
.calc-input-row .input-group {
  flex: 1 1 50%;
  margin-bottom: 0; /* Удаляем нижний отступ, чтобы избежать двойного отступа */
}

/* Стили для текстовых полей и селектов внутри input-group, чтобы они занимали всю доступную ширину */
.calc-input-row .input-text,
.calc-input-row .input-select {
  width: 100%;
  box-sizing: border-box;
}

/* Уменьшаем отступ снизу у input-group, который содержит чекбоксы, чтобы избежать большого разрыва с кнопкой */
.calc-panel .input-group:last-of-type {
  margin-bottom: 15px;
}

/* Центрирование панели DISTRIBUCIÓN
   — теперь только когда панель активна */
.calc-panel#distribution.active {
  display: flex;
  flex-direction: column;
  align-items: center; /* Центрируем содержимое по горизонтали */
}

/* Убедимся, что ширина самого блока с чекбоксами меньше 100% для центрирования */
.checkbox-group {
  max-width: 450px; /* Ограничиваем максимальную ширину для центрирования */
  width: 100%;
  text-align: left; /* Текст внутри должен быть слева */
  box-sizing: border-box;
}

/* Кнопка "Calcular" должна быть отцентрована */
.calculate-btn {
  align-self: center; /* Центрируем саму кнопку относительно колонки */
  margin-top: 10px; /* Небольшой отступ от чекбоксов */
  max-width: 250px; /* Чтобы кнопка не была слишком широкой */
  width: 100%;
}

#design .calculate-btn {
  margin-top: 40px; /* Небольшой отступ от чекбоксов */
}

/* Убедимся, что колонки ввода тоже отцентрированы, но при этом могут растягиваться */
.calc-input-row {
  max-width: 600px; /* Задаем максимальную ширину для всей строки */
  width: 100%;
  /* Если вы хотите, чтобы вся строка была центрирована, нужно, чтобы #distribution ее центрировал, что уже сделано */
}

/* --- СТИЛИ ДЛЯ ФОРМЫ КОНТАКТА (ВНУТРИ КАЛЬКУЛЯТОРА) --- */

/* Оверлей формы (появляется над калькулятором) */
.modal-form-overlay {
  position: absolute; /* Внутри основного контейнера калькулятора */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* ИЗМЕНЕНИЕ: Используем темный полупрозрачный фон, как у основного оверлея */
  background-color: rgba(
    0,
    0,
    0,
    0.75
  ); /* Темный (почти черный) фон с 75% прозрачностью */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 10; /* Выше, чем содержимое калькулятора, но ниже модалки */
}

/* Контент формы */
.modal-form-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  text-align: center;
}

.modal-form-title {
  font-size: 1.5rem;
  color: #cc0000; /* Ваш фирменный цвет */
  margin-bottom: 10px;
  font-weight: bold;
}

.modal-form-subtitle {
  margin-bottom: 25px;
  color: #666;
  font-size: 0.95rem;
}

/* Кнопка закрытия формы (крестик) */
.modal-form-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #666;
}

/* Стилизация полей ввода для формы */
#quote-contact-form .input-group {
  text-align: left;
  margin-bottom: 15px;
}

#quote-contact-form .input-text {
  width: 100%;
  box-sizing: border-box;
}

/* Кнопка отправки */
#send-final-quote {
  margin-top: 20px;
  width: 100%;
}

/* --- СТИЛИ ДЛЯ УВЕДОМЛЕНИЯ ОБ ОТПРАВКЕ --- */

/* Используем общие стили .modal-form-overlay и .modal-form-content, 
   но можем добавить класс для специфического оформления */
.modal-success {
  text-align: center;
  max-width: 350px; /* Сделаем его немного меньше формы контактов */
}

/* Стилизация заголовка успеха (зеленый/красный цвет для "Спасибо") */
.modal-success .modal-form-title {
  color: #c94443; /* Используем ваш красный акцентный цвет */
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.modal-success .btn-secondary {
  background-color: #21a39d; /* Можно использовать акцентный зеленый или ваш основной цвет */
  border-color: #21a39d;
  margin-top: 20px;
}
.modal-success .btn-secondary:hover {
  background-color: #1a837e;
}

/* ==============================
   Двухколоночный калькулятор
   ============================== */

@media (min-width: 880px) {
  .calculator-section .modal-content {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 32px;
    row-gap: 24px;
    align-items: flex-start;
  }

  /* Заголовок и табы на всю ширину */
  .calculator-section .modal-title,
  .calculator-section .calc-tabs {
    grid-column: 1 / -1;
  }

  .modal-title {
    margin-bottom: 24px;
    font-size: 2.5rem;
  }

  /* Слева — поля калькулятора */
  .calculator-section .calc-content {
    grid-column: 1 / 2;
    margin-bottom: 0; /* gap уже даёт нужный отступ */
  }

  /* Справа — всегда видимый результат */
  .calculator-section .calc-result {
    grid-column: 2 / 3;
    margin-top: 0;
    align-self: flex-start;
  }

  .calculator-section .summary-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .calculator-section .summary-card ul {
    margin-top: 16px;
  }

  .calculator-section .summary-card .total-price-box,
  .calculator-section .summary-card .iva-notice {
    margin-top: 16px;
  }

  .calc-tab-btn {
    font-size: 1.5rem;
  }

  .page-precios #calculator-section .modal-content {
    width: 100%;
    max-width: none;
  }

  .modal-title {
    margin: 0px;
  }
}

/* Текст-заглушка в правой колонке */
.summary-placeholder {
  font-size: 0.9rem;
  color: #b5b5b5;
  text-align: center;
  margin: 24px auto 8px;
  max-width: 260px;
}

/* ===========================
   CALCULADORA INLINE (precios)
   =========================== */

/* Кнопки внутри калькулятора — аккуратные, а не 30vw */
.calculator-section .btn {
  min-width: 0;
  width: 100%;
}

/* Основные кнопки выравниваем по центру своей колонки */
.calculator-section .calculate-btn,
.calculator-section #request-full-quote,
.calculator-section #reset-calculator {
  margin-left: auto;
  margin-right: auto;
}

/* Двухколоночный режим с ~двух "телефонов" по ширине */
@media (min-width: 880px) {
  .calculator-section .modal-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* 50 / 50 */
    gap: 30px;
    align-items: flex-start;
  }

  /* Колонка результата рядом, а не ниже */
  .calculator-section .calc-result {
    margin-top: 0;
  }

  .calculator-section .btn {
    min-width: 0;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Итоговая кнопка в калькуляторе:
   не зависим от общего ..page-precios .calculator-section #request-full-quote */
.page-precios .calculator-section #request-full-quote {
  width: 100%;
  max-width: 100%; /* снимаем лимит 360px */
  font-size: 14px; /* фиксированный размер шрифта */
  padding: 14px 24px; /* фиксированный паддинг вместо clamp */
  white-space: nowrap; /* на больших экранах текст не переносится */
}

/* На телефонах пусть кнопка может ломаться на две строки,
     если вдруг станет тесно */
@media (max-width: 879px) {
  .page-precios .calculator-section #request-full-quote {
    white-space: normal;
  }
}

.input-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.discount-applied {
  margin-top: 10px;
  font-size: 13px;
  color: #a34841;
}

.discount-applied .discount-line {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.8;
}

.summary-hint {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  color: #8c7f6a; /* мягкий серо-коричневый, как у других подсказок */
}

.summary-hint-full {
  margin-top: 1.25rem; /* лёгкий отступ от списка позиций */
}

.calculator-section .calc-tabs {
  display: flex;
  justify-content: center; /* базово — центр для узких экранов */
  gap: 24px;
  margin-bottom: 24px;
}

/* На планшетах и десктопах вкладки как у «нормальных людей» — слева */
@media (min-width: 640px) {
  .calculator-section .calc-tabs {
    justify-content: flex-start;
  }
}

/* Маленькие подписи "Paso 1 / Paso 2" возле кнопок */
.calculator-section .calc-step-hint {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(43, 38, 22, 0.7);
  text-align: center;
  margin: 18px 0 8px;
}

/* Делаем кнопку отправки более "вторым шагом": контур + заливка по наведению */
.calculator-section #request-full-quote {
  background: #ffffff !important;
  color: #de3b33;
  border: 1px solid #de3b33;
  box-shadow: 0 8px 24px rgba(161, 49, 43, 0.15);
}

.calculator-section #request-full-quote:hover {
  background: linear-gradient(135deg, #ff5a4d, #df2d25) !important;
  color: #ffffff;
}
