/* Стили для модального окна */
/* Keep the existing CF7 popup within a narrow phone viewport. */
@media (max-width: 480px) {
  #cf_7--popup {
    box-sizing: border-box;
    max-width: calc(100vw - 24px);
    padding: 36px 24px;
  }

  #cf_7--popup .cost_estimation__agree {
    width: 100%;
    max-width: 100%;
  }

  #cf_7--popup .cost_estimation__formButton {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-window {
  position: relative;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 80%;
  max-width: 600px;
  text-align: center;
}

.modal-window .title-modal {
  margin-bottom: 20px;
  color: #333;
}

.title-modal {
  font-weight: 800;
  font-size: 1.5em;
}

/* стилизация для крестика закрытия */
.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: #6c757d;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.close-modal:hover {
  background-color: #5a6268;
}

/* Отображение основных городов  */
.main-cities {
  list-style-type: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.main-cities li {
  margin: 0;
}

/* стилизация для выбора городов */
.main-cities a {
  text-decoration: none;
  padding: 10px 20px;
  background-color: transparent;
  border: 2px solid #473bf0;
  color: #333;
  border-radius: 25px;
  transition: all 0.3s;
  display: inline-block;
  font-size: 16px;
}

.main-cities a:hover,
.main-cities a.active {
  background-color: #473bf0;
  color: white;
  transform: translateY(-2px);
}

/* Стили для списка подгородов */
#sub-cities-list {
  text-align: center;
  padding: 10px 0;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sub-cities-list li {
  display: inline-block;
  margin: 5px;
}

#sub-cities-list a {
  display: inline-block;
  padding: 10px 20px;
  background-color: transparent;
  border: 2px solid #4e4e4e;
  color: #4e4e4e;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 14px;
}

#sub-cities-list a:hover {
  background-color: #4e4e4e;
  color: white;
  transform: translateY(-2px);
}

/* Стили для поля поиска */
#city-search {
  width: 100%;
  padding: 12px 20px;
  margin: 10px 0 20px;
  box-sizing: border-box;
  border: none;
  border-bottom: 2px solid #6c757d;
  background-color: transparent;
  font-size: 16px;
  color: #333;
  transition: all 0.3s ease;
  position: relative;
}

/* Эффект при фокусе */
#city-search:focus {
  outline: none;
  border-bottom-color: #4e4e4e;
}

/* Добавляем подсказку (placeholder) */
#city-search::placeholder {
  color: #aaa;
  opacity: 1;
}

/* Добавляем анимацию подчеркивания при фокусе */
#city-search:focus::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #4e4e4e;
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: bottom left;
}

#city-search:focus::after {
  transform: scaleX(1);
}

@media (max-width: 600px) {
  #sub-cities-list {
    overflow: overlay;
    max-height: 300px;
  }

  .modal-window h2 {
    font-size: 20px;
  }

  .close-modal {
    width: 22px;
    height: 22px;
    font-size: 20px;
  }

  .main-cities a {
    font-size: 14px;
  }
}
