/*
 * Searchable select styling.
 *
 * The field itself borrows the host theme's input classes (the script copies them from the
 * original <select>), so only the dropdown panel needs styling here. Its colours come from
 * CSS variables, which a dark page overrides — see the member signup form.
 */

.ss-wrap {
    position: relative;
    width: 100%;
}

/* The native select stays in the DOM — it is still the form value — just out of sight. */
.ss-wrap .ss-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: -1;
}

.ss-field {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    /* Room for the chevron, so a long country name never runs under it. */
    padding-right: 2rem !important;
    background-image: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-field::after {
    content: '';
    position: absolute;
    right: 0.85rem;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: 0.5;
    pointer-events: none;
}

.ss-field.ss-placeholder {
    opacity: 0.65;
}

.ss-panel {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    border-radius: 10px;
    padding: 0.4rem;
    background: var(--ss-bg, #ffffff);
    color: var(--ss-fg, inherit);
    border: 1px solid var(--ss-border, rgba(0, 0, 0, 0.15));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.ss-search {
    width: 100%;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.35rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: inherit;
    background: var(--ss-search-bg, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--ss-border, rgba(0, 0, 0, 0.15));
}

.ss-search:focus {
    outline: none;
    border-color: var(--ss-accent, #2dd4a8);
}

.ss-list {
    max-height: 15rem;
    overflow-y: auto;
}

.ss-item {
    padding: 0.42rem 0.6rem;
    border-radius: 7px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-item:hover {
    background: var(--ss-hover, rgba(0, 0, 0, 0.06));
}

.ss-item.ss-selected {
    background: var(--ss-selected, rgba(45, 212, 168, 0.16));
    font-weight: 600;
}

.ss-empty {
    padding: 0.6rem;
    font-size: 0.82rem;
    text-align: center;
    opacity: 0.7;
}
