/* The header and item rows share exact quantity and stock columns. */
.order-products-section { --order-pick-columns: 40px minmax(0, 1fr) 60px 60px 72px; }
.order-products-section > .section-head {
  display: grid;
  grid-template-columns: var(--order-pick-columns);
  column-gap: 10px;
  align-items: center;
  padding-inline: 7px 9px;
}
.order-products-section > .section-head > h3 { grid-column: 1 / 3; margin: 0; }
.order-products-section .order-product-heading-actions { display: contents; }
.order-products-section .order-product-heading-actions > .order-pick-count-attention {
  grid-column: 3;
  justify-self: stretch;
  box-sizing: border-box;
  min-width: 0;
  width: 60px;
  height: 25px;
  padding: 0 6px !important;
  font-size: 11px !important;
  line-height: 16px;
}
.order-products-section .order-product-heading-actions > button {
  grid-column: 4 / 6;
  justify-self: end;
  max-width: 100%;
}
.order-product-stock-row {
  display: grid;
  grid-template-columns: var(--order-pick-columns) !important;
  align-items: center;
  column-gap: 10px;
}

/* Ordered quantity and physical stock use the same compact badge geometry. */
.order-modal-window .order-product-stock-row .product-icon { grid-column: 1 !important; grid-row: 1 !important; }
.order-modal-window .order-product-stock-row .product-copy { grid-column: 2 !important; grid-row: 1 !important; }
.order-modal-window .order-product-stock-row .product-quantity {
  min-width: 0 !important;
  grid-column-start: 3 !important;
  grid-column-end: auto !important;
  background: rgb(234, 241, 255) !important;
  color: rgb(55, 105, 218) !important;
  border: 1px dashed #3769da;
  white-space: nowrap;
}
.order-product-stock-row .crm-stock { grid-column: 4 !important; grid-row: 1; justify-self: center; transform: translateX(16px); }
.order-product-stock-row > b { grid-column: 5 !important; grid-row: 1; }

/* One physical CRM balance; ordered quantity is not a second stock contour. */
.order-modal-window .order-product-stock-row .product-quantity,
.order-modal-window .order-product-stock-row .order-line-stock {
  position: relative !important;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 60px;
  min-width: 0;
  height: 25px;
  min-height: 25px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}
.order-modal-window .order-product-stock-row .order-line-stock small {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 12px;
  text-transform: none;
  white-space: nowrap;
}
.order-modal-window .order-product-stock-row .order-line-stock small { display: block !important; }
.order-product-stock-row .order-line-stock {
  border: 1px solid var(--border);
  background: var(--surface); text-align: center;
}
.order-modal-window .order-product-stock-row .order-line-stock > b { color: inherit; font-size: 10px; line-height: 16px; font-weight: 600; }
.order-products-section .order-product-heading-actions > .checkout-complete-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding-inline: 8px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.order-products-section .checkout-complete-chip > span { min-width: 0; font-size: 10px; font-weight: 500; }
.order-modal-window .order-product-stock-row .stock-warning { color: #c46608; border-color: #edbc7e; background: #fff7eb; }
.order-modal-window .order-product-stock-row .stock-critical { color: #d72d49; border-color: #efa3b1; background: #fff1f4; }
:root[data-theme=dark] .order-modal-window .order-product-stock-row .stock-warning { color: #ffbd6b; border-color: #80572e; background: #33271c; }
:root[data-theme=dark] .order-modal-window .order-product-stock-row .stock-critical { color: #ff8da0; border-color: #854354; background: #351e27; }
