/*
 * POS-UX3: the sale screen's menu navigation, the modifiers sheet, the quick pick, the options under a slip line and
 * the three-way order type (written by the sale-screen work; the back office's tree and modifier editors are
 * menu-editor.css). Every colour is a token, every direction a logical property, no size below a touch target.
 */

/* ---------------------------------------------------------------- the ten hue NAMES, over the numeric tokens */

.hue-amber {
  --h: var(--hue-0);
}
.hue-sea {
  --h: var(--hue-1);
}
.hue-green {
  --h: var(--hue-2);
}
.hue-rose {
  --h: var(--hue-3);
}
.hue-violet {
  --h: var(--hue-4);
}
.hue-slate {
  --h: var(--hue-5);
}
.hue-red {
  --h: var(--hue-6);
}
.hue-olive {
  --h: var(--hue-7);
}
.hue-gold {
  --h: var(--hue-8);
}
.hue-blue {
  --h: var(--hue-9);
}

/* ---------------------------------------------------------------- the menu navigation */

.menu-nav {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--s-2);
}
.menu-nav__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.menu-chip {
  min-height: 3.5rem;
  padding: var(--s-1) var(--s-4);
  border: 2px solid var(--h, var(--hue-none));
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--h, var(--hue-none));
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  overflow-wrap: anywhere;
}
.menu-chip--on {
  background: var(--h, var(--hue-none));
  color: var(--on-hue);
}
[data-theme='dark'] .menu-chip:not(.menu-chip--on) {
  color: var(--ink);
}
/* the rows below the first are the sections inside: smaller, still a touch target */
.menu-nav__row--2 .menu-chip,
.menu-nav__row--3 .menu-chip,
.menu-nav__row--4 .menu-chip,
.menu-nav__row--5 .menu-chip,
.menu-nav__row--6 .menu-chip {
  min-height: var(--tap-sm);
  padding-block: 0;
  font-size: var(--t-meta);
}
.menu-chip:focus-visible,
.pick-opt:focus-visible,
.pick-step__btn:focus-visible {
  outline: var(--ring) solid var(--focus);
  outline-offset: 2px;
}

/* photo: the sections are a rail beside the cards, each a hue square and its name; a section inside is indented */
.sale--photo .sale__catalogue > .menu-nav {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 7.5rem;
  overflow-y: auto;
  padding: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.sale--photo .menu-nav__row {
  flex-direction: column;
  flex-wrap: nowrap;
}
/* r42a L6: a section inside a section steps in and has a guide line on its start side, so «مشروبات ساخنة» is seen to
   sit under «مشروبات» and not beside it */
.sale--photo .menu-nav__row--2 {
  margin-inline-start: var(--s-1);
  padding-inline-start: var(--s-3);
  border-inline-start: 2px solid var(--line-strong);
}
.sale--photo .menu-nav__row--3,
.sale--photo .menu-nav__row--4,
.sale--photo .menu-nav__row--5,
.sale--photo .menu-nav__row--6 {
  margin-inline-start: var(--s-2);
  padding-inline-start: var(--s-4);
  border-inline-start: 2px solid var(--line-strong);
}
.sale--photo .menu-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 4.5rem;
  padding: var(--s-2) var(--s-1);
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.sale--photo .menu-chip::before {
  content: '';
  inline-size: 2.1rem;
  block-size: 2.1rem;
  border-radius: 0.6rem;
  background: var(--h, var(--hue-none));
}
.sale--photo .menu-chip--on {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* the phone: the rows scroll sideways, one line each */
@media (max-width: 30rem) {
  .menu-nav__row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block-end: var(--s-1);
  }
  .menu-chip {
    flex: none;
  }
  .sale--photo .sale__catalogue > .menu-nav {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    padding: var(--s-1);
    overflow-y: visible;
  }
  .sale--photo .menu-nav__row {
    flex-direction: row;
    padding-inline-start: 0;
  }
  .sale--photo .menu-chip {
    flex-direction: row;
    min-width: 5.5rem;
    min-height: var(--tap-sm);
  }
  .sale--photo .menu-chip::before {
    inline-size: 1.25rem;
    block-size: 1.25rem;
  }
}

/* a tile of an item with options carries a small layers mark */
.item__mods {
  align-self: flex-start;
  display: inline-flex;
  opacity: 0.85;
}

/* ---------------------------------------------------------------- the modifiers sheet (tablet: centred; phone: from the bottom) */

.pick-sheet {
  width: min(100%, 40rem);
  overflow: hidden;
  padding: 0;
  gap: 0;
}
.pick-head {
  padding: var(--s-4) var(--s-4) var(--s-2);
  border-bottom: 1px solid var(--line);
}
.pick-head__text {
  min-width: 0;
}
.pick-head__text h2 {
  overflow-wrap: anywhere;
}
.pick-head__base {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-meta);
}
.pick-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: var(--s-4);
}
.pick-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2);
  border: 2px solid transparent;
  border-radius: var(--r-card);
}
.pick-group[data-state='error'] {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.pick-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
}
.pick-group__name {
  margin: 0;
  font-size: var(--t-label);
  font-weight: 700;
}
.pick-rule {
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: var(--t-meta);
}
.pick-group__error {
  margin: 0;
  color: var(--warn);
  font-weight: 700;
}
.pick-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.pick-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1);
}

/* an option: a chip of 56 px or more; chosen, it is outlined in the accent and carries a check */
.pick-opt {
  min-height: 3.5rem;
  min-width: 5.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 0 var(--s-4);
  border: 2px solid var(--line-control);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.pick-opt--on {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}
.pick-opt__check {
  display: inline-flex;
  color: var(--accent);
}
.pick-opt__name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pick-opt__price {
  color: var(--ink-soft);
  font-size: var(--t-meta);
  font-variant-numeric: tabular-nums;
}
.pick-step {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
}
.pick-step__btn {
  min-width: var(--tap-qty);
  min-height: var(--tap-qty);
  border: 1px solid var(--line-control);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.pick-step__n {
  min-width: 3rem;
  text-align: center;
  font-weight: 700;
}

/* the footer stays in view: the quantity, and the add button with its live price */
.pick-foot {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.pick-add {
  flex: 1;
}
.pick-add[aria-disabled='true'] {
  opacity: 0.55;
}

/* ---------------------------------------------------------------- the quick pick */

.quick-pick {
  width: min(100%, 28rem);
}
.quick-pick__group {
  margin: 0;
  color: var(--ink-soft);
}
.quick-pick__opts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* ---------------------------------------------------------------- the options under a line of the slip and of the receipt */

.line__mods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: var(--t-meta);
  color: var(--ink-soft);
}
.line__mod {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-2);
}
.line__mod-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.line__mod-price {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}
.slip .line__mods {
  color: var(--slip-ink);
  font-size: 8.5pt;
}
.qrow__name .line__mods {
  font-size: var(--t-caption);
}

/* the order type is three buttons, each with its icon */
.seg--three .seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-width: 3.5rem;
  padding: 0 var(--s-2);
}
