/* ============================================================
   VORIK — PREMIUM VEHICLE SEARCH
   Minimal search: location + dates + actions
   ============================================================ */

.vorik-search-sheet-control {
    min-width: 0;
}


.vorik-search-sheet-control
[data-vorik-search-location-input] {
    min-width: 0;
}


/* ============================================================
   GPS BUTTON
   ============================================================ */

.vorik-search-gps-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    margin-left: -3px;

    border: 0;
    border-radius: 12px;

    color: #10284d;
    background: #fff3b0;

    cursor: pointer;

    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease;
}


.vorik-search-gps-button:hover {
    background: #ffd21f;
}


.vorik-search-gps-button:active {
    transform: scale(.96);
}


.vorik-search-gps-button.is-loading {
    opacity: .65;
    pointer-events: none;
}


.vorik-search-gps-button.is-located {
    color: #ffffff;
    background: #22a861;
}


.vorik-search-gps-button svg {
    width: 21px;
    height: 21px;
}


/* ============================================================
   FOOTER
   ============================================================ */

.vorik-search-sheet-footer--premium {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 9px;
}


.vorik-search-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 48px;

    padding:
        0 15px;

    border:
        1px solid #dfe6ee;

    border-radius: 14px;

    color: #10284d;
    background: #ffffff;

    cursor: pointer;

    font-size: 14px;
    font-weight: 800;
}


.vorik-search-filter-button svg {
    width: 19px;
    height: 19px;
}


@media (max-width: 380px) {

    .vorik-search-filter-button {
        width: 48px;

        padding: 0;
    }


    .vorik-search-filter-button span {
        display: none;
    }

}


/* ============================================================
   VORIK SEARCH INTERACTION FIX
   ============================================================ */


/* Destination must remain a single compact horizontal row. */

.vorik-search-sheet-control {
    display: flex;

    align-items: center;

    min-width: 0;

    gap: 8px;
}


.vorik-search-sheet-control
[data-vorik-search-location-input] {
    flex: 1 1 auto;

    width: 0;
    min-width: 0;

    height: 48px;

    border: 0;

    background: transparent;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/*
 * Keep the old decorative location icon compact.
 */

.vorik-search-sheet-control-icon {
    flex: 0 0 auto;
}


/*
 * GPS is an action, not part of the text input.
 */

.vorik-search-gps-button {
    flex: 0 0 42px;
}


/* ============================================================
   DATE CONTROLS
   ============================================================ */

.vorik-date-control {
    cursor: pointer;
}


.vorik-date-control input[type="date"] {
    flex: 1 1 auto;

    width: 0;
    min-width: 0;

    cursor: pointer;
}


/*
 * Native calendar remains available.
 */

.vorik-date-control
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}


/* ============================================================
   FOOTER ACTIONS
   ============================================================ */

.vorik-search-sheet-footer--premium {
    position: relative;

    z-index: 3;
}



/* ============================================================
   VORIK RENTAL CITY SEARCH
   ============================================================ */


.vorik-rental-location-section {
    position: relative;

    overflow: visible;
}


.vorik-rental-city-control {
    position: relative;

    overflow: visible;
}


.vorik-rental-city-control
.vorik-city-autocomplete {
    position: relative;

    flex: 1 1 auto;

    min-width: 0;
}


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

    min-width: 0;

    border: 0;

    outline: 0;

    background: transparent;

    font: inherit;

    color: inherit;
}


/* ============================================================
   DESTINATION ICON
   ============================================================ */

.vorik-rental-destination-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    border-radius: 12px;

    color: #16345f;

    background: #f3f6f9;
}


.vorik-rental-destination-icon svg {
    width: 20px;
    height: 20px;
}


/* ============================================================
   CITY DROPDOWN
   ============================================================ */

.vorik-rental-city-control
.vorik-city-autocomplete__dropdown {
    position: absolute;

    z-index: 50;

    top:
        calc(100% + 8px);

    left: 0;

    width: 100%;

    max-height: 280px;

    overflow-y: auto;

    border:
        1px solid #e2e8f0;

    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 16px 42px
        rgba(15, 35, 65, .15);
}


.vorik-rental-city-control
.vorik-city-autocomplete__status {
    padding:
        14px 15px;

    color: #64748b;

    font-size: 13px;
}


.vorik-rental-city-control
.vorik-city-autocomplete__list {
    display: flex;

    flex-direction: column;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option {
    display: grid;

    grid-template-columns:
        34px
        minmax(0, 1fr);

    gap: 9px;

    width: 100%;

    padding:
        11px 12px;

    border: 0;
    border-bottom:
        1px solid #eef2f6;

    text-align: left;

    color: #142f55;
    background: #ffffff;

    cursor: pointer;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option:last-child {
    border-bottom: 0;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option:hover,
.vorik-rental-city-control
.vorik-city-autocomplete__option.is-active {
    background: #f7f9fc;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border-radius: 10px;

    color: #17375e;

    background: #fff1a8;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option-content {
    display: flex;

    flex-direction: column;

    justify-content: center;

    min-width: 0;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option-content strong {
    overflow: hidden;

    font-size: 14px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option-content small {
    margin-top: 2px;

    color: #718096;

    font-size: 11px;
}


.vorik-rental-city-control
.vorik-city-autocomplete__option-arrow {
    display: none;
}


/* Keep dropdown above following fields. */

.vorik-rental-location-section:has(
    .vorik-city-autocomplete.is-open
) {
    z-index: 20;
}


@media (max-width: 640px) {

    .vorik-rental-city-control
    .vorik-city-autocomplete__dropdown {
        max-height: 230px;
    }

}


/* ============================================================
   VORIK SEARCH SHEET FULLSCREEN MOBILE
   ============================================================ */

@media (max-width: 640px) {

    [data-vorik-search-sheet] {
        position: fixed;

        inset: 0;

        width: 100%;
        height: 100dvh;

        max-width: none;
        max-height: none;

        margin: 0;

        z-index: 1200;

        background: #ffffff;

        overflow-y: auto;
        overflow-x: hidden;

        overscroll-behavior: contain;

        transform: translateY(100%);

        transition:
            transform .28s ease;
    }


    [data-vorik-search-sheet].is-open {
        transform: translateY(0);
    }


    /*
     * Search content must fully cover
     * the vehicle catalogue underneath.
     */
    [data-vorik-search-sheet]
    .vorik-search-sheet-panel,
    [data-vorik-search-sheet]
    .vorik-search-sheet-content {
        width: 100%;

        min-height: 100dvh;

        background: #ffffff;
    }


    /*
     * Keep actions available near
     * the bottom of the search flow.
     */
    [data-vorik-search-sheet]
    .vorik-search-sheet-footer {
        position: sticky;

        bottom: 0;

        z-index: 30;

        margin-top: auto;

        padding-bottom:
            calc(
                14px
                + env(safe-area-inset-bottom)
            );

        background:
            linear-gradient(
                to top,
                #ffffff 82%,
                rgba(255,255,255,.96)
            );
    }


    /*
     * Lock the catalogue while
     * the search sheet is open.
     */
    body.vorik-search-sheet-open {
        overflow: hidden;

        touch-action: none;
    }

}
