/**
 * @file
 * Стили для модуля customgeoselect.
 */

/* Оверлей модального окна */
.customgeoselect-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0;
}

/* Модальное окно */
.customgeoselect-modal {
  background: #fff;
  width: 643px;
  height: 562px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  max-height: 90vh;
  overflow: hidden;
  margin-top: 0;
}

/* Заголовок */
.customgeoselect-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.customgeoselect-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

/* Кнопка закрытия */
.customgeoselect-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.customgeoselect-close:hover {
  color: #333;
}

/* Поле поиска */
.customgeoselect-search {
  padding: 16px 24px;
  border-bottom: 1px solid #e5e5e5;
  position: relative;
  flex-shrink: 0;
}

.customgeoselect-search-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #f5f5f5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

.customgeoselect-search-input:focus {
  outline: none;
  border-color: #0066cc;
  background-color: #fff;
}

/* Автокомплит */
.customgeoselect-autocomplete {
  display: none;
  position: absolute;
  top: 100%;
  left: 24px;
  right: 24px;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10001;
  margin-top: -1px;
}

.customgeoselect-autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background-color 0.2s;
}

.customgeoselect-autocomplete-item:hover {
  background-color: #f0f0f0;
}

/* Контейнер городов */
.customgeoselect-cities {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Секция топовых городов */
.customgeoselect-cities-section {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Кнопка города */
.customgeoselect-city {
  padding: 2px 0px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: color 0.2s;
  user-select: none;
}

.customgeoselect-city:hover {
  color: #0066cc;
}

.customgeoselect-city.active {
  color: #0066cc;
  font-weight: 500;
}

.customgeoselect-city .checkmark {
  color: #0066cc;
  margin-right: 4px;
}

/* Контейнер с алфавитом */
.customgeoselect-alphabet {
  display: flex;
  gap: 40px;
}

/* Колонка городов */
.customgeoselect-column {
  flex: 1;
  min-width: 0;
}

/* Секция с буквой */
.customgeoselect-letter-section {
  margin-bottom: 0px;
  display: flex;
  align-items: flex-start;
}

/* Буква-разделитель */
.customgeoselect-letter {
  font-size: 14px;
  font-weight: 600;
  color: #0066cc;
  margin-right: 12px;
  padding: 2px 0;
  flex-shrink: 0;
  width: 16px;
}

/* Обёртка для городов */
.customgeoselect-cities-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Мобильные стили */
@media (max-width: 768px) {
  .customgeoselect-overlay {
    align-items: center;
    padding-top: 0;
  }

  .customgeoselect-modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin-top: 0;
  }

  .customgeoselect-header {
    padding: 16px 20px;
  }

  .customgeoselect-search {
    padding: 12px 20px;
  }

  .customgeoselect-cities {
    padding: 16px 20px;
  }

  .customgeoselect-alphabet {
    gap: 20px;
  }
}

@media (max-width: 375px) {
  .customgeoselect-alphabet {
    flex-direction: column;
    gap: 0;
  }

  .customgeoselect-column {
    width: 100%;
  }

  /* Для очень маленьких экранов делаем 2 колонки */
  .customgeoselect-alphabet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .customgeoselect-column {
    width: auto;
  }

  .customgeoselect-autocomplete {
    left: 20px;
    right: 20px;
  }
}

/* Скроллбар */
.customgeoselect-cities::-webkit-scrollbar {
  width: 6px;
}

.customgeoselect-cities::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.customgeoselect-cities::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.customgeoselect-cities::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.customgeoselect-autocomplete::-webkit-scrollbar {
  width: 6px;
}

.customgeoselect-autocomplete::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.customgeoselect-autocomplete::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.customgeoselect-autocomplete::-webkit-scrollbar-thumb:hover {
  background: #999;
}