/* Searchable dropdown widget rendered by App/Directives/SearchableSelect.js.
   The native <select> stays in the DOM (hidden) as the source of truth. */

.stm-searchable-select {
    display: none;
    position: relative;
}

.stm-searchable-select.stm-enhanced {
    display: block;
}

/* Visually hidden but still "visible" to jQuery validation (1px, clipped) */
select.stm-searchable-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    clip: rect(0 0 0 0);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* The toggle carries .form-control so it inherits the app's native select
   styling (theme, focus glow, disabled greying); these rules only cover
   what a <button> needs on top of that. */
.stm-searchable-select-toggle {
    text-align: left;
    position: relative;
    padding-right: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

.stm-searchable-select-toggle[disabled] {
    cursor: not-allowed;
}

.stm-searchable-select-toggle .caret {
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -2px;
    color: #333;
}

.stm-searchable-select-toggle.stm-placeholder .stm-searchable-select-label {
    color: #999;
}

.stm-searchable-select-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    margin-top: 2px;
    padding: 4px;
}

.stm-searchable-select.open .stm-searchable-select-menu {
    display: block;
}

.stm-searchable-select-search {
    padding: 2px 4px 6px;
}

.stm-searchable-select-options {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.stm-searchable-select-options li > a {
    display: block;
    padding: 4px 10px;
    color: #333;
    text-decoration: none;
    white-space: normal;
}

.stm-searchable-select-options li > a:hover,
.stm-searchable-select-options li > a:focus {
    background-color: #f5f5f5;
}

.stm-searchable-select-options li.disabled > a {
    color: #999;
    cursor: not-allowed;
}

.stm-searchable-select-options li.disabled > a:hover {
    background-color: transparent;
}

.stm-searchable-select-group {
    padding: 4px 6px;
    font-weight: bold;
    color: #777;
    font-size: 12px;
}
