/* ============================================================
   ZEN BOWL — order.css  (ORDER PAGE ONLY — order.html)
   Depends on shared.css (tokens, header, buttons, forms). The landing
   page does not load this file, so editing it cannot affect the landing.
   ============================================================ */

.order-body { background: var(--off-white); }

.order-main {
  padding-top: calc(var(--header-h) + var(--space-3));
  padding-bottom: var(--space-6);
  min-height: 70vh;
}

.order-title {
  font-size: var(--step-h2);
  margin-bottom: var(--space-2);
}

/* Account link stays visible on mobile (loyalty entry point). */
.order-account {
  text-decoration: none;
  color: var(--sage-dark);
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}
.order-account:hover { color: var(--maroon); }

/* Tight phones: tighten the header cluster. Navigation text links moved into
   the side drawer, so what remains here is status (account + points) and the
   cart — both of which stay. */
@media (max-width: 560px) {
  .order-account { font-size: .82rem; }
}

.cart-btn { padding: .55rem 1.1rem; font-size: .9rem; position: relative; }
.cart-btn__count {
  background: var(--off-white);
  color: var(--maroon);
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 600;
  min-width: 1.4em;
  padding: .05rem .4rem;
}

.order-closed-banner {
  background: var(--maroon-tint);
  color: var(--maroon-dark);
  border-radius: var(--radius);
  padding: .8rem 1.2rem;
  font-weight: 500;
}

/* Specials / deals banner */
.specials-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  background: var(--sage-light);
  border: 1px solid rgba(138, 155, 124, .45);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  margin-bottom: var(--space-3);
}
.specials-banner__label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.specials-banner__deal {
  font-weight: 500;
  color: var(--maroon-dark);
  font-size: .95rem;
}

/* Allergen */
.allergen-box {
  background: var(--white);
  border: 1px solid rgba(46, 43, 40, .1);
  border-radius: var(--radius);
  padding: .8rem 1.2rem;
  margin-bottom: var(--space-3);
  font-size: .9rem;
  color: var(--charcoal-soft);
}
.allergen-box summary { cursor: pointer; font-weight: 600; color: var(--charcoal); }
.allergen-box p { margin: .6rem 0 0; line-height: 1.6; }

/* Category pill bar */
.cat-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .6rem 0;
  background: linear-gradient(var(--off-white) 85%, transparent);
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  flex: none;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: var(--charcoal-soft);
  background: var(--white);
  border: 1px solid rgba(46, 43, 40, .12);
  border-radius: var(--radius-pill);
  padding: .45rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, background-color .2s, border-color .2s;
}
.cat-pill:hover { color: var(--maroon); border-color: var(--maroon); }
.cat-pill.is-active { background: var(--maroon); border-color: var(--maroon); color: var(--off-white); }

/* Category sections + item cards */
.cat-section { padding-top: var(--space-3); }
.cat-section__title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .3rem; }
.cat-section__sub { color: var(--charcoal-soft); font-family: var(--font-body); font-size: .95rem; margin-bottom: var(--space-2); }
.cat-section__note {
  display: inline-block;
  background: var(--sage-light);
  color: var(--sage-dark);
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 500;
  padding: .3rem .9rem;
  margin-bottom: var(--space-2);
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}
@media (min-width: 700px) { .item-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .item-grid { grid-template-columns: repeat(3, 1fr); } }

.item-card {
  text-align: left;
  font: inherit;
  background: var(--white);
  border: 1px solid rgba(46, 43, 40, .07);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.item-card:hover:not(:disabled) { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
/* Out of stock. The card stays VISIBLE and readable — it is a "we ran out",
   not a hidden item. The dimming sits on the card's own content rather than on
   the card, because opacity on the parent caps every child: a 55%-opacity
   warning badge is not a legible warning. */
.item-card:disabled { cursor: not-allowed; }
.item-card:disabled .item-card__name,
.item-card:disabled .item-card__alt,
.item-card:disabled .item-card__desc,
.item-card:disabled .item-card__price,
.item-card:disabled .item-card__tag:not(.item-card__tag--oos) { opacity: .55; }

.item-card__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--charcoal); }
.item-card__alt { font-size: .85rem; color: var(--charcoal-soft); }
.item-card__desc { font-size: .85rem; color: var(--charcoal-soft); line-height: 1.5; }
.item-card__meta { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.item-card__price { font-weight: 600; color: var(--wood-dark); }
.item-card__tag {
  font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sage-dark); border: 1px solid var(--sage); border-radius: var(--radius-pill);
  padding: .12rem .55rem;
}
/* "Out of stock" is a functional warning, not a descriptive tag like
   "vegetarian", so it reads as one: the same semantic red the form errors use
   (shared.css --error*, NOT the brand maroon), filled rather than outlined so
   it separates from the sage tags beside it at a glance. #A32B1F on #FDF3F1 is
   6.4:1 — above the 4.5:1 this small uppercase text needs. */
.item-card__tag--oos {
  color: var(--error-text);
  background: var(--error-tint);
  border-color: var(--error);
  font-weight: 700;
}

/* Loyalty: what this item earns, in green. */
.item-card__meta { flex-wrap: wrap; row-gap: .3rem; }
.item-card__points {
  font-size: .78rem; font-weight: 700; color: var(--sage-dark);
  background: var(--sage-light); border-radius: var(--radius-pill); padding: .12rem .55rem;
  white-space: nowrap;
}
.item-card__points.is-boosted { background: var(--sage-dark); color: var(--off-white); }
.item-card__boost {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: var(--wood-dark); border: 1px dashed var(--wood); border-radius: var(--radius-pill);
  padding: .1rem .5rem; white-space: nowrap;
}
.item-modal__points {
  margin: .6rem 0 0; text-align: right;
  display: flex; justify-content: flex-end; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.item-modal__points:empty { margin: 0; }

/* Item modal */
.item-modal {
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(46, 43, 40, .3);
  padding: 0;
  width: min(94vw, 34rem);
  max-height: 86vh;
  background: var(--off-white);
}
.item-modal::backdrop { background: rgba(46, 43, 40, .45); }

.item-modal__inner { padding: var(--space-3); overflow-y: auto; max-height: 86vh; box-sizing: border-box; }
.item-modal__close {
  position: sticky; top: 0; float: right;
  font-size: 1.6rem; line-height: 1;
  background: none; border: 0; color: var(--charcoal-soft); cursor: pointer; padding: .2rem .5rem;
}
.item-modal__close:hover { color: var(--maroon); }
.item-modal__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0 0 .2rem; }
.item-modal__alt { color: var(--charcoal-soft); margin: 0 0 .5rem; }
.item-modal__desc { color: var(--charcoal-soft); font-size: .92rem; line-height: 1.55; margin: 0 0 var(--space-2); }

.opt-group { margin-bottom: var(--space-2); }
.opt-group__title { font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
.opt-group__hint { font-weight: 400; color: var(--charcoal-soft); font-size: .8rem; }
.opt-row {
  display: flex; align-items: center; gap: .6rem;
  background: var(--white);
  border: 1px solid rgba(46, 43, 40, .1);
  border-radius: 10px;
  padding: .55rem .8rem;
  margin-bottom: .4rem;
  cursor: pointer;
  font-size: .92rem;
}
.opt-row input { accent-color: var(--maroon); }
.opt-row__delta { margin-left: auto; color: var(--wood-dark); font-weight: 500; font-size: .85rem; }

.qty-stepper { display: inline-flex; align-items: center; gap: .8rem; }
.qty-stepper button {
  width: 2.2rem; height: 2.2rem;
  font-size: 1.2rem; font-weight: 600;
  background: var(--white); color: var(--maroon);
  border: 1px solid rgba(123, 45, 38, .35); border-radius: 50%;
  cursor: pointer;
}
.qty-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.qty-stepper span { font-weight: 600; min-width: 1.5em; text-align: center; }

.item-modal__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed rgba(176, 137, 104, .5);
}

/* Cart drawer */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(46, 43, 40, .45);
  opacity: 0; transition: opacity .3s ease;
}
.drawer-overlay.is-open { opacity: 1; }

.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 160;
  width: min(92vw, 26rem);
  height: 100vh; height: 100dvh;          /* dvh tracks the mobile URL bar */
  background: var(--off-white);
  box-shadow: -12px 0 40px rgba(46, 43, 40, .2);
  transform: translateX(105%);
  /* visibility (not just transform) so a closed drawer is unreachable for
     screen readers and older browsers without `inert` — delayed so the slide
     out still animates. */
  visibility: hidden;
  transition: transform .35s var(--ease-out), visibility 0s .35s;
  display: flex; flex-direction: column;
}
.cart-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform .35s var(--ease-out); }

.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(46, 43, 40, .08);
}
.cart-drawer__head h2 { margin: 0; font-size: 1.3rem; }
.cart-drawer__close {
  font-size: 1.8rem; line-height: 1; background: none; border: 0;
  color: var(--charcoal-soft); cursor: pointer; padding: .2rem .5rem;
}
.cart-drawer__close:hover { color: var(--maroon); }

.cart-drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-2) var(--space-3); }
.cart-drawer__foot { padding: var(--space-2) var(--space-3) var(--space-3); border-top: 1px solid rgba(46, 43, 40, .08); background: var(--white); }

/* Checkout mode: the form (foot) becomes the primary scroll area so Place Order
   is always reachable (especially on phones), and the cart above it is capped to
   a preview that scrolls on its own. Fixes the un-scrollable, squished cart. */
.cart-drawer.is-checkout .cart-drawer__body { flex: 0 1 auto; max-height: 32vh; }
.cart-drawer.is-checkout .cart-drawer__foot { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.cart-empty { color: var(--charcoal-soft); text-align: center; padding: var(--space-4) 0; }

.cart-line { padding: .7rem 0; border-bottom: 1px dashed rgba(176, 137, 104, .4); }
.cart-line__top { display: flex; justify-content: space-between; gap: .6rem; }
.cart-line__name { font-weight: 600; font-size: .95rem; }
.cart-line__price { font-weight: 600; color: var(--wood-dark); white-space: nowrap; }
.cart-line__opts { font-size: .8rem; color: var(--charcoal-soft); line-height: 1.5; margin: .15rem 0 .4rem; }
.cart-line__controls { display: flex; align-items: center; gap: .8rem; }
.cart-line__controls .qty-stepper button { width: 1.7rem; height: 1.7rem; font-size: 1rem; }
.cart-line__remove {
  margin-left: auto; background: none; border: 0; color: var(--charcoal-soft);
  font-size: .8rem; cursor: pointer; text-decoration: underline;
}
.cart-line__remove:hover { color: var(--maroon); }

.cart-discount { display: flex; justify-content: space-between; color: var(--sage-dark); font-weight: 500; font-size: .9rem; padding: .5rem 0 0; }
.cart-totals { font-size: .95rem; }
.cart-totals__row { display: flex; justify-content: space-between; padding: .15rem 0; color: var(--charcoal-soft); }
.cart-totals__row--total { font-weight: 600; font-size: 1.15rem; color: var(--charcoal); padding-top: .4rem; }

.checkout-form .form__field { margin-bottom: .8rem; }
.checkout-form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.checkout-form .hint { font-size: .78rem; color: var(--charcoal-soft); margin-top: .2rem; }
.checkout-loyalty {
  margin: 0 0 .8rem; padding: .5rem .7rem; border-radius: 10px;
  background: var(--sage-light); color: var(--sage-dark);
  font-size: .82rem; font-weight: 600; line-height: 1.4;
}
.checkout-loyalty--join { background: var(--maroon-tint); color: var(--maroon); }
.checkout-loyalty__link { color: inherit; font-weight: 700; text-decoration: underline; }

/* Signed-in checkout: the contact block is shown, not asked. The server reads
   these off the account record, so an input here would be theatre. */
.checkout-contact {
  background: var(--sage-light); color: var(--sage-dark); border-radius: 10px;
  padding: .6rem .9rem; margin: .8rem 0; font-size: .85rem;
}
.checkout-contact__line { margin: 0; font-weight: 600; }
.checkout-contact__value { margin: .15rem 0 0; word-break: break-word; }
.checkout-contact__edit { color: inherit; font-weight: 700; text-decoration: underline; }
/* A legacy account still missing a phone: the same semantic red as a bad field,
   because it is the same kind of problem — something required is absent. */
.checkout-contact--incomplete { background: var(--error-tint); color: var(--error-text); }
.checkout-contact--incomplete .field-error { margin-top: 0; }

.checkout-ack { display: flex; gap: .6rem; align-items: flex-start; font-size: .82rem; color: var(--charcoal-soft); margin: .8rem 0; cursor: pointer; }
.checkout-ack input { accent-color: var(--maroon); margin-top: .2rem; flex: none; }
/* An unticked allergen box gets the same semantic red as a bad field, so
   "what is stopping me" looks the same everywhere on this form. */
.checkout-ack input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 2px; }
.checkout-pay { background: var(--sage-light); color: var(--sage-dark); border-radius: 10px; font-size: .85rem; padding: .6rem .9rem; margin: .8rem 0; }
.checkout-status { min-height: 1.3rem; font-size: .88rem; font-weight: 500; margin: .5rem 0 0; }
.checkout-status.is-error { color: var(--error-text); font-weight: 600; }

/* Coupon + points redemption at checkout */
.checkout-redeem { margin: .2rem 0 .4rem; }
.redeem-row { display: flex; gap: .5rem; align-items: center; }
.redeem-row .form__input { flex: 1; min-width: 0; }
.redeem-row .btn { flex: none; }
.redeem-msg, .redeem-hint { font-size: .8rem; margin: .3rem 0 0; min-height: 1em; line-height: 1.3; }
.redeem-msg.is-ok, .redeem-hint { color: var(--sage-dark); font-weight: 600; }
.redeem-msg.is-error { color: var(--maroon); }
.cart-totals__row.cart-discount { color: var(--sage-dark); font-weight: 500; padding: .15rem 0; }

/* Confirmation */
.confirm-box { text-align: center; padding: var(--space-3) 0; }
.confirm-box__title { font-family: var(--font-display); font-size: 1.6rem; color: var(--sage-dark); margin: 0 0 .5rem; }
.confirm-box__number {
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; color: var(--maroon);
  background: var(--maroon-tint); border-radius: var(--radius); padding: .6rem 1rem; margin: .8rem 0;
}
.confirm-box__hint { color: var(--charcoal-soft); font-size: .9rem; }
.confirm-box__status { font-weight: 600; color: var(--sage-dark); margin: .6rem 0; }

/* footer chrome lives in shared.css (§17b) */

/* Reduced motion */
/* checkout coupon picker (bank) — clickable chips */
.checkout-coupons { margin: 0 0 .7rem; }
.checkout-coupons__title { font-size: .82rem; font-weight: 700; color: var(--charcoal-soft); margin: 0 0 .45rem; }
.cpn-chip {
  display: inline-flex; align-items: center; gap: .3rem; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 700; line-height: 1.1;
  margin: 0 .4rem .45rem 0; padding: .42rem .85rem; border-radius: var(--radius-pill);
  background: rgba(138, 155, 124, .16);            /* transparent sage green when off */
  color: var(--sage-dark); border: 1.5px solid rgba(138, 155, 124, .55);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease;
}
.cpn-chip:hover:not(.is-blocked):not(.is-on) { background: rgba(138, 155, 124, .32); }
.cpn-chip:active:not(.is-blocked) { transform: scale(.97); }
.cpn-chip.is-on {                                  /* selected → solid green */
  background: var(--sage-dark); color: #fff; border-color: var(--sage-dark);
}
.cpn-chip.is-on::before { content: "✓ "; }
.cpn-chip.is-blocked {                             /* can't combine → greyed out */
  background: var(--beige); color: var(--charcoal-soft);
  border-color: transparent; cursor: not-allowed; opacity: .65;
}
.cpn-chip--auto {                                  /* "next buy" → always applied */
  cursor: default; background: var(--sage-dark); color: #fff; border-color: var(--sage-dark);
}
.cpn-chip--auto::before { content: "★ "; }

/* obvious savings callout under the total */
.cart-totals__save {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .55rem; padding: .5rem .8rem; border-radius: 10px;
  background: var(--sage-light); color: var(--sage-dark);
  font-weight: 800; font-size: 1.02rem;
}

/* ---------- Reduced motion (keep last — see shared.css §18) ---------- */
@media (prefers-reduced-motion: reduce) {
  .cart-drawer, .drawer-overlay, .item-card { transition: none; }
}
