/* Searchable select — styling for assets/js/searchable-select.js */

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

/* The real <select> stays in the form but is visually hidden.
   It is kept focusable-adjacent so browser `required` validation
   still points at the right place. */
.ss-wrap .ss-native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 1px;
    width: 1px;
    bottom: 0;
    left: 12px;
}

.ss-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 38px 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: #243044;
    background: #fff;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ss-toggle:hover  { border-color: #b9c3d2; }
.ss-toggle:focus  { outline: none; border-color: #2f80ed; box-shadow: 0 0 0 3px rgba(47,128,237,.15); }
.ss-toggle.is-placeholder { color: #98a2b3; }

.ss-toggle::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #8b96a8;
    border-bottom: 2px solid #8b96a8;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.ss-wrap.is-open .ss-toggle::after { transform: translateY(-25%) rotate(-135deg); }
.ss-wrap.is-open .ss-toggle { border-color: #2f80ed; box-shadow: 0 0 0 3px rgba(47,128,237,.15); }

.ss-panel {
    display: none;
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d7dde7;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(20, 30, 50, .14);
    overflow: hidden;
}

.ss-wrap.is-open .ss-panel { display: block; }

.ss-search {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eceff4;
    padding: 12px 14px;
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    background: #fbfcfe;
}

.ss-list {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ss-item {
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .94rem;
    color: #243044;
}

.ss-item:hover,
.ss-item.is-active { background: #eef4fe; }

.ss-item.is-selected {
    background: #2f80ed;
    color: #fff;
    font-weight: 500;
}

.ss-empty {
    padding: 16px 14px;
    color: #8b96a8;
    font-size: .92rem;
    text-align: center;
}

/* Sit comfortably inside the existing .form-group / .phone-input layouts */
.form-group .ss-wrap { margin-top: 0; }

@media (max-width: 600px) {
    .ss-list { max-height: 45vh; }
}

/* Inline validation message (the component handles `required` itself) */
.ss-error {
    color: #d64545;
    font-size: .85rem;
    margin-top: 6px;
}

.ss-wrap.has-error .ss-toggle {
    border-color: #d64545;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, .12);
}
