/* Patch 18 — поиск как у HanEvi, без съезда */

.agency-hero .home-search-pro,
.agency-hero .vt-search {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: -78px !important;
  transform: translateX(-50%) !important;
  z-index: 20 !important;
}

.home-search-pro,
.vt-search {
  width: min(1120px, calc(100% - 44px)) !important;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px 16px;
  box-shadow: 0 18px 60px rgba(24,26,32,.16);
  overflow: visible;
}

.vt-tabs {
  display: flex;
  gap: 0;
  height: 48px;
  align-items: flex-end;
}

.vt-tabs button {
  border: 0;
  background: transparent;
  padding: 0 18px 13px;
  height: 48px;
  font-weight: 800;
  cursor: default;
  border-bottom: 2px solid transparent;
}

.vt-tabs button.active {
  border-color: #181a20;
  color: #181a20;
}

.vt-search-row {
  display: grid;
  grid-template-columns: 1.35fr .75fr 18px .75fr 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.vt-search input,
.vt-search select {
  min-height: 50px;
  border-radius: 8px;
  transition: .18s ease;
}

.vt-dash {
  text-align: center;
  font-weight: 900;
}

.vt-more {
  min-height: 50px;
  border: 0;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
  border-radius: 8px;
  transition: .18s ease;
  text-align: left;
  padding: 0 10px;
}

.vt-find,
.vt-map {
  min-height: 50px;
  padding: 0 24px;
  white-space: nowrap;
  transition: .18s ease;
}

.vt-map {
  border-color: #181a20;
  color: #181a20;
  background: #fff;
}

.vt-search input:hover,
.vt-search select:hover,
.vt-more:hover,
.vt-find:hover,
.vt-map:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 10px 28px rgba(24,26,32,.12);
}

.vt-search input:focus,
.vt-search select:focus {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 0 0 4px rgba(235,103,83,.14);
  border-color: var(--primary);
}

/* Старые поиски полностью скрываем только на главной */
.agency-hero .agency-search,
.agency-hero .search-card,
.agency-hero .home-search-pro:not(.vt-search) {
  display: none !important;
}

.dynamic-hero,
.agency-hero,
.hero-v3 {
  min-height: 620px !important;
  overflow: visible !important;
}

.districts-section {
  padding-top: 125px !important;
}

/* Модалка фильтров */
.filters-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.filters-modal.active {
  display: block;
}

.filters-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24,26,32,.62);
}

.filters-box {
  position: relative;
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  margin: 22px auto;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.filters-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--muted);
  font-size: 30px;
  cursor: pointer;
}

.filters-box h2 {
  margin: 0 0 22px;
  font-size: 26px;
}

.filters-box label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 800;
  color: #333;
}

.filters-box input {
  width: 100%;
}

.two-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.chip-row button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.filters-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1150px) {
  .vt-search-row {
    grid-template-columns: 1fr 1fr;
  }

  .vt-dash {
    display: none;
  }

  .vt-find,
  .vt-map {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .agency-hero .vt-search {
    bottom: -250px !important;
    width: calc(100% - 22px) !important;
    padding: 0 12px 12px;
  }

  .vt-search-row {
    grid-template-columns: 1fr;
  }

  .dynamic-hero,
  .agency-hero,
  .hero-v3 {
    min-height: 835px !important;
  }

  .districts-section {
    padding-top: 285px !important;
  }

  .filters-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .agency-hero .vt-search {
    bottom: -265px !important;
  }

  .dynamic-hero,
  .agency-hero,
  .hero-v3 {
    min-height: 850px !important;
  }

  .two-inputs {
    grid-template-columns: 1fr;
  }
}
