/* OmniVenta ERP V62.7 - form/select alignment safeguards.
 * Keeps legacy Select2 v3 controls aligned with Bootstrap 3 form fields.
 * This is presentation-only; no Sales/Receiving scan behavior is changed.
 */

/*
 * Select2 v3 copies classes from its source element to the generated
 * .select2-container. If the source carries .form-control, Bootstrap styles
 * the OUTER container while Select2 also styles .select2-choice, producing a
 * visible double box and an inset/misaligned control. Neutralize only the
 * accidental outer Bootstrap shell and keep the actual Select2 choice styled.
 */
body.ov-responsive .select2-container.form-control {
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.ov-responsive .select2-container.form-control:focus,
body.ov-responsive .select2-container.form-control.select2-container-active {
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
}

/* Keep Select2 flush with sibling Bootstrap controls inside horizontal forms. */
body.ov-responsive .form-horizontal .form-group > [class*="col-"] > .select2-container {
  margin-left:0!important;
  margin-right:0!important;
  vertical-align:middle!important;
}

/* Bootstrap input-groups must remain table cells; the older global 100% Select2
 * rule is useful generally but display:block can push these controls out of line.
 */
body.ov-responsive .input-group > .select2-container {
  display:table-cell!important;
  position:relative!important;
  z-index:2;
  float:left;
  width:100%!important;
  margin-bottom:0!important;
  vertical-align:middle!important;
}
body.ov-responsive .input-group > .select2-container .select2-choice,
body.ov-responsive .input-group > .select2-container-multi .select2-choices {
  border-top-left-radius:0!important;
  border-bottom-left-radius:0!important;
}

/* A single-select should occupy the column itself, not add a second inset box. */
body.ov-responsive .form-group .select2-container .select2-choice {
  margin:0!important;
}

@media(max-width:767px){
  body.ov-responsive .form-horizontal .form-group > [class*="col-"] > .select2-container {
    width:100%!important;
    max-width:100%!important;
  }
}
