/*
 * The QUICK layout of the sale screen (POS-UX1): retail, barcode first — a scan field, a LIST cart that fills the
 * screen, and on the side the amount due, a numeric keypad and three big ways to pay. Tokens only (tokens.css);
 * the base of the screen (panels, toolbar, toast) is sale.css. On a phone the keypad goes: the cart's − and +
 * and the three ways to pay are what is left, one panel, no tabs.
 */

.sale--quick {
  display: flex;
  flex-direction: column;
}
.sale__quick {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.quick__main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(19rem, 33vw, 26.25rem);
  gap: var(--gap);
}
.quick__cart {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.qhead,
.qrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem 4.5rem 5rem 6rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}
.qhead {
  min-height: 2.5rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.quick__rows {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.qrow {
  grid-template-areas: 'name qty price total disc';
  padding-block: 0.45rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.qrow--sel {
  background: var(--accent-soft);
  box-shadow: inset 0.25rem 0 0 var(--accent);
}
.qrow__name {
  grid-area: name;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.qrow__name small {
  color: var(--ink-soft);
}
.qrow .qty {
  grid-area: qty;
}
.qrow__price {
  grid-area: price;
}
.qrow__total {
  grid-area: total;
  font-weight: 700;
}
.qrow__disc {
  grid-area: disc;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
  font-size: 0.85rem;
}
.qrow__disc:empty {
  display: none;
}
.quick__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.quick__results {
  position: absolute;
  inset-block: 2.5rem 3rem;
  inset-inline: 0;
  z-index: 5;
  overflow: auto;
  background: var(--surface);
  border-block: 1px solid var(--line-strong);
}
.quick__results-close {
  display: block;
  margin-inline-start: auto;
}
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.result:disabled {
  opacity: 0.5;
}
.result__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.result__sku {
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.result__price {
  font-weight: 700;
}
.quick__side {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: auto;
}
.quick__due {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--bg);
}
/* r42a M5: the label only (`>`): the spans inside the amount (`.amt`, `.cur`) used to inherit this and the due amount
   showed as a 14px figure with its currency on a line of its own. */
.quick__due > span {
  display: block;
  font-size: 0.9rem;
}
.quick__due strong {
  font-size: 2.6rem;
  line-height: 1.15;
}
.quick__due strong .amt {
  white-space: nowrap;
}
.quick__due strong .cur {
  font-size: 1.1rem;
}
.quick__due small {
  font-size: 1.1rem;
}
.quick__entry {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.quick__entry output {
  min-width: 3rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.quick__entry small {
  color: var(--ink-soft);
}
.quick__tender {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}
.btn--tender {
  margin: 0;
  min-height: var(--tap-pay);
  padding: 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.btn--tender-main {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.quick__tender .btn--tender:nth-child(2) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.quick__sec {
  display: flex;
  gap: 0.5rem;
}
.quick__sec .btn {
  flex: 1;
  margin: 0;
  padding: 0 0.5rem;
}

@media (max-width: 30rem) {
  .quick__main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .sale--quick .keypad,
  .quick__entry {
    display: none;
  }
  .quick__due strong {
    font-size: 1.8rem;
  }
  .quick__side {
    overflow: visible;
  }
  .qhead {
    display: none;
  }
  .qrow {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      'name qty total'
      'disc disc disc';
  }
  .qrow__price {
    display: none;
  }
  .quick__results {
    inset-block-start: 0;
  }
}
