/* City selection modal — overlay, centering, close button */
.city-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.city-modal--open {
    visibility: visible;
    opacity: 1;
}

.city-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.city-modal__box {
    position: relative;
    width: min(864px, calc(100vw - 32px));
    max-height: calc(100% - 60px);
    padding: 25px;
    background: var(--White, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.city-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
}

.city-modal__title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--Mono-dark-9, #121416);
}

.city-modal__close {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--Mono-gray-6, #636e78);
    font-size: 2.8rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.city-modal__close:hover {
    color: var(--Mono-dark-9, #121416);
    background: var(--Mono-gray-1, #f5f6f7);
}

.city-modal__body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.city-modal__search-wrap {
    position: relative;
    margin-bottom: 1rem;
}

/* Выпадающий список под полем поиска (подсказки) */
.city-modal__search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 1060;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--Mono-gray-2, #e0e3e6);
}

.city-modal__search-dropdown[hidden] {
    display: none !important;
}

.city-modal__quick {
    margin-bottom: 1.5rem;
}

.city-modal__item--quick {
    padding: 0.5rem 1rem;
    font-size: 15px;
    font-weight: 500;
    color: var(--Primary, #0075ff);
    background: rgba(0, 117, 255, 0.08);
    border: 1px solid rgba(0, 117, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.city-modal__item--quick:hover {
    background: rgba(0, 117, 255, 0.15);
    border-color: var(--Primary, #0075ff);
}

.city-modal__search-result-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 15px;
    text-align: left;
    color: var(--Mono-gray-6, #636e78);
    background: #fff;
    text-decoration: none;
    border: none;
    border-bottom: 1px solid var(--Mono-gray-1, #f5f6f7);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.city-modal__search-result-item:hover {
    background: var(--Mono-gray-1, #f5f6f7);
    color: #000;
}

.city-modal__search-result-item:last-child {
    border-bottom: none;
}

.city-modal__search-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.city-modal__search-result-list li {
    margin: 0;
    padding: 0;
}

.city-modal__search-results-loading,
.city-modal__search-results-empty {
    padding: 0.75rem;
    font-size: 14px;
    color: var(--Mono-gray-6, #636e78);
}

.city-modal__quick-list,
.city-modal__group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.city-modal__quick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.city-modal__quick-list li,
.city-modal__group-list li {
    margin: 0;
    padding: 0;
}

.city-modal__list-wrap {
    margin-top: 0.5rem;
}

.city-modal__search {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--Mono-gray-2, #e0e3e6);
    border-radius: 8px;
    font-size: 16px;
}

.city-modal__search:focus {
    border-color: var(--Primary, #0075ff);
    outline: 0;
}


.city-modal__list {
    column-count: 4;
    column-gap: 40px;
}

.city-modal__group {
    break-inside: avoid;
    margin-bottom: 16px;
}

.city-modal__group:last-child {
    margin-bottom: 0;
}

.city-modal__letter {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 0.375rem;
}

.city-modal__item {
    display: block;
    padding: 0.5rem 0;
    font-size: 16px;
    color: var(--Mono-gray-6, #636e78);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.city-modal__item:hover {
    color: #000;
}

.city-modal__group-list .city-modal__item {
    padding: 0.35rem 0;
}

body.city-modal-open {
    overflow: hidden;
}

/* Button on page */
.city-select-btn {
    display: inline-block;
    color: #000;
    font-size: 16px;
    margin: 20px 0;
    padding: 0 0 5px 0;
    border: none;
    border-bottom: 1px dashed #000;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.city-select-btn::after {
    content: "→";
    margin-left: 8px;
}

.city-select-btn:hover {
    color: #000;
    border-bottom-color: #000;
}

/* На главной у кнопки выбора города без отступов */
.page-home .city-select-btn {
    margin: 0;
}
