/*
 * VORIK — Reusable city autocomplete
 */

.vorik-city-autocomplete {
    position: relative;
    width: 100%;
    min-width: 0;
}

.vorik-city-autocomplete > input {
    width: 100%;
}

.vorik-city-autocomplete__dropdown {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 9px);
    left: -39px;
    right: -15px;
    max-height: min(360px, 56vh);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid rgba(8, 43, 85, 0.10);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 22px 55px rgba(8, 43, 85, 0.20),
        0 4px 14px rgba(8, 43, 85, 0.08);
    backdrop-filter: blur(18px);
    scrollbar-width: thin;
    scrollbar-color:
        #cbd9e7
        transparent;
    animation:
        vorik-city-dropdown-in
        150ms ease-out;
}

.vorik-city-autocomplete__dropdown[hidden] {
    display: none;
}

.vorik-city-autocomplete__list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vorik-city-autocomplete__option {
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns:
        42px
        minmax(0, 1fr)
        20px;
    gap: 11px;
    align-items: center;
    padding: 9px 10px;
    border: 0;
    border-radius: 13px;
    color: #0a2d55;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition:
        background-color 130ms ease,
        transform 130ms ease;
}

.vorik-city-autocomplete__option:hover,
.vorik-city-autocomplete__option.is-active {
    background: #edf7ff;
}

.vorik-city-autocomplete__option:active {
    transform: scale(0.988);
}

.vorik-city-autocomplete__option-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #0876dd;
    background: #eaf5ff;
    font-size: 16px;
}

.vorik-city-autocomplete__option-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vorik-city-autocomplete__option-content strong {
    overflow: hidden;
    color: #082b55;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vorik-city-autocomplete__option-content small {
    overflow: hidden;
    color: #6a7e95;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vorik-city-autocomplete__option-arrow {
    color: #9eb0c2;
    font-size: 10px;
}

.vorik-city-autocomplete__status {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #637790;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

.vorik-city-autocomplete__status.is-error {
    color: #b42318;
}

.vorik-city-autocomplete__loader {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 16px;
    height: 16px;
    border: 2px solid #d8e8f7;
    border-top-color: #0876dd;
    border-radius: 50%;
    animation:
        vorik-city-loader-spin
        650ms linear infinite;
}

.vorik-city-autocomplete__loader[hidden] {
    display: none;
}

.vorik-city-autocomplete.is-open
input {
    color: #082b55;
}

@keyframes vorik-city-dropdown-in {
    from {
        opacity: 0;
        transform:
            translateY(-5px)
            scale(0.985);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

@keyframes vorik-city-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 640px) {
    .vorik-city-autocomplete__dropdown {
        left: -39px;
        right: -15px;
        max-height: 390px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vorik-city-autocomplete__dropdown,
    .vorik-city-autocomplete__loader,
    .vorik-city-autocomplete__option {
        animation: none;
        transition: none;
    }
}
