/*
 Theme Name:   Impreza Child
 Template:     Impreza
*/

:root {
    --region-main-color: #000; /* Основной цвет текста и бордеров (подстройте под сайт) */
    --region-accent-color: #555; /* Цвет при наведении */
    --region-muted-color: #8c8c8c; /* Цвет подсказок и неактивных городов */
    --region-bg-modal: #ffffff; /* Фон окна */
}

/* Кнопка в шапке */
.region-trigger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    color: inherit; /* Наследует цвет текста шапки */
    transition: opacity 0.2s;
}
.region-trigger-btn:hover {
    opacity: 0.8;
}

/* Оверлей (затемнение фона) */
.region-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Чтобы перекрывало шапку и меню */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Модальное окно открыто */
.region-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Контейнер окна */
.region-modal-container {
    background-color: var(--region-bg-modal);
    width: 100%;
    max-width: 560px; /* Ширина как на макете */
    margin: 15px;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    box-sizing: border-box;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.region-modal-overlay.is-open .region-modal-container {
    transform: translateY(0);
}

/* Кнопка Закрыть */
.region-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    transition: color 0.2s;
}
.region-modal-close:hover {
    color: var(--region-main-color);
}

/* Внутренняя структура */
.region-selector-wrapper {
    color: var(--region-main-color);
}

.region-title {
	display: inline-block;
    font-size: 22px;
    font-weight: 500;
    margin: 0 0 20px 0;
}

/* Поле поиска */
.region-search-box {
    position: relative;
    margin-bottom: 8px;
}
.region-search-box input {
    width: 100%;
    padding: 12px 15px 12px 42px;
    border: 1px solid var(--region-main-color);
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    background: transparent;
}
.region-search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 53%;
    transform: translateY(-50%);
    color: var(--region-muted-color);
    display: flex;
}

/* Подсказка */
.region-example {
    font-size: 13px;
    color: var(--region-muted-color);
    margin-bottom: 30px;
}
.region-example span {
    color: var(--region-muted-color);
    text-decoration: underline;
	cursor: pointer;
}

/* Сетка списка городов */
.region-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 колонки по умолчанию */
    gap: 16px 40px;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 350px;
    overflow-y: auto; /* На случай если городов будет слишком много на мобильных */
}

.region-link {
    font-size: 16px;
    color: var(--region-main-color);
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s;
}
.region-link:hover {
    color: var(--region-accent-color);
}
.disabled-city {
    color: #b5b5b5;
    pointer-events: none; /* Отключает клик для городов-заглушек */
}

/* --- Адаптивность под мобильные устройства --- */
@media (max-width: 576px) {
    .region-modal-container {
        padding: 30px 20px;
        margin: 10px;
    }
    .region-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    .region-list {
        grid-template-columns: 1fr; /* На смартфонах выстраиваем в 1 колонку для удобства тапа */
        gap: 14px;
    }
    .region-link {
        font-size: 15px;
        padding: 4px 0; /* Увеличиваем область клика */
    }
	.region-trigger-btn {
		font-size: 12px;
	}
}