/* Hero Buttons */
.btn-hero {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: 5px;
    padding-top: clamp(2px, calc(0.1076vw + 0.934px), 3px);
    padding-right: clamp(2px, calc(0.1076vw + 0.934px), 3px);
    padding-bottom: clamp(2px, calc(0.1076vw + 0.934px), 3px);
    padding-left: clamp(12px, calc(0.7535vw + 4.533px), 19px);
    font-size: clamp(14px, calc(0.43057vw + 9.733px), 18px);
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.btn-hero .btn-icon-wrap {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: clamp(35px, calc(1.076vw + 24.338px), 45px);
    height: clamp(35px, calc(1.076vw + 24.338px), 45px);
    border-radius: 5px;
}

/* Кнопка "Начать работу" */
.btn-start {
    background-color: #FFFFFF;
    color: #353331;
    font-weight: 500;
}

.btn-start .btn-icon-wrap {
    background-color: #353331;
    margin-left: clamp(15px, calc(1.076vw + 4.338px), 25px);
}

/* Кнопка "Посмотреть ролик" */
.btn-watch-video {
    background-color: #353331;
    color: #FFFFFF;
    font-weight: 400;
}

.btn-watch-video .btn-icon-wrap {
    background-color: rgba(255, 255, 255, 0.2);
    margin-left: clamp(10px, calc(0.96878vw + 0.39px), 19px);
}

.btn-watch-video .btn-icon-wrap img {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* Hover эффект: иконка становится белой */
.btn-watch-video:hover .btn-icon-wrap img {
    opacity: 1;
}

/* Filters Section */
.filters-section {
  position: relative;
  margin-top: 150px;
  width: 100%;
}

.filters-container {
  margin: 0 auto;
  max-width: 1760px; /* 1920 - 80 - 80 */
  padding: 0 20px; /* Немного отступов на случай маленьких экранов */
}

/* Location Tabs (Москва/ОАЭ) */
.filters-location-tabs {
  display: flex;
  justify-content: center;
  gap: 0; /* Убираем промежуток */
  position: relative; /* Для z-index */
  z-index: 2; /* Поднимаем табы на слой выше, чтобы они были над рамкой */
  /* margin-bottom: -7px; /* Смещаем вниз на толщину рамки */
  width: fit-content; /* Ограничиваем ширину контейнера по содержимому */
  margin-left: auto; /* Центрируем контейнер */
  margin-right: auto; /* Центрируем контейнер */
}

/* Размытая рамка для контейнера табов */
.filters-location-tabs::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -7px;
  right: -7px;
  bottom: 0; /* Рамка доходит до низа табов */
  background: rgba(255, 255, 255, 0.2); /* #FFFFFF33 */
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: -1; /* Помещаем за табы */
  border-radius: 10px;
}

.location-tab {
  border: none;
  cursor: pointer;
  /* padding: 15px 30px; убрано, т.к. задается индивидуально */
  padding-top: 15px;
  padding-bottom: 15px;
  border-radius: 7px 7px 0 0;
  font-family: "Commissioner", sans-serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: all 0.3s ease;
}

.location-tab:first-child {
  border-right-width: 0;
  padding-left: 44px;
  padding-right: 44px;
}

.location-tab:last-child {
  border-left-width: 0;
  padding-left: 56px;
  padding-right: 56px;
}

.location-tab.active {
  background-color: #353331;
  color: #ffffff;
  font-weight: 500;
}

.location-tab:not(.active) {
  background-color: #868583; /* Сплошной серый, визуально похожий на #FFFFFF66 на темном фоне */
  color: rgba(255, 255, 255, 0.7); /* #FFFFFFB2 */
  font-weight: 400;
}

/* Main Filter Form */
.main-filter-wrapper {
  /* Фон сделан непрозрачным */
  background-color: #353331;
  padding: 30px;
  border-radius: 10px;
  position: relative;
  /* Создаем "рамку" с помощью тени, которая не влияет на сам блок */
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.2); /* #FFFFFF33 */
  /* Примечание: backdrop-filter не будет иметь видимого эффекта с непрозрачным фоном */
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.main-filter-form {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Property Type (Новостройки/Вторичка) */
.filter-property-type {
  display: flex;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  border: 1px solid #ffffff;
  flex-shrink: 0; /* Запрещаем блоку сжиматься */
}

.prop-type-btn {
  border: none;
  cursor: pointer;
  padding: 20px 25px;
  background-color: transparent;
  font-family: "Commissioner", sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 500;
  color: #ffffff;
  transition: all 0.3s ease;
  flex: 1; /* Равномерное распределение ширины */
  text-align: center;
  white-space: nowrap; /* Запрещаем перенос текста */
  /* border-radius: 5px; убрано, т.к. задается индивидуально */
}

.prop-type-btn:first-child {
  border-radius: 5px 0 0 5px;
}

.prop-type-btn:last-child {
  border-radius: 0 5px 5px 0;
}

.prop-type-btn.active {
  background-color: #ffffff;
  color: #353331;
}

/* Fields Container */
.filter-fields-container {
  flex-grow: 1;
  display: flex;
  gap: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  padding: 0 20px;
  max-width: 960px;
}

.filter-field {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px;
  border-radius: 5px;
}

.filter-field:not(.filter-select) {
  max-width: 400px;
}

.filter-field.filter-select {
  max-width: 240px;
}

.filter-field-icon {
  margin-right: 10px;
}

.filter-field input,
.filter-field select {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: "Commissioner", sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 400;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
}

.filter-field input::placeholder {
  color: #ffffff;
  opacity: 1;
}

.filter-field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.filter-select-arrow {
  position: absolute;
  right: 23px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Find Button */
.btn-find {
  padding: 5px 5px 5px 15px;
  background-color: #ffffff;
  color: #353331;
  font-weight: 500;
  flex-shrink: 0; /* Запрещаем кнопке сжиматься */
  flex-grow: 1; /* Разрешаем кнопке растягиваться, занимая свободное место */
  justify-content: space-between; /* Распределяем текст и иконку по краям */
  cursor: pointer;
}

.btn-find .btn-icon-wrap {
  width: 41px;
  height: 41px;
  background-color: #353331;
  margin-left: 15px;
}

.btn-find .btn-icon-wrap img {
  transition: transform 0.3s ease;
}

/* Hover эффект: поворот стрелки на 45 градусов */
.btn-find:hover .btn-icon-wrap img {
  transform: rotate(45deg);
}

/* Tags */
.filter-tags-container {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 70%; /* Изменено с 60% на 70% */
  margin-left: auto;
  margin-right: auto;
}

.filter-tag {
  padding: 10px 15px;
  background-color: #ffffff;
  color: #353331;
  font-family: "Commissioner", sans-serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 400;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.filter-tag:hover {
  opacity: 0.8;
}

.filter-select-group {
  display: flex;
  gap: 20px;
  width: 100%;
}
.filter-select-group .filter-field.filter-select {
  width: 100%;
}
.filter-fields-container > .filter-field,
.filter-fields-container > .filter-select-group {
  flex: 1 1 0;
  min-width: 0;
}

/* Показывать только на мобиле */
.mobile-only {
  display: none !important;
}
.desktop-only {
  display: block !important;
}

@media (min-width: 991px) {
  .filters-container {
    max-width: clamp(
      950px,
      calc(950px + (1760 - 950) * ((100vw - 991px) / (1920 - 991))),
      1760px
    );
    padding-left: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
    padding-right: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
  }
  .location-tab {
    font-size: clamp(
      14px,
      calc(14px + (18 - 14) * ((100vw - 991px) / (1920 - 991))),
      18px
    );
    padding-top: clamp(
      10px,
      calc(10px + (15 - 10) * ((100vw - 991px) / (1920 - 991))),
      15px
    );
    padding-bottom: clamp(
      10px,
      calc(10px + (15 - 10) * ((100vw - 991px) / (1920 - 991))),
      15px
    );
  }
  .location-tab:first-child {
    padding-left: clamp(
      20px,
      calc(20px + (44 - 20) * ((100vw - 991px) / (1920 - 991))),
      44px
    );
    padding-right: clamp(
      20px,
      calc(20px + (44 - 20) * ((100vw - 991px) / (1920 - 991))),
      44px
    );
  }
  .location-tab:last-child {
    padding-left: clamp(
      30px,
      calc(30px + (56 - 30) * ((100vw - 991px) / (1920 - 991))),
      56px
    );
    padding-right: clamp(
      30px,
      calc(30px + (56 - 30) * ((100vw - 991px) / (1920 - 991))),
      56px
    );
  }
  .main-filter-wrapper {
    padding: clamp(
      15px,
      calc(15px + (30 - 15) * ((100vw - 991px) / (1920 - 991))),
      30px
    );
    box-shadow: 0 0 0
      clamp(4px, calc(4px + (7 - 4) * ((100vw - 991px) / (1920 - 991))), 7px)
      rgba(255, 255, 255, 0.2);
  }
  .main-filter-form {
    gap: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
  }
  .prop-type-btn {
    font-size: clamp(
      12px,
      calc(12px + (16 - 12) * ((100vw - 991px) / (1920 - 991))),
      16px
    );
    padding: clamp(
        10px,
        calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
        20px
      )
      clamp(
        20px,
        calc(20px + (30 - 20) * ((100vw - 991px) / (1920 - 991))),
        30px
      );
    flex: 1; /* Равномерное распределение ширины */
    text-align: center;
  }
  .filter-fields-container {
    gap: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
    padding-left: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
    padding-right: clamp(
      10px,
      calc(10px + (20 - 10) * ((100vw - 991px) / (1920 - 991))),
      20px
    );
    max-width: clamp(
      450px,
      calc(450px + (960 - 450) * ((100vw - 991px) / (1920 - 991))),
      960px
    );
  }
  .filter-field {
    padding: clamp(
      8px,
      calc(8px + (16 - 8) * ((100vw - 991px) / (1920 - 991))),
      16px
    );
  }
  .filter-field:not(.filter-select) {
    max-width: clamp(
      200px,
      calc(200px + (400 - 200) * ((100vw - 991px) / (1920 - 991))),
      400px
    );
  }
  .filter-field.filter-select {
    max-width: clamp(
      120px,
      calc(120px + (240 - 120) * ((100vw - 991px) / (1920 - 991))),
      240px
    );
  }
  .filter-field input,
  .filter-field select {
    font-size: clamp(
      12px,
      calc(12px + (16 - 12) * ((100vw - 991px) / (1920 - 991))),
      16px
    );
  }
  .filter-field-icon {
    margin-right: clamp(
      5px,
      calc(5px + (10 - 5) * ((100vw - 991px) / (1920 - 991))),
      10px
    );
  }
  .btn-find {
    padding: 5px 5px 5px
      clamp(
        10px,
        calc(10px + (15 - 10) * ((100vw - 991px) / (1920 - 991))),
        15px
      );
  }
  .btn-find .btn-icon-wrap {
    width: clamp(
      25px,
      calc(25px + (41 - 25) * ((100vw - 991px) / (1920 - 991))),
      41px
    );
    height: clamp(
      25px,
      calc(25px + (41 - 25) * ((100vw - 991px) / (1920 - 991))),
      41px
    );
    margin-left: clamp(
      8px,
      calc(8px + (15 - 8) * ((100vw - 991px) / (1920 - 991))),
      15px
    );
  }
  .filter-tags-container {
    margin-top: clamp(
      15px,
      calc(15px + (30 - 15) * ((100vw - 991px) / (1920 - 991))),
      30px
    );
    gap: clamp(
      5px,
      calc(5px + (10 - 5) * ((100vw - 991px) / (1920 - 991))),
      10px
    );
  }
  .filter-tag {
    font-size: clamp(
      12px,
      calc(12px + (16 - 12) * ((100vw - 991px) / (1920 - 991))),
      16px
    );
    padding: clamp(
        5px,
        calc(5px + (10 - 5) * ((100vw - 991px) / (1920 - 991))),
        10px
      )
      clamp(
        10px,
        calc(10px + (15 - 10) * ((100vw - 991px) / (1920 - 991))),
        15px
      );
  }
}

@media (max-width: 991px) {
  /* Hero Buttons */
  .btn-hero {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: -4%;
    padding-left: 20px;
  }
  .btn-hero .btn-icon-wrap {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    max-width: 45px;
    max-height: 45px;
  }
  
  .filters-section {
    position: absolute;
    z-index: 2;
    margin-top: 220px;
    width: 100%;
  }
  /* Основная форма фильтра */
  .main-filter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  /* Типографика для табов Москва/ОАЭ */
  .location-tab {
    font-family: "Commissioner", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: -4%;
    text-align: center;
  }
  /* Паддинг для враппера формы */
  .main-filter-wrapper {
    padding: 20px;
  }
  /* Боковой паддинг контейнера фильтров */
  .filters-container {
    padding-left: 30px;
    padding-right: 30px;
  }
  /* Кнопки Новостройки/Вторичка */
  .prop-type-btn {
    font-family: "Commissioner", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -6%;
    text-align: center;
    flex: 1; /* Равномерное распределение ширины */
    box-sizing: border-box;
  }
  .prop-type-btn:last-child.active {
    background: #353331;
    color: #fff;
  }
  .filter-fields-container {
    flex-direction: column;
    gap: 10px;
    border: none;
    padding: 0;
    max-width: 100%;
  }
  /* Вторая строка — инпут */
  .filter-fields-container .filter-field:not(.filter-select) {
    max-width: none;
    width: 100%;
  }
  /* Третья строка — селекты в одну строку */
  .filter-fields-container .filter-select {
    width: 49%;
    display: inline-flex;
    margin-right: 2%;
  }
  .filter-fields-container .filter-select:last-child {
    margin-right: 0;
  }
  /* Объединяем два селекта в одну строку */
  .filter-fields-container .filter-select:nth-child(2),
  .filter-fields-container .filter-select:nth-child(3) {
    display: inline-flex;
    width: 49%;
  }
  .filter-fields-container .filter-select:nth-child(2) {
    margin-right: 2%;
  }
  .filter-fields-container .filter-select:nth-child(3) {
    margin-right: 0;
  }
  /* Кнопка Найти */
  .btn-find {
    width: 100%;
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
  }
  /* Теги */
  .filter-tags-container {
    width: 100%;
    gap: 8px;
    margin-top: 20px;
  }
  /* Группа селектов в одну строку */
  .filter-select-group {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 0;
    max-width: 100%;
  }
  .filter-select-group .filter-field.filter-select {
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    padding: 16px;
    margin-right: 0;
  }
  .filter-tag {
    background: #d4d4d4;
    color: #353331;
    font-family: "Commissioner", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -4%;
    text-align: center;
  }
}

@media (max-width: 575px) {
  /* Hero Buttons */
  .btn-hero {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-style: Medium;
    font-size: 16px;
    leading-trim: CAP_HEIGHT;
    line-height: 100%;
    letter-spacing: -4%;
    width: 100%;
    justify-content: space-between;
    padding: 3px 3px 3px 15px;
    border-radius: 5px;
    box-sizing: border-box;
  }
  .btn-hero .btn-icon-wrap {
    width: 41px;
    height: 41px;
    min-width: 41px;
    min-height: 41px;
    max-width: 41px;
    max-height: 41px;
  }
  
  .mobile-only {
    display: block !important;
  }
  .desktop-only {
    display: none !important;
  }
  .filters-section {
    position: relative;
    z-index: 2;
    margin-top: 0;
  }
  .filters-container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .filters-location-tabs {
    width: 100%;
  }
  .main-filter-wrapper {
    border-radius: 0 0 10px 10px;
  }
  .location-tab {
    flex-basis: 50%;
    width: 50%;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
  }
  .location-tab:first-child,
  .location-tab:last-child {
    padding-left: 0;
    padding-right: 0;
  }
  .prop-type-btn {
    font-family: "Commissioner", sans-serif;
    font-weight: 500;
    font-style: Medium;
    font-size: 14px;
    leading-trim: CAP_HEIGHT;
    line-height: 100%;
    letter-spacing: -6%;
    text-align: center;
    padding: 15px 10px; /* Фиксированный padding для всех кнопок */
    flex: 1; /* Равномерное распределение ширины */
  }
  .filter-fields-container {
    flex-direction: column;
    gap: 5px;
  }
  .filter-field {
    width: 100%;
    padding: 0 10px;
  }
  .filter-field input,
  .filter-field select {
    padding: 10px;
    font-family: "Commissioner", sans-serif;
    font-weight: 400;
    font-style: Regular;
    font-size: 16px;
    leading-trim: CAP_HEIGHT;
    line-height: 100%;
    letter-spacing: -6%;
  }
  .filter-field input::placeholder {
    font-family: "Commissioner", sans-serif;
    font-weight: 400;
    font-style: Regular;
    font-size: 16px;
    leading-trim: CAP_HEIGHT;
    line-height: 100%;
    letter-spacing: -6%;
  }
  .filter-select-group .filter-field.filter-select {
    padding: 0 5px 0 10px;
  }
  .filter-select-group {
    flex-direction: column;
    gap: 5px;
  }
  .filter-tags-container {
    margin-top: 10px;
    justify-content: flex-start;
    gap: 5px;
    text-align: left;
  }
  .filter-tag {
    font-family: "Commissioner", sans-serif;
    font-weight: 400;
    font-style: Regular;
    font-size: 14px;
    leading-trim: NONE;
    line-height: 100%;
    letter-spacing: -4%;
    text-align: center;
    padding: 5px 8px;
  }
}

@media (min-width: 992px) {
  .filters-section {
    width: clamp(
    950px,
    calc(950px + (1760 - 950) * ((100vw - 991px) / (1920 - 991))),
    1760px
  );
  position: absolute;
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
  z-index: 2;
  }
}