/* ===================== ORDER FLOW =====================
   Sits on top of style.css and reuses its palette and type tokens. */

/* one guard instead of chasing every display rule that outranks [hidden] */
[hidden] { display: none !important; }

.order-body { background: var(--bg); }

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: var(--band-h);
  z-index: 20;
}
.order-header-logo { height: 34px; width: auto; display: block; }
.order-header-link {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood);
  text-decoration: none;
  border-bottom: 1px solid var(--yellow);
  padding-bottom: 2px;
}

.order-shell {
  max-width: 640px;
  margin: 0 auto;
  padding-block: 28px 80px;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------- step rail ---------- */
.order-steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.order-steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 9px;
  border-bottom: 3px solid var(--glass-border);
}
.order-steps li span {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--glass);
  font-size: 11px;
}
.order-steps li.is-current { color: var(--text); border-bottom-color: var(--yellow); }
.order-steps li.is-current span { background: var(--yellow); color: var(--wood-deep); }
.order-steps li.is-done { color: var(--green); border-bottom-color: var(--green); }
.order-steps li.is-done span { background: var(--green); color: var(--paper); }

/* ---------- steps ---------- */
.order-step { display: flex; flex-direction: column; gap: 18px; }
.order-step[hidden] { display: none; }   /* display:flex would otherwise beat [hidden] */
.order-step h1 {
  font-family: var(--font-display);
  font-size: clamp(25px, 6vw, 33px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.order-lede { margin: 0; color: var(--muted); line-height: 1.6; max-width: 54ch; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood);
}
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 16px;               /* 16px keeps iOS from zooming on focus */
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 13px 14px;
  width: 100%;
}
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
.field-hint { margin: -8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- map ---------- */
.map-holder {
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
}
.map-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.map-fallback p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ---------- verdict ---------- */
.verdict {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.verdict strong { font-family: var(--font-display); }
.verdict--ok { background: rgba(76, 122, 69, 0.1); border-color: rgba(76, 122, 69, 0.35); color: #37552f; }
.verdict--no { background: rgba(211, 53, 42, 0.09); border-color: rgba(211, 53, 42, 0.35); color: #8f241c; }

/* ---------- buttons ---------- */
.btn-primary,
.btn-secondary {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 15px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.btn-primary { background: var(--wood-deep); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--wood-dark); }
.btn-secondary { background: var(--paper); color: var(--text); border-color: var(--glass-border); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-next { margin-top: 4px; }

/* The courier's tracking page, as a link dressed as a button. Before a rider
   is booked there is no link yet, so it sits greyed out with no href. */
.btn-driver { display: block; text-align: center; text-decoration: none; }
.btn-driver.is-waiting { opacity: 0.4; cursor: not-allowed; }

/* ---------- menu ---------- */
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
}
.menu-item img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; display: block; }
.menu-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-item-name { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; line-height: 1.2; }
.menu-item-price { font-size: 14px; color: var(--wood); font-weight: 600; }
.menu-item-sides { font-size: 12.5px; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--bg-elev);
  font-size: 17px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.item-note {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-size: 14px;
  border: 1px dashed var(--glass-border);
  border-radius: 8px;
  padding: 9px 11px;
  background: transparent;
  width: 100%;
}

/* ---------- running cart ---------- */
.order-cart {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 -6px 20px rgba(44, 28, 17, 0.07);
}
.order-cart[hidden] { display: none; }   /* display:flex above would otherwise beat [hidden] */
.cart-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.cart-row strong { font-variant-numeric: tabular-nums; }
.cart-row--total {
  border-top: 1px solid var(--glass-border);
  padding-top: 8px;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.cart-note { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- summary ---------- */
.summary { display: flex; flex-direction: column; gap: 10px; }
.summary-block {
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-block h2 {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wood);
  margin: 0 0 2px;
}
.summary-line { display: flex; justify-content: space-between; gap: 14px; font-size: 14.5px; }
.summary-line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-fineprint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

@media (max-width: 480px) {
  .order-steps li { font-size: 0; gap: 0; justify-content: center; }
  .order-steps li span { font-size: 11px; }
  .menu-item { grid-template-columns: 60px 1fr auto; }
  .menu-item img { width: 60px; height: 60px; }
}

/* ---------- returning customer: saved addresses ---------- */
#saved-panel,
#new-panel { display: flex; flex-direction: column; gap: 18px; }
#saved-panel[hidden],
#new-panel[hidden] { display: none; }

.saved-list { display: flex; flex-direction: column; gap: 10px; }
.saved-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.16s ease;
}
.saved-card:hover { border-color: var(--wood); }
.saved-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wood);
}
.saved-address { font-size: 15px; color: var(--text); line-height: 1.4; }
.saved-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- current location ---------- */
.btn-locate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  align-self: flex-start;
}
.btn-locate svg { width: 17px; height: 17px; }

/* ---------- home / work / other ---------- */
.label-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}
.label-picker legend { padding: 0; margin-bottom: 8px; }
.label-picker label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  cursor: pointer;
}

/* the map element replaces its fallback once Google loads */
#map-holder > div:not(.map-fallback) { height: 100%; }

/* ---------- address suggestions (our own list, Google's data) ---------- */
.autocomplete { position: relative; display: block; }
.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(44, 28, 17, 0.14);
  max-height: 300px;
  overflow-y: auto;
}
.suggestions li {
  padding: 11px 12px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.35;
}
.suggestions li:hover,
.suggestions li[aria-selected="true"] { background: var(--bg-elev); }
.suggestion-main { display: block; font-weight: 600; font-size: 15px; }
.suggestion-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.suggestions-empty { padding: 12px; font-size: 14px; color: var(--muted); }

/* ---------- back ---------- */
.btn-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -10px;
  padding: 6px 2px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.btn-back:hover { color: var(--text); }
.btn-back svg { width: 15px; height: 15px; }

/* ---------- pin moved away from the typed address ---------- */
.pin-moved {
  margin: -6px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: rgba(232, 164, 35, 0.12);
  border: 1px solid rgba(232, 164, 35, 0.4);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

/* ---------- order tracking ---------- */
.track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.track li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  position: relative;
}
.track li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  bottom: -50%;
  width: 2px;
  background: var(--glass-border);
}
.track li:last-child::before { display: none; }
.track-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--bg);
  z-index: 1;
}
.track-label { font-size: 15px; color: var(--muted); }
.track li.is-done .track-dot { background: var(--green); border-color: var(--green); }
.track li.is-done .track-label { color: var(--text); }
.track li.is-current .track-dot { background: var(--yellow); border-color: var(--yellow); }
.track li.is-current .track-label { color: var(--text); font-weight: 700; font-family: var(--font-display); }

/* ---------- sold out for today ---------- */
.menu-item.is-soldout { opacity: 0.55; }
.menu-item.is-soldout img { filter: grayscale(1); }
.soldout-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}

/* The one piece of small print a customer must actually take in: when the
   order stops being theirs to call off. */
.order-fineprint--warn {
  border-left: 3px solid var(--yellow);
  padding-left: 12px;
}
.order-fineprint--warn strong { color: var(--text); }

/* Where the food ends and the fridge begins. */
.menu-section {
  font-family: var(--font-display, inherit);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #7a6f66);
  margin: 26px 0 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* A bottle is a line, not a card: no photograph, and short enough that
   thirteen of them don't bury the food above. */
/* A drink has no photograph, so it must not keep the 74px column reserved for
   one - the name was being squeezed into it and the stepper left floating in
   the middle. Two columns: everything to read, then the stepper hard right,
   where it sits on every food row. */
.menu-item--line { grid-template-columns: 1fr auto; padding: 10px 12px; gap: 12px; }
.menu-item--line .menu-item-body { flex-direction: row; align-items: baseline; gap: 10px; }
.menu-item--line .menu-item-name { font-size: 15px; }
.menu-item--line .menu-item-price { font-size: 15px; }

/* A check that has already been answered. */
.btn-primary.is-done {
  background: var(--glass-border);
  color: var(--muted);
  cursor: default;
  box-shadow: none;
}
