/* ============================================
   КАЛЬКУЛЯТОР ДМС — новый дизайн из calculator_full.html
   Загружается ПОСЛЕДНИМ — перебивает main.min.css, style_index.css, style.css
   ============================================ */

/* ==============================================
   ЧАСТЬ 1: СБРОС старых стилей из main.min.css
   ============================================== */

/* Внешний блок — фон на всю ширину */
#calc_block {
  background: #383A4C !important;
  background-color: #383A4C !important;
  background-image: none !important;
  background-size: auto !important;
  min-height: auto !important;
  margin-top: 0 !important;
  padding: 0 !important;
  outline: none !important;
  color: #fff;
  max-width: none !important;
  width: 100% !important;
}
/* Старый .container-fluid */
#calc_block .container-fluid {
  background: none !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
/* H1 — шрифт bebas */
#calc_block h1 {
  font-family: bebas, sans-serif !important;
  white-space: normal !important;
  max-width: none !important;
}
/* Сброс #organization_str
   main.min.css на max-width:992px ставит display:block и float:left на items —
   перебиваем для калькулятора на всех разрешениях */
#calc_block #organization_str {
  justify-content: flex-start !important;
  margin-top: 0 !important;
  display: block !important; /* не flex — flex на .options-icons внутри */
}
/* Сброс .organization_item внутри калькулятора */
#calc_block #organization_str .organization_item,
#calc_block .opt-icon {
  width: auto !important;
  height: auto !important;
  display: flex !important;
  float: none !important;   /* перебиваем float:left из main.min.css @992px */
  color: inherit !important;
  font-size: inherit !important;
}
/* Сброс SVG в опциях */
#calc_block #organization_str .organization_item svg {
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}
/* Сброс .organization_item_text */
#calc_block #organization_str .organization_item_text {
  line-height: normal !important;
  position: static !important;
}
#calc_block #organization_str .organization_item_text:after {
  content: none !important;
  display: none !important;
}
/* Сброс .head_str */
#calc_block .head_str {
  display: none !important;
}
/* Сброс #insured_str */
#calc_block #insured_str {
  margin-top: 0 !important;
}
/* Сброс .datepicker */
#calc_block .datepicker,
#calc_block .datepicker1 {
  width: 100% !important;
  margin-top: 0 !important;
}
/* Обёртка инпута даты + иконки календаря */
.date-input-wrap {
  position: relative;
  width: 100%;
}
.date-input-wrap .field-input {
  width: 100%;
  padding-right: 38px !important;
  box-sizing: border-box;
}
/* Иконка календаря внутри поля */
#calc_block .ui-datepicker-trigger {
  display: block !important;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 2;
  filter: grayscale(1) brightness(0.5);
}
#calc_block .ui-datepicker-trigger:hover {
  opacity: 0.9;
}
@media (max-width: 767px) {
  #calc_block .ui-datepicker-trigger {
    padding: 10px;
    right: 0px;
    box-sizing: content-box;
  }
}
/* Сброс man_woman */
#calc_block .man_woman,
#calc_block .man_woman.radio_bth {
  padding: 0 !important;
}
/* Скрываем старые radio-стили */
#calc_block .radio_bth_new label:after,
#calc_block .man_woman_s label:after {
  display: none !important;
}
/* Сброс #clinics_str */
#calc_block #clinics_str {
  margin-top: 0 !important;
}
#calc_block #clinics_str input {
  position: static !important;
  z-index: auto !important;
}
/* Сброс #button_str */
#calc_block #button_str {
  margin-top: 0 !important;
}
/* Сброс .row внутри калькулятора */
#calc_block .row {
  margin: 0 !important;
  padding: 0 !important;
}

/* ==============================================
   ЧАСТЬ 2: НОВЫЕ стили калькулятора
   ============================================== */

/* Внутренний контейнер — центрирует контент */
/* Верхний padding уменьшен — калькулятор ближе к навигации */
.calc-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px 24px;
  position: relative;
}

/* Заголовок — внутри .search-panel */
/* font-size плавно: 29px на 320px → 40px на 1100px+ (без скачков на брейкпоинтах).
   letter-spacing аналогично: 1px → 2px. */
.page-title,
#calc_block h1.page-title {
  text-align: center;
  font-size: clamp(29px, calc(24.5px + 1.41vw), 40px);
  font-weight: 400;
  color: #fff;
  margin: 0 0 8px 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: clamp(1px, calc(0.6px + 0.13vw), 2px);
  font-family: bebas, sans-serif !important;
}
.page-subtitle {
  text-align: center;
  font-size: 15px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 40px;
}

/* Обёртка */
.calc-wrapper {
  display: flex;
  gap: 40px;
  align-items: center;
}

/* Город-метка внутри калькулятора — скрыта по умолчанию, показывается через JS */
.city-selector {
  display: none;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(240,100,36,0.45);
  border-radius: 8px;
  padding: 3px 8px 3px 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 4px;
}
.city-selector:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(240,100,36,0.8);
}
.city-selector.visible {
  display: inline-flex;
  align-self: flex-start;
}
/* Иконка геолокации перед лейблом */
.city-selector-label::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 11px;
  margin-right: 3px;
  vertical-align: -1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath fill='%23f06424' d='M6 0C3.24 0 1 2.24 1 5c0 3.75 5 11 5 11s5-7.25 5-11c0-2.76-2.24-5-5-5zm0 7.5C4.62 7.5 3.5 6.38 3.5 5S4.62 2.5 6 2.5 8.5 3.62 8.5 5 7.38 7.5 6 7.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}
.city-selector-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}
.city-selector-value {
  font-size: 13px;
  font-weight: 700;
  color: #f06424;
  word-break: break-word;
  overflow-wrap: break-word;
}
.city-selector-edit {
  font-size: 0;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  opacity: 1;
  margin-left: 2px;
  transition: opacity 0.2s;
}
.city-selector-edit::before {
  content: '✎';
  font-size: 13px;
}
.city-selector-edit:hover {
  opacity: 0.7;
}

/* Панель поиска */
.search-panel {
  flex: 1;
  /* min-width:0 — без него flex-item получает min-width:auto (= min-content),
     что на 320px распирало панель за пределы .calc-wrapper (317px при доступных 296px) */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #232738;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 32px;
}

/* Опции наполнения */
.options-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-label {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  display: block;
}
/* Сброс старых стилей .organization_items из main.min.css */
#calc_block .organization_items,
#calc_block .options-icons {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border-radius: 0 !important;
  max-width: none !important;
  flex-wrap: nowrap;
}
.options-icons {
  display: flex;
  gap: 10px;
}

/* Иконка опции + сброс старых .organization_item */
#calc_block .opt-icon,
.opt-icon {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: auto !important;
  height: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 90px;
  min-width: 90px;
  text-align: center;
}
/* label внутри опции — блочный, flex-column, центрируем */
.opt-icon label {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
}
.opt-icon input[type="checkbox"] {
  display: none;
}
.opt-icon-box {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.2s;
  overflow: hidden;
}
/* Активная опция (checked) — оранжевая рамка */
.opt-icon.active .opt-icon-box,
.opt-icon input:checked + label .opt-icon-box {
  border-color: #f06424;
}
/* SVG иконки из ACF — управление цветом через fill */
.opt-icon-box svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
  fill: #fff;
  transition: fill 0.2s;
}
/* Активная — оранжевая иконка */
.opt-icon input:checked + label .opt-icon-box svg {
  fill: #f06424;
}
.opt-icon-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-align: center;
  transition: color 0.2s;
  white-space: normal !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  margin-top: 4px;
  max-width: 90px;
  display: block;
}
.opt-icon.active .opt-icon-label,
.opt-icon input:checked + label .opt-icon-label {
  color: #f06424;
}

/* Отступ между опциями и фильтрами */
.divider {
  height: 0;
  background: none;
  margin: 30px 0;
}

/* Фильтры — padding-bottom резервирует место для ошибок */
.filters-line {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 36px;
}

/* Группа полей */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.field-label {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

/* Переключатель пола — высота и скругление как у кнопки */
.gender-switch {
  display: flex;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  height: 48px;
  box-sizing: border-box;
}
.gender-btn {
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: #fff;
  color: #636578;
  cursor: pointer;
  transition: all 0.2s;
  height: 100%;
  line-height: 1;
  display: flex;
  align-items: center;
}
.gender-btn:first-child {
  border-right: none;
  border-radius: 6px 0 0 6px;
}
.gender-btn:last-child {
  border-radius: 0 6px 6px 0;
}
.gender-btn.active {
  background: #f06424;
  color: #fff;
}
.gender-btn:hover:not(.active) {
  background: rgba(240,100,36,0.15);
  color: #f06424;
}

/* Поля ввода — высота и скругление как у кнопки */
.field-input {
  padding: 0 16px;
  height: 48px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #242639;
  background: #fff;
  outline: none;
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
  line-height: 1;
}
.field-input::placeholder {
  color: #9B9CAA;
}
.field-input:focus {
  border-color: #9B9CAA;
  box-shadow: none;
}
.field-date {
  width: 130px;
  flex-shrink: 0;
}
/* .field-city убрано — город теперь над калькулятором */
/* Клиника — занимает всё оставшееся место */
.field-clinic {
  flex: 1;
}
.field-clinic .search_wrapper {
  width: 100%;
  display: block;
  position: relative;
  position: relative;
}
/* Перебиваем main.min.css: #clinics_str input { height: 36px } */
#clinics_str input,
.field-clinic .search_wrapper .field-input {
  height: 48px !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  color: #242639 !important;
  margin-top: 0 !important;
}

/* Кнопка поиска — компактная, стиль как в оригинале */
.btn-search {
  padding: 12px 24px;
  height: auto;
  border: none;
  border-radius: 8px;
  background: #f6e57d;
  color: #232537;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .25s ease, box-shadow .25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-end;
  box-shadow: 0 0 25px 0 rgba(246, 229, 125, .75);
}
.btn-search:hover,
.btn-search:focus {
  background: #f9efad;
  border: none;
  box-shadow: 0 0 25px 0 rgba(246, 229, 125, .75);
}
.btn-search.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ========= Ошибки валидации ========= */

/* Подсветка поля при ошибке — мягкий красноватый фон */
.field-input.has-error,
.datepicker.has-error,
.clinics_input.has-error {
  border-color: #e8453c !important;
  background: #fef2f1 !important;
  animation: shake 0.35s ease;
}
/* Placeholder при ошибке — красный текст внутри поля */
.field-input.has-error::placeholder,
.datepicker.has-error::placeholder,
.clinics_input.has-error::placeholder {
  color: #e8453c !important;
  opacity: 1;
}

/* Анимация тряски при ошибке */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* Общий стиль ошибки — серая плашка, современный стиль */
#calc_block .errorMessage,
#calc_block .errorMessage.type_2 {
  display: none;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  padding: 8px 12px;
  background: rgba(155,156,170,0.35);
  border-radius: 8px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  z-index: 10;
  white-space: normal;
  word-wrap: break-word;
  backdrop-filter: blur(4px);
}
/* Иконка — убираем старую */
#calc_block .errorMessage::before {
  display: none !important;
}

/* Ошибка опций (тип 1 — "Выберите опцию") — стиль как иконка опции */
#organization_str .errorMessage.type_1 {
  display: none;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  line-height: 1.2;
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  position: relative;
  width: 90px;
  min-width: 90px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#organization_str .errorMessage.type_1::before {
  content: '!' !important;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.6);
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(155,156,170,0.35);
  backdrop-filter: blur(4px);
  background-image: none !important;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  position: static;
  left: auto;
  top: auto;
}
#organization_str .options-icons.has-error .errorMessage.type_1 {
  display: flex;
  align-items: center;
}

/* Красная обводка всех иконок опций при ошибке */
#organization_str .options-icons.has-error .opt-icon-box {
  border-color: #e8453c !important;
}
/* Красная обводка плашки ошибки опции */
#organization_str .options-icons.has-error .errorMessage.type_1::before {
  border-color: #e8453c !important;
  border-style: dashed;
}
/* Старое мигание — отключаем */
#organization_str .organization_item_text.error:after {
  box-shadow: none;
  animation: none;
}

/* Иконка загрузки поиска */
.loading_search_icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: url(img/load_icon.png) center/cover no-repeat;
  opacity: 0;
  animation: load_move 1.5s linear infinite;
}
#clinics_str .search_wrapper.loading .loading_search_icon {
  opacity: 1;
}

/* Результаты автокомплита — отдельный выпадающий блок с отступом от поля */
.clinics_result {
  width: 100%;
  border: 1px solid #9B9CAA;
  border-radius: 8px;
  margin-top: 6px;
  top: 100% !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  padding: 8px !important;
}
/* Убираем старые чекбоксы из выпадающего списка клиник */
.clinics_result .clinics_result_str::after,
.clinics_result .clinics_result_str::before {
  display: none !important;
}
/* Карточка результата — стиль ЦИАН */
.clinics_result .clinics_result_str {
  padding: 10px 12px;
  margin-bottom: 0;
  border-bottom: 1px solid #f0f0f3;
  transition: background 0.15s;
  cursor: pointer;
  line-height: 1.3;
}
.clinics_result .clinics_result_str:last-child {
  border-bottom: none;
}
.clinics_result .clinics_result_str:hover {
  background: #e8e8ec;
  color: inherit;
}
.clinics_result .clinics_result_str.active {
  background: #e3e3e8;
}
/* Название — основной текст */
.clinics_result .result-title {
  font-size: 14px;
  font-weight: 500;
  color: #242639;
  line-height: 1.3;
}
/* Подпись типа (клиника, метро, город) */
.clinics_result .result-subtitle {
  font-size: 12px;
  color: #9B9CAA;
  margin-top: 2px;
  line-height: 1.2;
}
/* Предложение сменить регион */
.clinics_result .change-region-item {
  border-top: 1px solid #e0e0e5;
  border-bottom: none;
  padding: 12px;
  background: #f8f8fa;
}
.clinics_result .change-region-item .result-subtitle {
  font-size: 11px;
  color: #9B9CAA;
  margin-top: 0;
  margin-bottom: 4px;
}
.clinics_result .change-region-item .change-region-link {
  font-size: 14px;
  font-weight: 600;
  color: #f06424;
}
.clinics_result .change-region-item:hover {
  background: #f0f0f3;
}
.clinics_result .change-region-item:hover .change-region-link {
  color: #d4551a;
}

/* ====== Крестик сброса выбранной клиники (стиль ЦИАН) ====== */
.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  font-weight: 300;
  color: #9B9CAA;
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  transition: color 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover {
  color: #242639;
}
/* Когда клиника выбрана — отступ справа для крестика */
#search.has-selection {
  padding-right: 36px !important;
  color: #242639;
}

/* ====== Попап выбора города/региона ====== */
.city-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.city-popup-overlay.active {
  display: flex;
}
.city-popup {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: popupIn 0.25s ease;
}
@keyframes popupIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.city-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}
.city-popup-close:hover {
  color: #333;
}
.city-popup-title {
  font-size: 18px;
  font-weight: 700;
  color: #242639;
  margin-bottom: 20px;
  text-align: center;
}
.city-popup-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 2px solid #b8bac8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #242639;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.city-popup-input:focus {
  border-color: #b8bac8;
  box-shadow: none;
}
/* Быстрый выбор города — 2 колонки */
.city-popup-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.city-quick-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #eef0f5;
  color: #242639;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.city-quick-btn:hover {
  background: rgba(240,100,36,0.12);
  color: #f06424;
}

/* Стилизация выпадающего списка suggestions внутри попапа */
.city-popup .suggestions-wrapper {
  margin-top: 4px;
}
.city-popup .suggestions-suggestions {
  background: #fff !important;
  border: 1px solid #e0e0e5 !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
}
.city-popup .suggestions-suggestion {
  color: #242639 !important;
  padding: 10px 16px !important;
  font-size: 14px;
  transition: background 0.15s;
}
.city-popup .suggestions-suggestion:hover,
.city-popup .suggestions-suggestion.selected {
  background: rgba(240,100,36,0.08) !important;
  color: #f06424 !important;
}

/* ====== Адаптив: Tablet ====== */
@media (max-width: 900px) {
  .filters-line { flex-wrap: wrap; }
  .field-clinic { flex: none; width: 100%; order: 5; }
  .btn-search { width: 100%; order: 6; }

  /* Увеличиваем шрифт чипа региона на мобильных */
  .city-selector-label,
  .city-selector-value { font-size: clamp(12px, 2vw, 14px); }
  .city-selector-edit::before { font-size: clamp(12px, 2vw, 14px); }

}

/* Заголовок: на 746px и ниже — 2 строки.
   font-size/letter-spacing задаются глобально через clamp() в основном правиле. */
@media (max-width: 746px) {
  .page-title .title-break { display: block; }
  /* Первая строка не переносится — иначе "И" уходит отдельно и получается 3 строки */
  .page-title .title-line1 { white-space: nowrap; }
}

/* ====== Адаптив: Mobile ====== */
@media (max-width: 660px) {
  /* Предотвращаем горизонтальный скролл */
  #calc_block { overflow-x: hidden; }

  .calc-inner { padding: 12px 12px 20px; }
  .page-title { margin-bottom: 0 !important; }
  .section-label { font-size: clamp(13px, 2.5vw, 15px); }
  .field-label { font-size: clamp(13px, 2.5vw, 14px); }
  .search-panel form { margin-top: 16px; }
  .page-subtitle { font-size: 13px; margin-bottom: 20px; }
  .search-panel { padding: 20px 14px; border-radius: 12px; gap: 16px; }

  /* Отступ между лейблом и иконками */
  .options-section { gap: 20px; }

  /* Иконки опций — перенос в несколько строк по 3.
     Нужен !important: основное правило #calc_block .options-icons { flex-wrap: nowrap }
     имеет более высокую специфичность и перебивает обычный медиа-запрос. */
  #calc_block .options-icons,
  #calc_block .organization_items {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .opt-icon {
    min-width: calc(33.333% - 6px);
    flex: 0 1 calc(33.333% - 6px);
    max-width: calc(33.333% - 6px);
  }
  .opt-icon-box { width: 52px; height: 52px; }
  .opt-icon-box svg { width: 22px; height: 22px; }
  .opt-icon-label { font-size: 11px; max-width: none; }

  /* Разделитель */
  .divider { margin: 16px 0 0; }

  /* Фильтры — в колонку */
  .filters-line { flex-direction: column; align-items: stretch; gap: 12px; padding-bottom: 0; }
  .field-group { width: 100%; }
  .gender-switch { width: 100%; }
  .gender-btn { flex: 1; text-align: center; }
  .field-date { width: 100%; }
  .field-clinic { width: 100%; }

  /* Кнопка — полная ширина */
  .btn-search { width: 100%; padding: 16px 24px; }

  /* Поле даты — убираем фиксированную ширину */
  #calc_block .datepicker,
  #calc_block .datepicker1 { width: 100% !important; }
}

/* ====== Убираем красную заливку полей при ошибке в формах оформления ====== */
/* calc-new.css задаёт background: #fef2f1 для .datepicker.has-error глобально —
   это нужно только в калькуляторе. Для форм физ./юр. лиц сбрасываем заливку,
   оставляя красную обводку (border-color) нетронутой. */
#sendform .has-error,
#corp_form .has-error {
  background: none !important;
  background-color: transparent !important;
}
#sendform .has-error::placeholder,
#corp_form .has-error::placeholder {
  color: inherit !important;
  opacity: 1;
}

/* ====== Фикс: иконки опций в форме для юр. лиц ====== */
/* main.min.css ставит #organization_str { display: flex; justify-content: flex-end }
   что раскладывает .form_text и .organization_items в один горизонтальный ряд.
   Оригинальный style_index.css перебивал это через { display: block } —
   мы удалили его вместе со старым калькулятором. Восстанавливаем для корп. формы. */
#corp_section #organization_str {
  display: block !important;
}
#corp_section #organization_str .organization_items {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
}
#corp_section #organization_str .organization_item {
  float: none !important;
}

/* ====== Фикс: иконка датпикера в корп. и физ. формах ====== */
/* Оригинальный style_index.css имел базовый .ui-datepicker-trigger { position: absolute; left: 125px; top: 43px }
   и .pupop_form_str.insurant_bl .ui-datepicker-trigger { left: 139px; top: 11px } —
   всё это удалено вместе со старым калькулятором.
   Датпикер фиксированной ширины 160px (main.min.css), поэтому left: 139px ставит иконку у правого края.
   Родительский col-md-12 должен иметь position: relative (inline или через CSS). */
#corp_section .ui-datepicker-trigger,
#sendform .col-md-12.tooltip_2 .ui-datepicker-trigger {
  position: absolute !important;
  left: 139px !important;
  top: 11px !important;
  right: auto !important;
  transform: none !important;
  width: 35px;
  height: 35px;
  padding: 10px;
  cursor: pointer;
  opacity: 0.6;
}

/* Выпадающий список клиник в корпоративной форме — скругление как в калькуляторе */
#corp_clinics_str .clinics_result {
  border-radius: 4px !important;
  border: 1px solid #9B9CAA !important;
  border-top-color: #9B9CAA !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  top: auto !important;
  margin-top: 4px;
}
