/** =========================
 *  Base
 *  ========================= */
#xyorderbyref_form {
  width: 100%;
  max-width: 100%;
}

.xy-hidden-text {
  display: none !important;
}

/* IMPORTANT : cache la ligne clone */
.cloneParent {
  display: none !important;
}

.table-body-orderbyref .ref_row.cloneParent {
  display: none !important;
}

#xy_table-orderbyref {
  width: 100%;
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 1.25rem;
}

.xyorderbyref_select_reference,
.typeahead__container,
.typeahead__field,
.typeahead__query {
  width: 100%;
}

.xyorderbyref_product_name {
  display: block;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.xyorderbyref_price {
  display: block;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

/* Labels mobile cachés par défaut */
.xy-mobile-label {
  display: none;
}

.form-control[readonly] {
  background-color: #f6f6f6;
  opacity: 1;
}

.xyorderbyref-actions {
  margin-top: 1.5rem;
  text-align: left;
}

.xyorderbyref-actions .btn {
  min-width: 180px;
}

/** =========================
 *  Delete button
 *  ========================= */
.xyorderbyref-delete-btn {
  border: 0;
  background: transparent;
  padding: 0.25rem;
  line-height: 1;
  cursor: pointer;
}

.xyorderbyref-delete-btn:hover {
  opacity: 0.75;
}

.xyorderbyref-delete-btn:focus {
  outline: none;
  box-shadow: none;
}

.xyorderbyref-delete-row {
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

/** =========================
 *  Typeahead
 *  ========================= */
.typeahead__dropdown .typeahead__dropdown-item:not([disabled]).active > a,
.typeahead__dropdown .typeahead__dropdown-item:not([disabled]) > a:focus,
.typeahead__dropdown .typeahead__dropdown-item:not([disabled]) > a:hover,
.typeahead__list .typeahead__item:not([disabled]).active > a,
.typeahead__list .typeahead__item:not([disabled]) > a:focus,
.typeahead__list .typeahead__item:not([disabled]) > a:hover {
  background-color: #2fb5d2;
  color: #ffffff;
}

/** =========================
 *  Header desktop
 *  ========================= */
.table-thead-orderbyref {
  margin-bottom: 0;
}

.table-thead-orderbyref > .row {
  margin: 0;
  padding: 0 0 0.85rem 0;
  border-bottom: 2px solid #efefef;
  font-weight: 700;
  color: #111;
  align-items: center;
}

.xy-head-line,
.xy-head-reference,
.xy-head-product,
.xy-head-qty,
.xy-head-price,
.xy-head-remove {
  text-align: center;
}

/** =========================
 *  Body desktop
 *  ========================= */
.table-body-orderbyref .ref_row {
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f1f1;
  align-items: center;
}

.table-body-orderbyref .ref_row:last-child {
  border-bottom: 0;
}

.row_number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #444;
}

.xyorderbyref-inner-row {
  align-items: center;
}

.col-reference {
  text-align: left;
}

.col-product-name {
  text-align: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

.col-quantity,
.col-price,
.col-remove {
  text-align: center;
}

.col-remove {
  display: flex;
  align-items: center;
  justify-content: center;
}

.xyorderbyref_product_qty {
  max-width: 72px;
  margin: 0 auto;
  text-align: center;
}

/** =========================
 *  Mobile / tablet
 *  ========================= */
@media (max-width: 991.98px) {
  #xy_table-orderbyref {
    padding: 1rem;
  }

  .table-thead-orderbyref {
    display: none;
  }

  .table-body-orderbyref .ref_row {
    position: relative;
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    background: #fff;
  }

  .table-body-orderbyref .ref_row > .row_number,
  .table-body-orderbyref .ref_row > .col-12,
  .table-body-orderbyref .ref_row > .col-md-1,
  .table-body-orderbyref .ref_row > .col-md-10,
  .table-body-orderbyref .ref_row > .col-remove {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
  }

  .table-body-orderbyref .ref_row > .row_number {
    display: block;
    margin-bottom: 0.75rem;
    text-align: left;
    font-size: 0.95rem;
  }

  .table-body-orderbyref .ref_row > .row_number::before {
    content: "Ligne ";
    font-weight: 600;
  }

  .xyorderbyref-inner-row {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-right: 2.5rem;
  }

  .xyorderbyref-inner-row > .col-12,
  .xyorderbyref-inner-row > .col-sm-6,
  .xyorderbyref-inner-row > .col-md-4,
  .xyorderbyref-inner-row > .col-md-3,
  .xyorderbyref-inner-row > .col-md-2,
  .xyorderbyref-inner-row > .col-md-1,
  .xyorderbyref-inner-row > .col-lg-4,
  .xyorderbyref-inner-row > .col-lg-2,
  .xyorderbyref-inner-row > .col-lg-1 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
    margin-bottom: 0.9rem;
    text-align: left !important;
  }

  .xyorderbyref-inner-row > .col-price {
    margin-bottom: 0;
  }

  .xy-mobile-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #444;
  }

  .xyorderbyref_product_qty {
    max-width: 110px;
    margin: 0;
    text-align: center;
  }

  .table-body-orderbyref .col-remove {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: auto;
    max-width: none;
    flex: none;
    margin: 0;
    padding: 0;
  }

  .xyorderbyref-delete-row {
    font-size: 20px;
  }

  .xyorderbyref-actions .btn {
    width: 100%;
    max-width: 260px;
  }
}