/**
 * Compatibility layer: bootstrap-multiselect v2 (Bootstrap 5 markup)
 * styled to match the existing Merchant Portal Bootstrap 3 look.
 * Do not load full Bootstrap 5 CSS — it breaks portal layout.
 */

/* BS5 dropdown uses .show; BS3 CSS only opens on .open */
.btn-group.show > .multiselect-container.dropdown-menu,
.multiselect-container.dropdown-menu.show {
  display: block;
}

/* Text alignment utilities used by v2 (no BS5 utilities loaded) */
.multiselect.text-start {
  text-align: left;
}
.multiselect.text-center {
  text-align: center;
}
.multiselect.text-end {
  text-align: right;
}

/* Toggle button — match previous btn btn-default multiselect */
.btn-group > .multiselect.dropdown-toggle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-group > .multiselect.dropdown-toggle .caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* BS5 uses .show instead of BS3 .open for the open button state */
.btn-group.show > .dropdown-toggle.btn-default {
  color: #333333;
  background-color: #ebebeb;
  border-color: #adadad;
  background-image: none;
}

/* Dropdown panel */
.multiselect-container.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 2000;
  float: left;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  font-size: 14px;
  background-color: #fff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  background-clip: padding-box;
}

/* Option rows (were li > a > label) */
.multiselect-container .multiselect-option,
.multiselect-container .multiselect-group,
.multiselect-container .multiselect-all {
  padding: 0 !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  background: transparent;
  color: #333;
  box-shadow: none;
  display: block;
  clear: both;
  font-weight: normal;
  line-height: 1.42857143;
  cursor: pointer;
}

.multiselect-container .multiselect-option:hover,
.multiselect-container .multiselect-group:hover,
.multiselect-container .multiselect-all:hover,
.multiselect-container .multiselect-option:focus,
.multiselect-container .multiselect-group:focus,
.multiselect-container .multiselect-all:focus,
.multiselect-container .multiselect-option.active,
.multiselect-container .multiselect-group.active,
.multiselect-container .multiselect-all.active,
.multiselect-container .multiselect-option.multiselect-selected,
.multiselect-container .multiselect-all.multiselect-selected {
  background-color: #f5f5f5 !important;
  color: #262626 !important;
  outline: none;
}

.multiselect-container .multiselect-option.disabled,
.multiselect-container .multiselect-all.disabled {
  color: #999;
  cursor: not-allowed;
  pointer-events: none;
}

/* Checkbox / label layout matching old plugin CSS */
.multiselect-container .form-check {
  display: block;
  position: relative;
  padding: 3px 20px 3px 40px !important;
  margin: 0 !important;
  min-height: 0;
  text-align: left;
}

.multiselect-container .form-check-input {
  float: left;
  margin: 4px 0 0 -20px !important;
  position: static !important;
  width: auto;
  height: auto;
  vertical-align: middle;
}

.multiselect-container .form-check-label {
  display: inline;
  margin: 0;
  padding: 0;
  font-weight: 400;
  cursor: pointer;
  line-height: inherit;
}

.multiselect-container .multiselect-all .form-check-label,
.multiselect-container .multiselect-all .font-weight-bold {
  font-weight: 700;
}

.multiselect-container .dropdown-divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;
  border: 0;
}

/* Filter row when enabled */
.multiselect-container .multiselect-filter {
  padding: 5px 10px;
}
.multiselect-container .multiselect-filter .multiselect-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Readonly pattern used in portal popups */
.markedReadonly + .btn-group {
  pointer-events: none;
  opacity: 0.85;
}
