/*
 * Выбор города в шапке: текущий город, вопрос при первом заходе и окно списка.
 *
 * Оформление намеренно своё, а не на классах Аспро: блок стоит в шапке, у
 * которой уже есть собственные правила с !important, и чужие классы здесь
 * поведут себя непредсказуемо.
 */

.rk-city {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.rk-city__current {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.rk-city__current:hover { color: #ed1c24; }
.rk-city__current svg { flex: none; opacity: .75; }
.rk-city__current span { border-bottom: 1px dashed currentColor; }

/* Вопрос «ваш город такой-то?» — показывается один раз. */
.rk-city__ask {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 12px);
    left: -14px;
    width: 280px;
    padding: 16px;
    border: 1px solid #e3e9f0;
    border-radius: 12px;
    background: #fff;
    color: #243546;
    box-shadow: 0 18px 44px rgba(16, 36, 64, .16);
    text-align: left;
    white-space: normal;
}

.rk-city__ask::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 24px;
    width: 12px;
    height: 12px;
    border-top: 1px solid #e3e9f0;
    border-left: 1px solid #e3e9f0;
    background: #fff;
    transform: rotate(45deg);
}

.rk-city__ask-title { margin-bottom: 4px; font-size: 16px; font-weight: 700; line-height: 1.25; }
.rk-city__ask-note { margin-bottom: 14px; color: #74808c; font-size: 12px; line-height: 1.4; }
.rk-city__ask-buttons { display: flex; gap: 8px; }

.rk-city__btn {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #dde5ec;
    border-radius: 8px;
    background: #fff;
    color: #243546;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.rk-city__btn:hover { border-color: #b9c7d4; }
.rk-city__btn--main { border-color: #ed1c24; background: #ed1c24; color: #fff; }
.rk-city__btn--main:hover { border-color: #c8151c; background: #c8151c; }

/* Окно со списком городов. */
.rk-city-modal { position: fixed; z-index: 10050; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; }
.rk-city-modal[hidden] { display: none; }
.rk-city-modal__backdrop { position: absolute; inset: 0; background: rgba(16, 28, 40, .55); }

.rk-city-modal__window {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: min(640px, 92vh);
    padding: 24px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 30px 70px rgba(10, 24, 40, .35);
    box-sizing: border-box;
}

.rk-city-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: none;
    color: #8c98a4;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.rk-city-modal__close:hover { color: #243546; }
.rk-city-modal__title { margin: 0 0 16px; color: #16222e; font-size: 21px; font-weight: 800; }

.rk-city-modal__search {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #dde5ec;
    border-radius: 10px;
    background: #f7fafc;
    color: #16222e;
    font: inherit;
    font-size: 15px;
    box-sizing: border-box;
}

.rk-city-modal__search:focus { outline: none; border-color: #ed1c24; background: #fff; }

.rk-city-modal__popular { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }

.rk-city-chip {
    padding: 8px 14px;
    border: 1px solid #dde5ec;
    border-radius: 999px;
    background: #fff;
    color: #243546;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.rk-city-chip:hover { border-color: #ed1c24; color: #ed1c24; }
.rk-city-chip.is-current { border-color: #ed1c24; background: #fdeceD; color: #c8151c; font-weight: 700; }

.rk-city-modal__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr));
    gap: 2px 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #eef3f7;
    overflow-y: auto;
}

.rk-city-row {
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #334453;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.rk-city-row:hover { background: #f2f7fb; color: #16222e; }
.rk-city-row.is-current { color: #c8151c; font-weight: 700; }
.rk-city-row[hidden] { display: none; }

.rk-city-modal__empty { padding: 18px 2px; color: #8c98a4; font-size: 14px; }

@media (max-width: 640px) {
    .rk-city--mobile { position: relative; }
    .rk-city__ask { left: 10px; right: 10px; width: auto; }
    .rk-city__ask::before { left: 18px; }
    .rk-city-modal__window { padding: 20px 16px; max-height: 94vh; }
    .rk-city-modal__list { grid-template-columns: 1fr 1fr; }
}

/* Полоса с городом под мобильной шапкой: в самой шапке места нет. */
.rk-city--mobile {
    position: relative;
    /* Над полосой города на главной лежит обёртка слайдера темы со своим
       слоем — без высокого слоя полоса и карточка вопроса прячутся под ней. */
    z-index: 1100;
    display: flex;
    width: 100%;
    padding: 7px 14px;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
}

.rk-city--mobile .rk-city__current { font-size: 14px; }
