/* Customer shop: phone first; on wide screens (the kiosk) the cart becomes a sidebar. */
body.shop-body {
  background:
    radial-gradient(1200px 500px at 50% -260px, rgba(0, 229, 122, 0.10), transparent 70%),
    var(--bg);
}

.shop-head {
  max-width: 1280px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand > div { min-width: 0; }
.brand-mark {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #00b862); color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(0, 229, 122, 0.25);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand h1 {
  font: 800 1.35rem/1.1 var(--font-display); letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 420px) { .brand h1 { font-size: 1.2rem; } }
.brand p { font-size: 0.85rem; color: var(--text-3); margin-top: 3px; }

.steps {
  max-width: 1280px; margin: 10px auto 0; padding: 0 16px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-2); white-space: nowrap;
}
.step-chip b {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: 0.72rem;
}

.notice {
  max-width: 1280px; margin: 14px auto 0; padding: 0 16px;
}
.notice-inner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid rgba(255, 176, 32, 0.35); color: #ffe3b0;
  font-size: 0.92rem;
}
.notice-inner svg { width: 20px; height: 20px; flex: none; color: var(--warn); margin-top: 1px; }

.shop {
  max-width: 1280px; margin: 0 auto;
  padding: 16px 16px calc(120px + var(--safe-bottom));
}

/* ── product grid ─────────────────────────────────────────────────────── */
.menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .menu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 820px) { .menu { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.15s;
}
.product.in-cart { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.product .photo { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; }
.product-body { display: grid; gap: 4px; padding: 0 4px; flex: 1; align-content: start; }
.product-name {
  font-size: 0.95rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.product-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.price { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.stock-note { font-size: 0.75rem; font-weight: 600; color: var(--text-3); }
.stock-note.low { color: var(--warn); }
.product-action .btn { width: 100%; min-height: 44px; border-radius: 13px; }
.product-action .stepper { width: 100%; justify-content: space-between; }
.product.sold-out .photo img { filter: grayscale(1); opacity: 0.45; }
.product.sold-out .product-name, .product.sold-out .price { color: var(--text-3); }
.sold-badge {
  position: absolute; left: 8px; top: 8px; padding: 4px 9px; border-radius: 999px;
  background: rgba(11, 14, 19, 0.85); color: var(--text); font-size: 0.72rem; font-weight: 700;
}

.empty-menu {
  grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}

/* ── cart: bottom sheet on phones, sidebar on wide screens ────────────── */
.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 8px 8px 8px 18px; border: 0; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  text-align: left; cursor: pointer;
  transform: translateY(140%); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.cart-bar.is-on { transform: none; }
.cart-bar-count {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-ink); color: var(--accent); font-weight: 800; font-size: 0.9rem;
}
.cart-bar-text { flex: 1; min-width: 0; line-height: 1.2; }
.cart-bar-text strong { display: block; font-size: 1.05rem; }
.cart-bar-text span { display: block; font-size: 0.8rem; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-bar-go {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; min-height: 48px;
  border-radius: 14px; background: var(--accent-ink); color: var(--accent); font-weight: 700;
}
.cart-bar-go svg { width: 18px; height: 18px; }

.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.backdrop.is-on { opacity: 1; pointer-events: auto; }

.cart {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border-strong);
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow);
  transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.cart.is-open { transform: none; }
.cart-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 10px auto 0; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 8px; }
.cart-head h2 { font: 800 1.2rem/1.2 var(--font-display); }
.cart-lines { overflow-y: auto; padding: 4px 18px; flex: 1; -webkit-overflow-scrolling: touch; }
.cart-line {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: 0; }
/* a drink that was just added slides in at the top of the cart and flashes green */
.cart-line.is-new { animation: line-in 0.8s ease-out; }
@keyframes line-in {
  0% { background: var(--accent-soft); transform: translateY(-10px); opacity: 0; }
  35% { opacity: 1; }
  100% { background: transparent; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cart-line.is-new { animation: none; } }
.cart-line .photo { width: 52px; height: 52px; border-radius: 12px; }
.cart-line-name { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.cart-line-price { font-size: 0.82rem; color: var(--text-3); }
.cart-line .stepper button { width: 34px; height: 34px; }
.cart-empty { text-align: center; padding: 30px 10px; color: var(--text-3); font-size: 0.92rem; }
.cart-empty svg { width: 34px; height: 34px; margin: 0 auto 10px; display: block; opacity: 0.6; }
.cart-foot { padding: 14px 18px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--border); display: grid; gap: 10px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total span { color: var(--text-2); font-size: 0.92rem; }
.cart-total strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.cart-error {
  padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: #ffd5d8; font-size: 0.88rem;
}
.secure-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-3);
}
.secure-note svg { width: 14px; height: 14px; }

@media (min-width: 1000px) {
  .shop { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; padding-bottom: 32px; }
  .menu { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .cart {
    position: sticky; top: 16px; left: auto; right: auto; bottom: auto; z-index: 1;
    /* The cart starts below the header, so leave room for it: the list scrolls inside the cart
       while the total and the Pay button always stay on screen, however many drinks are in it. */
    max-height: calc(100dvh - 150px); transform: none; border-radius: var(--radius-lg);
    border: 1px solid var(--border);
  }
  .cart-grip, .cart-close, .cart-bar, .backdrop { display: none !important; }
}

/* ── order status page ────────────────────────────────────────────────── */
.order-wrap {
  min-height: 100dvh; display: grid; place-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(24px + var(--safe-bottom));
}
.order-card {
  width: 100%; max-width: 460px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
  padding: 32px 22px 24px; box-shadow: var(--shadow);
}
.stage-icon {
  width: 92px; height: 92px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--accent-soft); color: var(--accent-text);
}
.stage-icon svg { width: 44px; height: 44px; }
.stage-icon.is-wait::after, .stage-icon.is-busy::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid var(--accent-line); border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
}
.stage-icon.is-wait { background: var(--info-soft); color: var(--info); }
.stage-icon.is-wait::after { border-color: rgba(106, 168, 255, 0.3); border-top-color: var(--info); }
.stage-icon.is-bad { background: var(--danger-soft); color: var(--danger); }
.stage-icon.is-warn { background: var(--warn-soft); color: var(--warn); }
.stage-icon.is-done { animation: pop 0.4s ease-out; }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.order-card h1 { font: 800 1.6rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.order-sub { color: var(--text-2); margin-top: 10px; font-size: 0.98rem; }
.vend-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0 4px; flex-wrap: wrap; }
.vend-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); transition: background 0.3s; }
.vend-dot.done { background: var(--accent); }
.order-items {
  list-style: none; margin: 22px 0 0; padding: 14px 16px; text-align: left;
  background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
}
.order-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.92rem; }
.order-items li span:last-child { color: var(--text-2); white-space: nowrap; }
.order-items li span:only-child { color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }
.order-items .total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 700; }
.order-items .total span:last-child { color: var(--text); }
.order-actions { margin-top: 22px; display: grid; gap: 10px; }
.order-ref { margin-top: 16px; font-size: 0.75rem; color: var(--text-3); letter-spacing: 0.04em; }
.countdown { font-size: 0.8rem; color: var(--text-3); }

.test-badge {
  flex: none; padding: 5px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.05em; background: var(--info-soft); color: var(--info); border: 1px solid rgba(106, 168, 255, 0.35);
}
