/* Select pickers */

/* ---------- the wrapper ---------- */
.bootstrap-select {
    border: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.bootstrap-select.select-picker-hidden {
    display: none !important;
}

/* ---------- the field ---------- */
.bootstrap-select > .dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 6px;
    text-align: left;
    background: var(--surface) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--r-sm) !important;
    box-shadow: none !important;
    color: var(--text) !important;
    font-weight: 500;
    line-height: 1.3;
}

.bootstrap-select > .dropdown-toggle:hover {
    border-color: var(--faint) !important;
}

.bootstrap-select > .dropdown-toggle:focus-visible,
.bootstrap-select.show > .dropdown-toggle {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-ring) !important;
    outline: 0 !important;
}

.bootstrap-select > .dropdown-toggle:is(.disabled, :disabled) {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--surface-3) !important;
}

.bootstrap-select > .dropdown-toggle .filter-option {
    position: static !important;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 24px;
    height: auto !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.bootstrap-select > .dropdown-toggle .filter-option-inner {
    min-width: 0;
}

.bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
    color: var(--muted) !important;
}

/* ---------- the open list ---------- */
/* under the field, same width */
.bootstrap-select > .dropdown-menu {
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 2px;
    width: 100%;
    min-width: 100% !important;
    max-width: 100%;
}

/* list above the field when there is no room below */
.bootstrap-select.select-picker-up > .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 2px;
}

.bootstrap-select > .dropdown-menu.show {
    max-height: min(320px, 40vh) !important;
    display: flex !important;
    flex-direction: column;
}

.bootstrap-select > .dropdown-menu.show > * {
    flex: none;
}

.bootstrap-select > .dropdown-menu.show > .inner {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
}

/* inner option list: no second box */
.bootstrap-select .dropdown-menu.inner {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: none;
}

.bootstrap-select .dropdown-menu li a,
.bootstrap-select .dropdown-menu li a span.text {
    color: var(--text-2) !important;
    white-space: normal;
}

.bootstrap-select .dropdown-menu li.selected a,
.bootstrap-select .dropdown-menu li.active a,
.bootstrap-select .dropdown-menu li a:hover {
    background: var(--accent-soft) !important;
    color: var(--accent-ink) !important;
}

.bootstrap-select .dropdown-menu li.selected a span.text,
.bootstrap-select .dropdown-menu li a:hover span.text {
    color: var(--accent-ink) !important;
}

.bootstrap-select .bs-searchbox .form-control {
    background: var(--surface-2) !important;
    font-size: 13px !important;
}

/* picker inside another dropdown */
.bs-container.bootstrap-select {
    width: auto !important;
    margin: 0;
}

.bs-container.bootstrap-select > .dropdown-menu {
    width: max-content;
    max-width: min(420px, calc(100vw - 24px));
}

/* ---------- size from the replaced select ---------- */
html body select.select-picker-original {
    display: none !important;
}

html body div.bootstrap-select.select-picker-styled {
    width: var(--select-picker-w, auto) !important;
    max-width: 100%;
    margin: var(--select-picker-mt, 0) var(--select-picker-mr, 0) var(--select-picker-mb, 0) var(--select-picker-ml, 0);
    vertical-align: middle;
}

html body div.bootstrap-select.select-picker-styled.select-picker-full {
    width: 100% !important;
}

html body div.bootstrap-select.select-picker-styled.select-picker-flex {
    flex: var(--select-picker-flex);
    min-width: 0;
}

html body div.bootstrap-select.select-picker-styled > .dropdown-toggle {
    width: 100%;
    height: var(--select-picker-h, 36px);
    min-height: 0;
    padding: 0 12px !important;
    font-size: var(--select-picker-fs, 13px) !important;
}
