/* =========================================================
   RTCL SELECT MODAL
   Visual style: RTCL Trip Search
   ========================================================= */


/* =========================================================
   1. BACKDROP
   ========================================================= */

.rtcl-select-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(9, 17, 35, .48);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.rtcl-select-modal-backdrop.is-open {
    display: flex;
}


/* =========================================================
   2. MODAL PANEL
   ========================================================= */

.rtcl-select-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    height: min(620px, calc(100dvh - 24px));
    min-height: 0;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .22);
    animation: rtclSelectModalIn .18s ease-out;
}

@keyframes rtclSelectModalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   3. HEADER
   ========================================================= */

.rtcl-select-modal-header {
    flex: 0 0 auto;
    background: #fff;
    border-bottom: 1px solid #eef0f5;
}

.rtcl-select-modal-heading {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 8px;
    height: 54px;
    padding: 0 16px;
}

.rtcl-select-modal-title {
    grid-column: 2;
    color: #202838;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}


/* =========================================================
   4. HEADER BUTTONS
   ========================================================= */

.rtcl-select-modal-back,
.rtcl-select-modal-close {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7c8392;
    font-size: 19px !important;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.rtcl-select-modal-back {
    grid-column: 1;
    font-size: 26px;
}

.rtcl-select-modal-close {
    grid-column: 3;
    font-size: 23px;
}

/* Close button hover */
.rtcl-select-modal-close:hover,
.rtcl-select-modal-close:focus-visible {
    background: #0964f6;
    color: #fff;
    outline: none;
}

.rtcl-select-modal-close:active {
    background: #0755d4;
    color: #fff;
}

/* Back and close buttons hover */
.rtcl-select-modal-back:hover,
.rtcl-select-modal-back:focus-visible,
.rtcl-select-modal-close:hover,
.rtcl-select-modal-close:focus-visible {
    background: #0964f6;
    color: #fff;
    outline: none;
}

/* Active */
.rtcl-select-modal-back:active,
.rtcl-select-modal-close:active {
    background: #0755d4;
    color: #fff;
}


/* =========================================================
   5. SEARCH FIELD
   ========================================================= */

.rtcl-select-modal-search-wrap {
    position: relative;
    padding: 14px 18px;
}

.rtcl-select-modal-search-icon {
    position: absolute;
    top: 29px;
    left: 33px;
    width: 16px;
    height: 16px;
    border: 2px solid #8c93a3;
    border-radius: 50%;
    pointer-events: none;
}

.rtcl-select-modal-search-icon::after {
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    background: #8c93a3;
    content: "";
    transform: rotate(45deg);
}

.rtcl-select-modal-search {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 48px !important;
    padding: 0 16px 0 44px !important;
    border: 1px solid #dfe4ed !important;
    border-radius: 12px !important;
    outline: none !important;
    background: #fff !important;
    color: #172033 !important;
    font-size: 15px !important;
    box-shadow: none !important;
}

.rtcl-select-modal-search:focus {
    border-color: #0964f6 !important;
    box-shadow: 0 0 0 3px rgba(11, 99, 246, .1) !important;
}


/* =========================================================
   6. OPTIONS LIST
   ========================================================= */

.rtcl-select-modal-list {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 0;
    overflow-y: auto;
    padding: 0 18px 18px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.rtcl-select-modal-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 0 10px;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    border-radius: 0;
    background: #fff;
    color: #111827;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}

.rtcl-select-modal-option:hover,
.rtcl-select-modal-option:focus-visible {
    outline: none;
    background: #f4f8ff;
    color: #0964f6;
}

.rtcl-select-modal-option[hidden],
.rtcl-select-modal-city-group[hidden] {
    display: none !important;
}


/* =========================================================
   7. CITY GROUPS
   ========================================================= */

.rtcl-select-modal-city-group {
    margin: 0;
    padding: 0;
}

.rtcl-select-modal-city-group + .rtcl-select-modal-city-group {
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px solid #eef1f5;
}

.rtcl-select-modal-group-title {
    padding: 14px 12px 7px;
    color: #ff4103;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
}

.rtcl-select-modal-city-group.is-popular {
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f5;
}

.rtcl-select-modal-city-group.is-popular .rtcl-select-modal-option {
    background: #fafcff;
}

.rtcl-select-modal-city-group.is-popular .rtcl-select-modal-option:hover {
    background: #f4f8ff;
}


/* =========================================================
   8. CITY PIN
   ========================================================= */

.rtcl-select-modal-pin {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border: 2px solid #0964f7;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.rtcl-select-modal-pin::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #0964f7;
    content: "";
}


/* =========================================================
   9. OPTION TEXT
   ========================================================= */

.rtcl-select-modal-option-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    line-height: 1.15;
}

.rtcl-select-modal-option-label {
    display: block;
    color: #111827;
    font-size: 16px;
    font-weight: 500;
}

.rtcl-select-modal-option-region {
    display: block;
    color: #8a92a2;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
}

.rtcl-select-modal-option:hover .rtcl-select-modal-option-label,
.rtcl-select-modal-option:focus-visible .rtcl-select-modal-option-label {
    color: #0964f7;
}

.rtcl-select-modal-option:hover .rtcl-select-modal-option-region {
    color: #7a8fb2;
}


/* =========================================================
   10. EMPTY / LOADING
   ========================================================= */

.rtcl-select-modal-empty,
.rtcl-select-modal-loading {
    padding: 40px 10px;
    color: #72798b;
    font-size: 14px;
    text-align: center;
}


/* =========================================================
   11. BODY STATE / ORIGINAL DROPDOWN
   ========================================================= */

body.rtcl-select-modal-open {
    overflow: hidden !important;
}

body.rtcl-select-modal-open .ant-select-dropdown,
body.rtcl-select-modal-suppress-dropdown .ant-select-dropdown {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* =========================================================
   12. MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .rtcl-select-modal-backdrop {
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
    }

    .rtcl-select-modal-panel {
        width: 100%;
        height: min(76dvh, 620px);
        max-height: calc(100dvh - 16px);
        border-radius: 22px;
    }

    .rtcl-select-modal-heading {
        height: 54px;
    }

    .rtcl-select-modal-search-wrap {
        padding: 14px 18px;
    }

    .rtcl-select-modal-search-icon {
        left: 33px;
    }

    .rtcl-select-modal-list {
        padding: 0 18px 18px;
    }

    .rtcl-select-modal-option {
        min-height: 58px;
    }

    .rtcl-select-modal-option-label {
        font-size: 16px;
    }
}


/* =========================================================
   13. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .rtcl-select-modal-panel,
    .rtcl-select-modal-option,
    .rtcl-select-modal-back,
    .rtcl-select-modal-close {
        animation: none;
        transition: none;
    }
}