/* TomSelect Bootstrap 4 look-and-feel (opt-in via `select.tom-bs4`). */

/* Hide the original <select> visually (keep it in DOM, no layout space). */
select.tom-bs4,
select.tom-bs4.ts-hidden-accessible,
select.tom-bs4.tomselected {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

select.tom-bs4 + .ts-wrapper {
  width: 100%;
  margin-top: 0;
}

select.tom-bs4 + .ts-wrapper .ts-control {
  width: 100%;
  min-height: calc(1.5em + 0.75rem + 2px); /* Bootstrap 4 .form-control */
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background-color: #fff;
  background-clip: padding-box;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  box-sizing: border-box;
  line-height: 1.5;
  font-size: 1rem;
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

select.tom-bs4 + .ts-wrapper.focus .ts-control,
select.tom-bs4 + .ts-wrapper .ts-control:focus-within {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: 0;
}

select.tom-bs4 + .ts-wrapper.single .ts-control {
  gap: 0.25rem;
}

select.tom-bs4 + .ts-wrapper.single .ts-control .item {
  line-height: 1.5;
  margin: 0;
  padding: 0;
  max-width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select.tom-bs4 + .ts-wrapper.single .ts-control .item + input {
  flex: 1 1 auto !important;
}

select.tom-bs4 + .ts-wrapper .ts-control input {
  margin: 0;
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
  width: 100% !important;
  padding: 0;
  font-size: 1rem;
}

select.tom-bs4 + .ts-wrapper .ts-dropdown {
  width: 100%;
}

