/* "Visa" search tab (web + PWA): country → application type → visa type.
   Web: the shared search-bar markup (.input-area / .sb-where / .sb-date /
   .sb-complate, web/ui/search_bar.css); only the two dropdown buttons, the
   country flag/clear and the option lists live here. PWA: the shared .zfld
   field language (see the eSIM PWA bar). */

#evisa-search-form {
    --evf-red: var(--secondary-color, #db2e1c);
    --evf-ink: #1c1c24;
    --evf-muted: #8a8f98;
    --evf-line: #ececef;
    --evf-soft: #f4f4f6;
    --evf-tint: #fce9e7;
    width: 100%;
    display: flex;
    flex-direction: column;
    color: var(--evf-ink);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

#evisa-search-form [x-cloak] {
    display: none !important;
}

/* ------------------------------------------------------------------ web */

#evisa-search-form .sb-where {
    width: 34%;
}

#evisa-search-form .sb-date {
    width: 24%;
}

#evisa-search-form .sb-complate {
    width: 18%;
}

/* The shared rules turn pointer events off on everything but the input in a
   field column (they open pickers elsewhere); this tab handles its own. */
#evisa-search-form .ev-sb-cell > * {
    pointer-events: auto !important;
}

#evisa-search-form .ev-sb-cell .inputwhere.has-flag {
    padding-left: 46px;
}

#evisa-search-form .ev-sb-cell > .ev-flag {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 20;
    pointer-events: none !important;
    transform: translateY(-50%);
}

#evisa-search-form .ev-flag {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

#evisa-search-form .ev-finder-clear {
    position: absolute;
    top: 50%;
    right: calc(var(--search-form-input-gap, 25px) + 10px);
    z-index: 20;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: var(--evf-soft);
    color: var(--evf-muted);
    font-size: 11px;
    cursor: pointer;
}

/* Dropdown fields: the look of the shared text input next to them. */
#evisa-search-form .ev-sb-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: var(--search-form-input-height, 52px);
    padding: 0 var(--search-form-input-offset-horizontal, 14px);
    border: 1px solid #eaeaea;
    border-radius: 5px;
    background: #f8f8f8;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--sb-ink, #111827);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#evisa-search-form .ev-sb-select.is-empty {
    cursor: not-allowed;
}

#evisa-search-form .ev-sb-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#evisa-search-form .ev-sb-value.is-placeholder {
    color: var(--sb-placeholder, #9ca3af);
    font-weight: 500;
}

#evisa-search-form .ev-sb-chev {
    flex: none;
    width: 12px;
    height: auto;
    transition: transform 0.2s;
}

#evisa-search-form .ev-sb-select[aria-expanded="true"] .ev-sb-chev {
    transform: rotate(180deg);
}

.search-tab:has(.main_tabs, .home-card-tabs) #evisa-search-form .ev-sb-select {
    border-color: var(--sb-line);
    border-radius: var(--sb-radius);
    background: #fff;
}

.search-tab:has(.main_tabs, .home-card-tabs) #evisa-search-form .ev-sb-select:hover,
.search-tab:has(.main_tabs, .home-card-tabs) #evisa-search-form .ev-sb-select[aria-expanded="true"] {
    border-color: var(--sb-focus);
    box-shadow: 0 0 0 3px rgba(219, 46, 28, 0.1);
}

/* Option lists (web + PWA). */
#evisa-search-form .ev-finder-pop {
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    left: 0;
    min-width: calc(100% - var(--search-form-input-gap, 0px));
    width: max-content;
    max-width: min(380px, calc(100vw - 32px));
    max-height: 320px;
    overflow: auto;
    overscroll-behavior: contain;
    list-style: none;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--evf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(20, 22, 29, 0.16);
    text-align: left;
}

#evisa-search-form .ev-finder-pop li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--evf-ink);
    cursor: pointer;
}

#evisa-search-form .ev-finder-pop li i {
    width: 16px;
    color: var(--evf-muted);
    text-align: center;
}

#evisa-search-form .ev-finder-pop li.is-cursor,
#evisa-search-form .ev-finder-pop li:hover {
    background: var(--evf-soft);
}

#evisa-search-form .ev-finder-pop li.is-selected,
#evisa-search-form .ev-finder-pop li.is-selected i {
    background: var(--evf-tint);
    color: var(--evf-red);
}

#evisa-search-form .ev-finder-pop li small {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f0fc;
    color: #1f5fbf;
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 767.98px) {
    #evisa-search-form .input-area > .labels {
        display: none !important;
    }

    #evisa-search-form .input-area > .d-flex > div > .col {
        padding-right: 0;
        padding-left: 0;
    }

    #evisa-search-form .input-area > .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    #evisa-search-form .sb-where,
    #evisa-search-form .sb-date,
    #evisa-search-form .sb-complate {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

/* ------------------------------------------------------------------ PWA */

.ev-finder-pwa .ev-pf {
    position: relative;
}

.ev-finder-pwa .ev-pf-box {
    width: 100%;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.ev-finder-pwa .zfld-box.is-open {
    border-color: var(--evf-red);
}

/* The legacy PWA search bar CSS hides the raw inputs of a field (pickers
   show the value elsewhere); this one is typed into, so restore it (as the
   eSIM bar does for its destination input). */
.ev-finder-pwa .ev-pf-input {
    position: static !important;
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 26px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    opacity: 1 !important;
    font-family: inherit;
    font-size: 15px !important;
    font-weight: 600;
    color: var(--evf-ink) !important;
    -webkit-text-fill-color: var(--evf-ink);
}

.ev-finder-pwa .ev-pf-input::placeholder,
.ev-finder-pwa .ev-pf-value.is-placeholder {
    color: #9ca3af;
    font-weight: 500;
}

.ev-finder-pwa .ev-pf-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ev-finder-pwa .ev-pf-flag {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
}

.ev-finder-pwa .ev-pf-clear {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: var(--evf-soft);
    color: var(--evf-muted);
    font-size: 16px;
    line-height: 1;
}
