/**
 * Country selector with flags.
 *
 * Deliberately mirrors assets/css/phone-input.css so the country field and the
 * phone country-code field look like the same control. The native <select> is
 * kept in the DOM (it still holds the value and submits with the form) but
 * visually hidden once the widget takes over.
 */

.yatra-country-field {
    position: relative;
    display: block;
    width: 100%;
}

/* The original control still submits; it just stops being visible. */
.yatra-country-field .yatra-country-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.yatra-country-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    color: #111827;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yatra-country-trigger:hover {
    border-color: #9ca3af;
}

.yatra-country-field.is-open .yatra-country-trigger,
.yatra-country-trigger:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.yatra-country-flag {
    flex-shrink: 0;
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.yatra-country-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yatra-country-caret {
    flex-shrink: 0;
    color: #6b7280;
    transition: transform 0.15s ease;
}

.yatra-country-field.is-open .yatra-country-caret {
    transform: rotate(180deg);
}

.yatra-country-dropdown {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.yatra-country-field.is-open .yatra-country-dropdown {
    display: block;
}

.yatra-country-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.yatra-country-search {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
}

.yatra-country-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.yatra-country-list {
    max-height: 260px;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    list-style: none;
}

.yatra-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #111827;
}

.yatra-country-option:hover,
.yatra-country-option.is-active {
    background: #f3f4f6;
}

.yatra-country-option-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yatra-country-empty {
    padding: 12px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

/*
 * Deliberately no `prefers-color-scheme` block.
 *
 * The booking form has no dark styling of its own (booking.css / common.css
 * define none), so reacting to the visitor's OS theme here would drop a dark
 * dropdown into an otherwise white form. The phone widget only darkens when the
 * theme opts in via `.yatra-phone-dark`; if a dark variant is ever wanted here,
 * follow that pattern with a `.yatra-country-dark` opt-in class rather than
 * keying off the operating system.
 */
