/* Customer ordering page (mobile first). */

.app {
  max-width: 980px; margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 16px calc(120px + var(--safe-b));
}

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 18px; border-radius: 26px; margin-bottom: 14px;
  animation: rise 0.6s var(--ease) both;
}
.greet { min-width: 0; }
.hello { font-size: 13px; font-weight: 600; color: var(--muted); }
.topbar h1 { margin: 3px 0 0; font-size: clamp(19px, 5.4vw, 26px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 800; }
.loc-pill {
  display: flex; align-items: center; gap: 6px; flex: 0 1 auto; max-width: 46%;
  padding: 9px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--glass-strong); border: 1px solid var(--stroke);
  transition: transform 0.2s var(--spring), border-color 0.2s;
}
.loc-pill:active { transform: scale(0.95); }
.loc-pill #locName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-pill.needed { border-color: var(--warn); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); } 50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); } }

/* ---------- live order banner ---------- */
.live-orders { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.live-orders:empty { display: none; }
.live {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 18px; animation: rise 0.5s var(--ease) both;
}
.live .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6); animation: ping 1.6s infinite; }
.live.preparing .dot { background: var(--accent-2); }
.live.delivered .dot { background: var(--ok); animation: none; }
.live.cancelled .dot { background: var(--danger); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.live .txt { flex: 1; min-width: 0; }
.live b { display: block; font-size: 14px; }
.live small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .go { color: var(--muted); font-weight: 700; }

/* ---------- categories ---------- */
.cats-wrap { position: sticky; top: calc(8px + var(--safe-t)); z-index: 20; margin-bottom: 18px; }
.cats {
  position: relative; display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
  animation: rise 0.6s 0.08s var(--ease) both;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  position: relative; z-index: 1; flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap;
  transition: color 0.35s var(--ease);
}
.cat .emo { font-size: 19px; transition: transform 0.45s var(--spring); }
.cat.on { color: #fff; }
.cat.on .emo { transform: scale(1.18) rotate(-8deg); }
.cat-ind {
  position: absolute; z-index: 0; left: 0; top: 6px; height: 44px; width: 0; border-radius: 999px;
  background: var(--grad); box-shadow: var(--glow);
  transition: transform 0.5s var(--spring), width 0.5s var(--spring);
}

/* ---------- item grid ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.section-title span { color: var(--muted); font-size: 13px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; --dx: 0px; }
@media (max-width: 330px) { .grid { grid-template-columns: 1fr; } }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.card {
  position: relative; display: flex; flex-direction: column; gap: 9px; text-align: left;
  padding: 9px 9px 13px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  animation: cardIn 0.6s var(--spring) backwards; /* not "both": a held end frame would block :active/:hover transforms */
  animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes cardIn {
  from { opacity: 0; transform: translate(var(--dx), 26px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.card:active { transform: scale(0.96); }
@media (hover: hover) { .card:hover { border-color: var(--stroke-strong); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); } }
.grid.leaving .card { animation: cardOut 0.16s var(--ease) forwards; }
@keyframes cardOut { to { opacity: 0; transform: translate(calc(var(--dx) * -1), 0) scale(0.96); } }

.ph {
  position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden;
  display: grid; place-items: center; font-size: clamp(40px, 12vw, 56px);
  background: var(--grad-soft);
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plus {
  position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; font-weight: 600; color: #fff;
  background: rgba(10, 12, 29, 0.45); border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.in-cart {
  position: absolute; left: 8px; top: 8px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: var(--glow); animation: pop 0.45s var(--spring);
}
.in-cart:empty { display: none; }
.card .nm { font-weight: 700; font-size: 15px; line-height: 1.25; padding: 0 4px; }
.card .ds {
  font-size: 12px; color: var(--muted); padding: 0 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card.off { opacity: 0.55; }
.card.off .ph::after {
  content: 'Out of stock'; position: absolute; inset: auto 8px 8px 8px; padding: 6px; border-radius: 10px;
  text-align: center; font-size: 12px; font-weight: 700; background: rgba(10, 12, 29, 0.7);
}
.card.off .plus { display: none; }

.skel { height: 220px; border-radius: 24px; background: linear-gradient(100deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 70%); background-size: 300% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--muted); border-radius: 24px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* ---------- cart bar ---------- */
.cart-bar {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + var(--safe-b));
  max-width: 560px; margin: 0 auto; height: 64px; padding: 0 10px 0 10px; border-radius: 22px;
  display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 16px;
  background: var(--grad); box-shadow: 0 16px 44px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(calc(100% + 40px)); transition: transform 0.55s var(--spring);
}
.cart-bar.show { transform: none; }
.cart-bar.bump { animation: bump 0.45s var(--spring); }
@keyframes bump { 40% { transform: scale(1.05); } }
.cart-count {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.22); font-size: 17px; font-weight: 800;
}
.cart-label { flex: 1; text-align: left; }
.cart-go { padding-right: 8px; font-size: 14px; opacity: 0.9; }

/* ---------- item sheet ---------- */
.hero {
  position: relative; height: clamp(180px, 46vw, 240px); border-radius: 24px; overflow: hidden;
  display: grid; place-items: center; font-size: 84px; background: var(--grad-soft); margin-bottom: 18px;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: zoomIn 0.8s var(--ease) both; }
@keyframes zoomIn { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero .close-float {
  position: absolute; top: 10px; right: 10px; background: rgba(10, 12, 29, 0.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.item-name { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.item-desc { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.opt-group { margin-bottom: 20px; }
.opt-group .label { display: block; margin-bottom: 10px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); }
.qty-row b { font-size: 15px; }
.foot-row { display: flex; gap: 10px; }
.foot-row .btn-primary { flex: 1; }

/* ---------- cart sheet ---------- */
.line {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke);
  animation: rise 0.4s var(--ease) both;
}
.line.removing { animation: lineOut 0.3s var(--ease) forwards; }
@keyframes lineOut { to { opacity: 0; transform: translateX(40px); height: 0; margin: 0; padding: 0; } }
.line .th { position: relative; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; font-size: 26px; background: var(--grad-soft); }
.line .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.line .info { flex: 1; min-width: 0; }
.line .info b { display: block; font-size: 15px; }
.line .info small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.deliver {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); margin-bottom: 16px;
}
.deliver .big { font-size: 24px; }
.deliver .txt { flex: 1; }
.deliver small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.deliver b { font-size: 16px; }
.deliver .chg { color: var(--accent-2); font-weight: 700; font-size: 13px; }
.deliver.needed { border-color: var(--warn); }
.divider { height: 1px; background: var(--stroke); margin: 8px 0 18px; }

/* ---------- location list ---------- */
.loc-list { display: grid; gap: 10px; }
.loc-opt {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; text-align: left;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); font-weight: 700; font-size: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.loc-opt.on { border-color: transparent; background: var(--grad); box-shadow: var(--glow); }

/* ---------- tracking ---------- */
.success { text-align: center; padding: 6px 0 4px; }
.check {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 14px 44px rgba(99, 102, 241, 0.6); animation: pop 0.7s var(--spring) both;
}
.check path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw 0.5s 0.35s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success h3 { margin: 0 0 6px; font-size: 22px; }
.success p { margin: 0; color: var(--muted); font-size: 14px; }
.confetti { position: fixed; top: 0; left: 0; width: 10px; height: 14px; border-radius: 3px; z-index: 60; pointer-events: none; animation: fall 1.6s var(--ease) forwards; }
@keyframes fall { to { transform: translate(var(--x), 100vh) rotate(var(--r)); opacity: 0; } }

.steps { position: relative; display: flex; justify-content: space-between; margin: 26px 4px 22px; }
.steps::before { content: ''; position: absolute; left: 30px; right: 30px; top: 19px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.steps .bar { position: absolute; left: 30px; top: 19px; height: 4px; border-radius: 4px; background: var(--grad); transition: width 0.8s var(--ease); }
.step { position: relative; z-index: 1; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--faint); text-align: center; }
.step i {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 18px;
  background: #1a1c38; border: 2px solid rgba(255, 255, 255, 0.18); transition: background 0.4s, border-color 0.4s, transform 0.4s var(--spring);
}
.step.done { color: var(--text); }
.step.done i { background: var(--grad); border-color: transparent; }
.step.now i { transform: scale(1.12); animation: glowPulse 1.8s infinite; }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); } 50% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); } }
.status-msg { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.status-msg.cancelled { color: var(--danger); }
.summary { padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); }
.summary .row { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; }
.summary .row + .row { border-top: 1px dashed var(--stroke); }
.summary .row b { min-width: 30px; }
.summary .row small { display: block; color: var(--muted); font-size: 12px; }
.meta-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 12px; }
