/* Store Ordering (.ui-spec/docs/prototype/styles.css, the so- rules there,
   renamed cp-so-). */

/* The catalog and cart: two scroll areas side by side under the controls band,
   each scrolling on its own, so the cart stays in view without being sticky.
   They fill what is left of the list page's height, and the negative margins
   cancel the section's p-4 so they run edge to edge, under the band, as the
   prototype's .cp-list-split does. */
.cp-so-split {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0 -1.5rem -1.5rem;
}

.cp-so-split-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  padding: 1.5rem;
}

.cp-so-split-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 0;
  padding: 1.5rem;
  border-left: 1px solid var(--bs-border-color);
}

/* Compact text tiles, no imagery (the prototype's 2026-08-13 note). */
.cp-supply-card {
  width: 320px;
}

.cp-so-tile-qty {
  width: 110px;
}

.cp-so-search {
  max-width: 280px;
}

/* The line list takes what is left of the column and scrolls on its own, so
   the store and Submit Order never leave the screen. */
.cp-so-cart {
  width: 320px;
  overflow: hidden;

  & .cp-so-cart-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

.cp-so-cart-line {
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--bs-border-color);

  &:last-child {
    border-bottom: 0;
  }
}

.cp-so-cart-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.cp-so-cart-qty {
  flex: 0 0 64px;
  width: 64px;
}

/* A catalog flag is information, not a block: quiet unless it is about
   availability. */
.cp-so-flag {
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.cp-so-flag-stock {
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
}

/* Stacked on a narrow screen: the cart under the catalog. */
@media (width < 768px) {
  .cp-so-split {
    flex-direction: column;
  }

  .cp-so-split-side {
    border-top: 1px solid var(--bs-border-color);
    border-left: 0;
  }

  .cp-so-cart {
    width: auto;
  }
}

/* The orders list. A just-submitted order is highlighted; a cancelled one
   stays as a record, muted so it doesn't read as work to do (its status
   cell keeps its colour). Division chips are neutral: not a status. */
.cp-so-row-new > td {
  background: var(--bs-success-bg-subtle) !important;
}

.cp-so-row-cancelled > td:not(.cp-so-status-cell) {
  color: var(--bs-secondary-color);
}

.cp-so-div {
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-weight: 500;
}

/* The pick list: each printed page is its own sheet on screen too, stacked
   with the gap a print preview shows. */
.cp-so-sheets {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cp-so-sheet-division {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.cp-so-sheet-meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.1rem 1rem;
  margin: 0;

  & dt {
    color: var(--bs-secondary-color);
    font-weight: 400;
    text-align: right;
  }

  & dd {
    margin: 0;
  }
}

.cp-so-tick {
  width: 22px;
}

.cp-so-tick-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentcolor;
  border-radius: 2px;
}

.cp-so-sheet-foot {
  margin-top: 0.75rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}
