/*
 * bootstrap-select adjustments (loaded globally from BootstrapDefault::initAssets).
 * Keep the dropdown inside its field instead of growing to the longest option, and wrap long
 * labels (dealer names) onto several lines. Virtual scrolling is disabled in
 * assets/js/custom/bootstrap-select-init.js because it assumes uniform item heights.
 */
.bootstrap-select .dropdown-menu {
    max-width: 100%;
}

/* On desktop let the menu be a bit wider than a narrow field so long labels stay readable */
@media (min-width: 992px) {
    .bootstrap-select .dropdown-menu {
        min-width: 320px;
        max-width: max(100%, 320px);
    }
}

/*
 * Safari computes the inner list's width as 0 when a menu is reopened, so its content was either
 * clipped (blank list until a scroll forced a relayout) or, once labels may wrap, broken one
 * character per line. Pinning the width to the menu avoids both.
 */
.bootstrap-select .dropdown-menu ul.inner {
    width: 100% !important;
}

.bootstrap-select .dropdown-menu li a.dropdown-item {
    white-space: normal;
    width: 100%;
}

.bootstrap-select .dropdown-menu li a.dropdown-item .text {
    display: inline;
}

.bootstrap-select .bs-actionsbox .btn {
    white-space: nowrap;
}
