/* ==========================================================================
   Nikamall food court — online ordering.
   Layout pattern adapted from khaanburger.com, recoloured to the Nikamall palette.
   Loaded only by foodcourt.html.
   ========================================================================== */

/* ---------- storefront head ---------- */
.ohero {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1264 / 300;
  background: #0b0d11;
  margin-bottom: 22px;
}
.ohero img { width: 100%; height: 100%; object-fit: cover; }
.ohero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 12, .55), transparent 60%);
}

.otop {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.otop h1 { margin: 0; font-size: clamp(22px, 3.4vw, 34px); font-weight: 500; }
.ostatus { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--fg-2); }
.ostatus i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #35C759; display: inline-block;
  box-shadow: 0 0 0 4px rgba(53, 199, 89, .16);
}

/* selector pills */
.opick { display: grid; gap: 10px; max-width: 720px; margin: 0 auto 26px; }
.opick__btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 20px;
  background: var(--fg);
  color: #14171E;
  border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 500;
  transition: opacity .25s var(--ease);
}
.opick__btn:hover { opacity: .88; }
.opick__btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.opick__addr {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 20px;
  background: var(--bg-4);
  border-radius: 8px;
  font-size: 13.5px; color: var(--fg-2);
}
.opick__addr svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; stroke-width: 1.7; flex: none; }

/* ---------- tabs ---------- */
.otabs { display: flex; gap: 4px; }
.otab {
  padding: 14px 30px;
  background: var(--bg-3);
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-size: 14.5px; font-weight: 500;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.otab:hover { color: var(--fg-2); }
.otab[aria-selected='true'] { background: var(--bg-2); color: var(--fg); }
.opanel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 8px;
  padding: clamp(16px, 2.4vw, 26px);
}
.opanel[hidden] { display: none; }

/* ---------- ordering layout ---------- */
/* minmax(0,…) is required: a plain 1fr column takes its automatic minimum from
   content, so the scrolling category rail would inflate the column past the
   container instead of scrolling inside it. */
.olayout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .olayout { grid-template-columns: minmax(0, 1fr); } }

/* category rail */
.catrail { position: relative; margin-bottom: 18px; }
.catrail__track {
  display: flex; gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.catrail__track::-webkit-scrollbar { display: none; }
.catbtn {
  flex: none;
  display: grid; justify-items: center; gap: 7px;
  padding: 12px 20px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.catbtn img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; opacity: .75; }
.catbtn:hover { color: var(--fg-2); }
.catbtn[aria-current='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.catbtn[aria-current='true'] img { opacity: 1; }
.catnav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg-2);
  z-index: 2;
}
.catnav:hover { border-color: var(--accent); color: var(--accent); }
.catnav svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.catnav--next { inset-inline-start: -6px; }
.catnav--prev { inset-inline-end: -6px; }
@media (max-width: 640px) { .catnav { display: none; } }

/* ---------- promo rails (بهترین‌ها / جدیدترین‌ها) ---------- */
.promo { margin-bottom: 30px; }
.promo__head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.promo__head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.promo__head h3 b { color: var(--accent); font-weight: 500; }
.promo__head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.rail {
  position: relative;
  /* soften both ends so a continuously moving rail reads as intentional
     rather than clipped */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 46px, #000 calc(100% - 46px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 46px, #000 calc(100% - 46px), transparent 100%);
}
.rail__track {
  display: flex; gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  /* no scroll-snap: it fights the programmatic auto-scroll */
}
.rail__track::-webkit-scrollbar { display: none; }
.rail__track > .pcard { flex: 0 0 200px; }
.rail__track { cursor: grab; }
.rail__track.dragging { cursor: grabbing; user-select: none; }
.rail__track img { -webkit-user-drag: none; user-select: none; }
@media (max-width: 560px) { .rail__track > .pcard { flex: 0 0 62%; } }

/* ---------- big restaurant cards (hub) ---------- */
/* 2×2 on desktop: with the cart taking 300px, auto-fit gave 3-then-1 and made
   the cards small. Two columns makes each one properly large. */
.ugrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
@media (min-width: 900px) { .ugrid { grid-template-columns: repeat(2, 1fr); } }
.ucard {
  display: flex; flex-direction: column;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .28s var(--ease), transform .28s var(--ease);
}
.ucard:hover { border-color: rgba(240, 144, 48, .55); transform: translateY(-4px); }
.ucard__img { aspect-ratio: 10 / 7; overflow: hidden; background: #0b0d11; }
.ucard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.ucard:hover .ucard__img img { transform: scale(1.06); }
.ucard__body { padding: 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.ucard__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ucard__top h4 { margin: 0; font-size: 17px; font-weight: 500; }
.ucard__kind { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ucard__blurb { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.ucard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ucard__tags span {
  font-size: 11px; padding: 4px 11px;
  border: 1px solid var(--line-2); border-radius: 100px; color: var(--fg-2);
}
.ucard:hover .ucard__tags span { border-color: rgba(240, 144, 48, .4); color: var(--accent); }
.ucard__foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted);
}
.ucard__go { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.ucard__go svg { width: 13px; height: 13px; }

/* ---------- restaurant picker (legacy, per-unit pages) ---------- */
.rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 26px; }
.rcard {
  padding: 15px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: start;
  display: grid; gap: 8px; align-content: start;
  transition: border-color .24s var(--ease), background .24s var(--ease), transform .24s var(--ease);
}
.rcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rcard[aria-pressed='true'] { border-color: var(--accent); background: linear-gradient(to top, var(--accent-dim), transparent), var(--bg-3); }
.rcard__top { display: flex; align-items: center; gap: 10px; }
.rcard__top img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.rcard__name { font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.rcard__kind { font-size: 11.5px; color: var(--muted); }
.rcard__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rcard__tags span {
  font-size: 10.5px; padding: 3px 9px;
  border: 1px solid var(--line-2); border-radius: 100px; color: var(--muted);
}
.rcard[aria-pressed='true'] .rcard__tags span { border-color: rgba(240,144,48,.4); color: var(--accent); }
.rcard__count { font-size: 11px; color: var(--muted); }

/* ---------- category chips ---------- */
.catwrap { margin-bottom: 22px; }
.catwrap__label { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.catchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.catchip {
  font-size: 12.5px;
  padding: 8px 16px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--fg-2);
  transition: border-color .22s var(--ease), color .22s var(--ease), background .22s var(--ease);
}
.catchip:hover { border-color: var(--line-2); }
.catchip[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* Sticky so «حذف فیلترها» stays reachable after selecting a restaurant scrolls
   the page down — otherwise it sits above the viewport, under the site header. */
/* [hidden] is only a hint: a class rule setting display beats it, so the
   bar has to opt out explicitly or it shows even when nothing is filtered. */
.filterbar[hidden] { display: none; }

.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: calc(var(--head-h, 133px) - 1px);   /* --head-h: measured in main.js */
  z-index: 40;
  margin-bottom: 18px;
  padding: 11px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
/* the fallbacks are the header's heights before main.js has measured it:
   the quick-nav row is hidden at 860px and below */
@media (max-width: 860px) { .filterbar { top: calc(var(--head-h, 75px) - 1px); } }
.filterbar button {
  background: transparent; border: 1px solid var(--line-2); border-radius: 6px;
  padding: 7px 14px; color: var(--muted); font-size: 12.5px;
}
.filterbar button:hover { border-color: var(--accent); color: var(--accent); }

/* search */
.osearch { position: relative; margin-bottom: 24px; }
.osearch input {
  width: 100%;
  padding: 13px 44px 13px 16px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 14.5px;
}
.osearch input:focus { border-color: var(--accent); outline: none; }
.osearch svg {
  position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.8;
  pointer-events: none;
}

/* ---------- product grid ---------- */
.csec { margin-bottom: 34px; scroll-margin-top: 150px; }
.csec__head {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 16px;
}
.csec__head h3 { margin: 0; font-size: 16px; font-weight: 500; color: var(--accent); }
.csec__head span { font-size: 12.5px; color: var(--muted); }
.csec__head::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 150px floor keeps two columns on a 390px phone rather than one very long list */
/* food-type groups inside a restaurant section — deliberately subordinate to
   .csec__head so the hierarchy reads restaurant > type > dish */
.subsec { margin-bottom: 24px; }
.subsec:last-child { margin-bottom: 0; }
.subsec__head {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px;
  font-size: 13px; font-weight: 500; color: var(--fg-2);
}
.subsec__head::before {
  content: '';
  width: 3px; height: 14px; border-radius: 2px;
  background: var(--accent); opacity: .65;
  flex: none;
}
.subsec__count { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.pcard {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.pcard:hover { border-color: rgba(240, 144, 48, .45); transform: translateY(-2px); }
.pcard__img { aspect-ratio: 4 / 3; background: #0b0d11; overflow: hidden; }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pcard:hover .pcard__img img { transform: scale(1.05); }
/* placeholder art is a drawing, not a photo — show it whole, and do not zoom
   it on hover the way a photograph invites */
.pcard__img--ph img { object-fit: contain; opacity: .8; padding: 8px; }
.pcard:hover .pcard__img--ph img { transform: none; }
.pcard__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard__name { font-size: 14.5px; font-weight: 500; }
.pcard__from { font-size: 11.5px; color: var(--muted); }
.pcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }
.pcard__price { font-size: 13.5px; color: var(--fg-2); white-space: nowrap; }
.pcard__price small { color: var(--muted); font-size: 11px; }
.addbtn {
  padding: 7px 18px;
  background: var(--accent);
  color: #16100a;
  border: 0; border-radius: 6px;
  font-size: 12.5px; font-weight: 600;
  transition: background .22s var(--ease);
}
.addbtn:hover { background: var(--accent-hi); }

/* quantity stepper (replaces the add button once in cart) */
.qty { display: flex; align-items: center; gap: 2px; background: var(--bg-4); border-radius: 6px; padding: 2px; }
.qty button {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--accent); font-size: 16px; line-height: 1;
}
.qty button:hover { background: rgba(240, 144, 48, .16); }
.qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 500; }

/* ---------- cart ---------- */
.cart {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  position: sticky; top: calc(var(--head-h, 133px) - 1px);
}
.cart h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; }
.cart__rule { height: 1px; background: var(--line); margin: 12px 0 16px; }
.cart__empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 13px; }
.cart__empty svg { width: 54px; height: 54px; stroke: var(--line-2); fill: none; stroke-width: 1.2; margin-bottom: 12px; }
.cart__items { display: grid; gap: 12px; max-height: 46vh; max-height: 46dvh; overflow-y: auto; margin-bottom: 4px; }
.citem { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.citem__img { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: #0b0d11; }
.citem__img img { width: 100%; height: 100%; object-fit: cover; }
.citem__name { font-size: 13px; line-height: 1.5; }
.citem__price { font-size: 11.5px; color: var(--muted); }
.cart__totals { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; display: grid; gap: 8px; }
.cart__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.cart__row--total { font-size: 15px; color: var(--fg); font-weight: 500; }
.cart__row--total b { color: var(--accent); }
/* This is an <a>, and an inline element's vertical padding overflows its line
   box instead of adding height — which is why the button used to sit on top of
   the قابل پرداخت line above it. display:block is the whole fix; the explicit
   line-height keeps the label centred. */
.cart__go {
  display: block;
  width: 100%; margin-top: 16px;
  padding: 12px 14px;
  background: var(--accent); color: #16100a;
  border: 0; border-radius: 8px;
  font-size: 14.5px; font-weight: 600;
  line-height: 1.5;
  text-align: center; text-decoration: none;
}
.cart__go:hover { background: var(--accent-hi); }
/* an <a> has no disabled property, so the empty-cart state is a class */
.cart__go:disabled,
.cart__go.is-off {
  background: var(--bg-4); color: var(--muted); cursor: not-allowed; pointer-events: none;
}
.cart__note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ---------- floating cart button ----------
   Replaces the «سبد خرید» link that used to sit in the header nav. One control
   at every screen size: a basket on its own while the cart is empty, expanding
   to the count and the running total once something is in it. */
.cartfab {
  position: fixed; z-index: 90;
  inset: auto auto 22px 22px;          /* bottom-left, clear of RTL text flow */
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px;
  background: var(--accent); color: #16100a;
  border: 0; border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), opacity .18s var(--ease);
}
.cartfab:hover { background: var(--accent-hi); transform: translateY(-2px); }
.cartfab:active { transform: none; }

.cartfab__ico { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
.cartfab__ico svg { width: 22px; height: 22px; fill: none; stroke: #16100a; stroke-width: 1.9; }

.cartfab__badge {
  position: absolute; inset: -6px -8px auto auto;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--bg); color: var(--accent);
  border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.cartfab__sum { white-space: nowrap; }
.cartfab__sum b { font-weight: 700; }
.cartfab__n { opacity: .78; margin-inline-end: 6px; }

/* empty: shrink to the basket alone, and drop the badge */
.cartfab.is-empty { padding: 12px; }
.cartfab.is-empty .cartfab__sum,
.cartfab.is-empty .cartfab__badge { display: none; }

/* while the cart sheet is open the button would sit on top of it */
body.cart-open .cartfab { opacity: 0; pointer-events: none; }

@media (max-width: 980px) {
  .cart { position: fixed; inset: auto 0 0 0; z-index: 100; border-radius: 12px 12px 0 0;
          transform: translateY(101%); transition: transform .32s var(--ease); max-height: 82vh; max-height: 82dvh; overflow-y: auto; }
  .cart.open { transform: none; }
  .cart__items { max-height: 42vh; max-height: 42dvh; }
  .cartfab { inset: auto auto 16px 16px; }
  body.cart-open { overflow: hidden; }
  /* so the end of a menu never sits permanently under the button */
  main { padding-bottom: 88px; }
}

/* the sticky sidebar gets a brief ring when the button scrolls it into view */
@keyframes cartPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 144, 48, 0); }
  30%      { box-shadow: 0 0 0 3px rgba(240, 144, 48, .55); }
}
.cart.pulse { animation: cartPulse 1.1s var(--ease) 1; }

/* ---------- info panel ---------- */
.oinfo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
@media (max-width: 780px) { .oinfo { grid-template-columns: 1fr; } }
.oinfo h4 { margin: 0 0 14px; font-size: 14.5px; color: var(--accent); font-weight: 500; }
.otable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.otable th, .otable td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.otable th { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.otable td:first-child { text-align: start; color: var(--fg-2); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(6, 8, 11, .74);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal__box {
  width: min(660px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  transform: translateY(14px) scale(.98);
  transition: transform .3s var(--ease);
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
}
.modal.open .modal__box { transform: none; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.modal__body { padding: 22px; }
.modal__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-top: 1px solid var(--line);
}
.optgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .optgrid { grid-template-columns: 1fr; } }
.optbtn {
  padding: 20px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--fg);
  font-size: 15px; font-weight: 500;
  text-align: center;
  transition: border-color .22s var(--ease), background .22s var(--ease);
}
.optbtn small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); font-weight: 400; }
.optbtn:hover { border-color: var(--accent); }
.optbtn[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-dim); }

/* toast */
.toast {
  position: fixed; inset-inline-start: 50%; bottom: 26px;
  transform: translate(50%, 20px);
  z-index: 120;
  padding: 12px 22px;
  background: var(--accent); color: #16100a;
  border-radius: 100px;
  font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.toast.show { opacity: 1; transform: translate(50%, 0); }
@media (max-width: 980px) { .toast { bottom: 96px; } }


/* ---------- touch devices ----------
   26px steppers are fine with a mouse and fiddly with a thumb; 44px is the
   figure both Apple and Google publish as the minimum comfortable target. */
@media (pointer: coarse) {
  .qty button { width: 40px; height: 40px; font-size: 19px; }
  .qty span { min-width: 30px; font-size: 15px; }
  .addbtn { padding: 11px 20px; font-size: 13.5px; }
  .catchip { padding: 11px 18px; font-size: 13.5px; }
  .optbtn { padding: 22px 18px; }
  .cart__go { padding: 15px; }
  .otab { padding: 14px 22px; }
}


/* ---------- text menu rows ----------
   The printed boards carry ~390 dishes and we have photographs for a dozen.
   Rather than pad the rest with stock images that would not be the real food,
   the default presentation is the menu line itself, the way the board reads:
   name, ingredients, price. Photo cards stay for the groups we actually shot. */
.mlist { display: grid; gap: 0; }

.mrow {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}
.mrow:last-child { border-bottom: 0; }
.mrow__main { min-width: 0; }

/* Thumbnail on every line. A dish with no photograph of its own gets line art
   for its kind of food, dimmed so it reads as decoration rather than as a
   picture of the actual plate. */
.mrow__thumb {
  width: 76px; height: 76px;
  border-radius: 8px; overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.mrow__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mrow__thumb--ph img { object-fit: contain; opacity: .75; }
.mrow__name { font-size: 15px; font-weight: 600; color: var(--fg); line-height: 1.5; }
.mrow__desc {
  margin: 5px 0 0;
  font-size: 12.5px; line-height: 1.85; color: var(--muted);
}
.mrow__side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  text-align: end;
}
.mrow__price { font-size: 14.5px; font-weight: 600; color: var(--fg); white-space: nowrap; }
.mrow__price small { font-size: 11px; font-weight: 400; color: var(--muted); }
.mrow__alt { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Real size columns off the board (اسلایس / ۲۸ سانت / ۳۵ سانت …). */
.sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sizes__b {
  padding: 5px 11px;
  font: inherit; font-size: 11.5px; line-height: 1.2;
  color: var(--fg-2); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.sizes__b:hover { border-color: var(--line-2); color: var(--fg); }
.sizes__b[aria-pressed='true'] {
  background: var(--accent); border-color: var(--accent); color: #17120b; font-weight: 600;
}

@media (max-width: 560px) {
  /* thumbnail keeps its column; price and «افزودن» drop to a full-width row
     underneath both of them */
  .mrow { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; }
  .mrow__thumb { width: 62px; height: 62px; }
  .mrow__side {
    grid-column: 1 / -1;
    flex-direction: row; align-items: center; justify-content: space-between; width: 100%;
  }
}
@media (pointer: coarse) { .sizes__b { padding: 8px 14px; font-size: 12.5px; } }

@media (max-width: 560px) {
  /* Sizes side by side on a phone. Inside the name column a 375px screen has
     about 227px for roughly 320px of chips, so the third size always fell to a
     second line. The name column's contents join the row's own grid instead,
     which lets the chips run the full width of the row in equal columns — and
     if a very narrow phone still runs out of room, the words wrap inside each
     chip rather than a chip dropping below the others. */
  .mrow { row-gap: 0; }
  .mrow__main { display: contents; }
  .mrow__thumb { grid-row: span 2; }
  .mrow__name, .mrow__desc { grid-column: 2; }
  .mrow__side { margin-top: 12px; }
  .sizes {
    grid-column: 1 / -1;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 6px; margin-top: 12px;
  }
  .sizes__b {
    padding: 8px 4px; min-height: 38px;
    font-size: 12px; white-space: normal; text-align: center;
  }
}


/* ---------- units whose menu we have not been given yet ---------- */
.ostatus--soon { color: var(--muted); }
.ostatus--soon i { background: var(--muted); box-shadow: none; }

.ucard--soon .ucard__img { opacity: .55; }
.ucard--soon .ucard__go { color: var(--muted); }

.pending { padding: 40px 24px; text-align: center; }
.pending h3 { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: var(--fg); }
.pending p {
  margin: 0 auto; max-width: 46ch;
  font-size: 13.5px; line-height: 2.05; color: var(--muted);
}
.pending__acts {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 22px;
}

/* Cart thumbnail when the dish has no photograph. */
.citem__img--txt {
  display: grid; place-items: center;
  background: var(--bg-4); color: var(--accent);
  font-size: 17px; font-weight: 600;
}

/* Items whose printed card shows no price (باقلوا، کنافه): shown, but not
   orderable — the alternative is inventing a number for someone's menu. */
.mrow__poa {
  font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 999px;
  padding: 6px 12px; white-space: nowrap;
}


/* ---------- checkout form ---------- */
.cform .field { display: block; margin-bottom: 16px; }
.cform .field > span {
  display: block; margin-bottom: 7px;
  font-size: 13px; color: var(--fg-2);
}
.cform input[type='text'],
.cform input[type='tel'],
.cform textarea {
  width: 100%; padding: 12px 14px;
  font: inherit; font-size: 14px;
  color: var(--fg); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 8px;
}
.cform input:focus, .cform textarea:focus {
  outline: none; border-color: var(--accent);
}
.cform textarea { resize: vertical; line-height: 1.9; }

/* the delivery / payment choices are real radios, so the form works and is
   reachable by keyboard even if JavaScript never runs */
.optbtn--radio {
  display: block; position: relative; cursor: pointer;
  text-align: start;
}
.optbtn--radio input { position: absolute; opacity: 0; pointer-events: none; }
.optbtn--radio:has(input:checked) {
  border-color: var(--accent); background: var(--bg-4);
}
.optbtn--radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.formnote {
  margin: 16px 0; padding: 12px 14px;
  font-size: 13px; line-height: 1.95; color: var(--fg-2);
  background: var(--bg-3); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent); border-radius: 8px;
}
.formnote--bad  { border-inline-start-color: #e5484d; color: #ffb4b4; }
.formnote--good { border-inline-start-color: #46a758; color: #b6e7c0; }

/* ---------- delivery map ---------- */
.pickmap {
  height: 320px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--bg-3);
}
.maphint { margin: 0 0 9px; font-size: 12.5px; line-height: 1.9; color: var(--muted); }
.mapstate { margin: 9px 0 0; font-size: 12.5px; color: var(--muted); }
.mapstate.is-ok  { color: #7fd18f; }
.mapstate.is-bad { color: #ff9f9f; }
/* Leaflet's own controls sit light-on-light against the dark page */
.leaflet-container { background: var(--bg-3); font: inherit; }
.leaflet-control-attribution { background: rgba(0,0,0,.6) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--fg-2) !important; }

/* ---------- venue tiles ----------
   Logo and name only. No counts, no ratings, no blurb: a grid that carries
   numbers invites tenants to compare themselves against each other. */
.vsec { margin: 0 0 30px; }
.vsec__head {
  margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--fg);
  padding-inline-start: 10px; border-inline-start: 3px solid var(--accent);
}
.vgrid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
.vtile {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 14px 8px 12px; text-align: center;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  color: var(--fg); text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.vtile:hover, .vtile:focus-visible {
  border-color: var(--accent); background: var(--bg-4); transform: translateY(-2px);
}
.vtile__img {
  width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; background: var(--bg-4); flex: none;
}
.vtile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtile__name { font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.vtile__soon { font-size: 10.5px; color: var(--muted); }
.vtile--soon { opacity: .62; }
@media (max-width: 420px) {
  .vgrid { grid-template-columns: repeat(3, 1fr); }
  .vtile__img { width: 54px; height: 54px; }
}

/* ---------- menu section slider ---------- */
.menunav {
  position: sticky; z-index: 45;
  top: calc(var(--head-h, 133px) - 1px);   /* directly under the sticky site header */
  margin: 0 -4px 18px; padding: 8px 4px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) { .menunav { top: calc(var(--head-h, 75px) - 1px); } }

.menunav__track {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.menunav__track::-webkit-scrollbar { display: none; }

.menunav__chip {
  flex: none;
  padding: 9px 16px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
  white-space: nowrap;
  color: var(--fg-2); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.menunav__chip:hover { border-color: var(--line-2); color: var(--fg); }
.menunav__chip[aria-current='true'] {
  background: var(--accent); border-color: var(--accent);
  color: #17120b; font-weight: 700;
}
@media (pointer: coarse) { .menunav__chip { padding: 11px 18px; font-size: 13.5px; } }

/* the section heading has to clear the sticky header when jumped to */
.subsec { scroll-margin-top: 190px; }


/* ==========================================================================
   Order tracking — the tracker, «سفارش‌های من», «پیگیری سفارش»
   ========================================================================== */

.trk { margin: 0 0 22px; }
.trk__headline { font-size: 20px; font-weight: 700; color: var(--fg); line-height: 1.5; }
.trk__hint:empty { display: none; }
.trk__hint { margin: 6px 0 0; font-size: 13.5px; line-height: 1.95; color: var(--fg-2); }

/* the tone of the headline follows where the order is */
.trk[data-state='unpaid'] .trk__headline   { color: #f5b14c; }
.trk[data-state='done'] .trk__headline     { color: #7fd18b; }
.trk[data-state='cancelled'] .trk__headline,
.trk[data-state='returned'] .trk__headline,
.trk[data-state='expired'] .trk__headline  { color: #ff9b9b; }

.trk__steps {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; gap: 0;
}
.trk__step {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; min-width: 0;
}
/* the connector runs from this dot back to the previous one */
.trk__step + .trk__step::before {
  content: ''; position: absolute; top: 7px;
  inset-inline-end: 50%; width: 100%; height: 2px;
  background: var(--line-2);
}
.trk__step[data-state='done'] + .trk__step::before,
.trk__step[data-state='done'] + .trk__step[data-state='current']::before { background: var(--accent); }

.trk__dot {
  position: relative; z-index: 1;
  width: 16px; height: 16px; border-radius: 999px;
  background: var(--bg-2); border: 2px solid var(--line-2);
}
.trk__step[data-state='done'] .trk__dot { background: var(--accent); border-color: var(--accent); }
.trk__step[data-state='current'] .trk__dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 0 rgba(240, 144, 48, .55);
  animation: trkPulse 1.8s ease-out infinite;
}
@keyframes trkPulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 144, 48, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(240, 144, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 144, 48, 0); }
}
@media (prefers-reduced-motion: reduce) { .trk__step[data-state='current'] .trk__dot { animation: none; } }

.trk__label { font-size: 12px; line-height: 1.5; color: var(--muted); }
.trk__step[data-state='done'] .trk__label,
.trk__step[data-state='current'] .trk__label { color: var(--fg); }
.trk__step[data-state='current'] .trk__label { font-weight: 700; }

/* stopped orders: the row greys out, so nobody reads a cancelled order as
   "still at step two" */
.trk[data-state='cancelled'] .trk__steps,
.trk[data-state='returned'] .trk__steps,
.trk[data-state='expired'] .trk__steps { opacity: .45; filter: grayscale(1); }

/* a status change arrives: a short flash so it is noticed */
@keyframes trkBump { 0% { background: rgba(240, 144, 48, .16); } 100% { background: transparent; } }
.trk--bump { animation: trkBump 1.6s ease-out 1; border-radius: 8px; }

.trk--compact { margin: 12px 0 10px; }
.trk--compact .trk__headline { font-size: 15px; }
.trk--compact .trk__steps { margin-top: 12px; }
.trk--compact .trk__label { font-size: 11px; }
.trk--compact .trk__dot { width: 12px; height: 12px; }
.trk--compact .trk__step + .trk__step::before { top: 5px; }

@media (max-width: 420px) {
  .trk__headline { font-size: 18px; }
  .trk__label { font-size: 11px; }
}

/* pay-again, and the order code the counter asks for */
.paybox {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 20px; padding: 14px;
  background: var(--bg-3); border: 1px solid #f5b14c55; border-radius: 8px;
}
.paybox span { font-size: 12.5px; color: var(--muted); }

.ocode {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 16px; padding: 12px 14px;
  background: var(--bg-3); border-radius: 8px;
}
.ocode span { font-size: 12.5px; color: var(--muted); }
.ocode b { font-size: 17px; letter-spacing: .5px; }

/* «سفارش‌های من» */
.mine-h { margin: 26px 0 12px; font-size: 15px; font-weight: 600; color: var(--fg-2); }
.mine-list { display: grid; gap: 12px; }
.mine-card {
  display: block; padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: inherit; text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.mine-card:hover { border-color: var(--line-2); background: var(--bg-3); }
.mine-card--live { border-color: rgba(240, 144, 48, .35); }
.mine-card__top, .mine-card__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.mine-card__what {
  margin-top: 8px; font-size: 13.5px; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mine-card__foot { margin-top: 8px; }

.mine-badge {
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--bg-4); color: var(--fg-2);
}
.mine-badge--done      { background: rgba(70, 167, 88, .16); color: #9fe0aa; }
.mine-badge--cancelled,
.mine-badge--returned,
.mine-badge--expired   { background: rgba(229, 72, 77, .14); color: #ffb4b4; }

.mine-empty { padding: 36px 20px; text-align: center; border-radius: 8px; }
.mine-empty svg { width: 52px; height: 52px; fill: none; stroke: var(--line-2); stroke-width: 1.3; margin-bottom: 10px; }
.mine-empty p { margin: 0 0 6px; color: var(--muted); }
.mine-empty .pending__acts { justify-content: center; }

.mine-note { margin: 26px 0 0; font-size: 12.5px; line-height: 2; color: var(--muted); }

/* header shortcut to «سفارش‌های من» — the text nav is hidden on phones */
.head__mine { position: relative; }


/* ---------- checkout map: the pin is fixed, the map moves under it ---------- */
.pickmap-wrap { position: relative; }
.pickmap__pin {
  position: absolute; left: 50%; top: 50%; z-index: 650;
  width: 34px; height: 46px; margin: -45px 0 0 -17px;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45));
  transition: transform .15s ease;
}
.pickmap__shadow {
  position: absolute; left: 50%; top: 50%; z-index: 640;
  width: 12px; height: 5px; margin: -2px 0 0 -6px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); pointer-events: none;
}
/* lifted while the map is moving, set down when it stops */
.pickmap-wrap.is-moving .pickmap__pin { transform: translateY(-9px); }
.pickmap__locate {
  position: absolute; left: 10px; bottom: 14px; z-index: 800;
  padding: 8px 13px; border: 0; border-radius: 999px;
  background: #fff; color: #16100a;
  font: inherit; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: pointer;
}
.pickmap__locate:disabled { opacity: .6; cursor: wait; }
