:root {
  --bg-deep: #17110d;
  --bg-deep-2: #241b15;
  --cream: #fff8f0;
  --ink: #2b2320;
  --ink-soft: rgba(43, 35, 32, .6);
  --accent: #ff6b4a;
  --accent-deep: #e6482b;
  --white: #ffffff;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior-y: none;
  background: var(--bg-deep);
  font-family: 'Quicksand', system-ui, sans-serif;
  color: var(--ink);
}

svg { display: block; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* transform makes .stage the containing block for position:fixed
     descendants too, so the sheet/toast/pill stay locked to the frame
     instead of the whole browser viewport once we start framing it below */
  transform: translateZ(0);
}

/* Landscape tablets/kiosk stands & desktop: present the vertical feed as a
   framed device card, centered with room around it, instead of stretching
   it edge-to-edge (a 9:16 video full-bleed across a landscape screen would
   look broken). Gated on orientation + aspect-ratio rather than plain
   min-width, so portrait tablets (e.g. an iPad/Xiaomi Pad held upright,
   which easily exceeds 720px of width) still get the immersive full-screen
   treatment like a phone instead of shrinking into a tiny centered card. */
@media (min-aspect-ratio: 4/5) and (min-width: 600px) {
  .app {
    padding: 4vh 4vw;
    background:
      radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 107, 74, .12), transparent 60%),
      var(--bg-deep);
  }
  .stage {
    width: auto;
    height: 100%;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    border-radius: 32px;
    box-shadow: 0 40px 110px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
  }
}

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding: max(16px, env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(to bottom, rgba(10,7,5,.68) 0%, rgba(10,7,5,.4) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 19px;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 7px;
  text-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,.14);
}
.brand-sub {
  font-size: 11.5px;
  font-weight: 500;
  opacity: .68;
  font-family: 'Quicksand', sans-serif;
  letter-spacing: .02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.22);
  background: rgba(15,10,8,.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .3s var(--spring), background .3s var(--smooth);
}
.icon-btn:active { transform: scale(.88); }

/* language switch */
.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(15,10,8,.4);
  border: 1.5px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  pointer-events: auto;
}
.lang-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,.6);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .02em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .3s var(--smooth), color .3s var(--smooth), transform .3s var(--spring);
}
.lang-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.lang-btn:active { transform: scale(.9); }

/* category chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
  padding-bottom: 2px;
  cursor: grab;
}
.chips::-webkit-scrollbar { display: none; }
.chips.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.chips.dragging .chip { pointer-events: none; }

.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.22);
  background: rgba(15,10,8,.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* backdrop-filter's blur region can otherwise bleed past the pill's
     rounded corners as a faint rectangular halo (visible on .active,
     which has an opaque background and no longer needs the blur) */
  overflow: hidden;
  color: rgba(255,255,255,.92);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .35s var(--smooth), border-color .35s var(--smooth), transform .35s var(--spring), box-shadow .35s var(--smooth);
  white-space: nowrap;
}
.chip svg { flex: none; opacity: .85; }
.chip.active {
  background: linear-gradient(135deg, var(--chip-tint, var(--accent)), color-mix(in srgb, var(--chip-tint, var(--accent)) 70%, #000));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -4px var(--chip-tint, var(--accent));
  transform: scale(1.045);
}
.chip.active svg { opacity: 1; }
.chip:active { transform: scale(.94); }

/* ---------- Feed ----------
   Cards are stacked on top of each other (not a scrolling list) and
   cross-fade + zoom between one another under JS control — deliberately
   not a snap-scroll list, which is the TikTok-style transition we're
   avoiding here. */
.feed {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(165deg, var(--bg-deep-2), var(--bg-deep));
  opacity: 0;
  transform: scale(.94);
  transition: opacity .65s var(--smooth), transform .75s var(--smooth);
  pointer-events: none;
  z-index: 1;
}
.card.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 2;
}
.feed.no-anim .card { transition: none; }

.card-bg {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    radial-gradient(ellipse 85% 60% at 50% 18%, var(--tint-soft, rgba(255,107,74,.3)), transparent 65%),
    linear-gradient(165deg, var(--bg-deep-2), var(--bg-deep));
  animation: breathe 10s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.card-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.05) 0%,
    rgba(0,0,0,0) 32%,
    rgba(0,0,0,.18) 55%,
    rgba(0,0,0,.78) 100%);
}

.card-icon-badge {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  color: var(--tint, var(--accent));
  opacity: .22;
  animation: float 5.5s ease-in-out infinite;
  /* must stay below .card-video (-2): otherwise the icon shows through
     on top of a playing video since both were painted at the same level */
  z-index: -3;
}
.card-icon-badge svg { width: 100%; height: 100%; }
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -53%) scale(1.05); }
}

/* ---------- Card content ---------- */
.card-info {
  position: relative;
  z-index: 5;
  padding: 20px 22px 32px;
  color: #fff;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s var(--smooth), transform .6s var(--smooth);
}
.card.active .card-info {
  opacity: 1;
  transform: translateY(0);
}

.card-category {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--tint, var(--accent));
  margin-bottom: 8px;
}
.card-category::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.card-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.16;
  margin: 0 0 8px;
  text-shadow: 0 4px 16px rgba(0,0,0,.35);
}

.card-desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(255,255,255,.82);
  margin: 0 0 18px;
  max-width: 42ch;
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-price {
  font-family: 'Fredoka', sans-serif;
  font-size: 21px;
  font-weight: 600;
  color: #fff;
}

.add-btn {
  border: none;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 10px 26px rgba(255, 77, 61, .45);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: transform .3s var(--spring), box-shadow .3s var(--spring);
}
.add-btn:active { transform: scale(.92); }
.add-btn.bump { animation: bump .45s var(--spring); }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- Swipe hint ---------- */
.swipe-hint {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: .85;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: opacity .5s var(--smooth);
  pointer-events: none;
}
.swipe-hint.hide { opacity: 0; }
.swipe-hint-arrow { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Cart pill ---------- */
.cart-pill {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(0);
  z-index: 40;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2b2320, #46362f);
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 14px 32px rgba(0,0,0,.45);
  transition: transform .4s var(--spring), opacity .4s var(--smooth);
  opacity: 0;
  pointer-events: none;
}
.cart-pill.show { opacity: 1; pointer-events: auto; }
.cart-pill.bump { animation: pillBump .5s var(--spring); }
@keyframes pillBump {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); }
}
.cart-pill-icon { color: var(--accent); }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 8, .55);
  backdrop-filter: blur(3px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--smooth);
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  max-height: 78%;
  background: var(--cream);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(0,0,0,.3);
  transform: translateY(105%);
  transition: transform .5s var(--smooth);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: translateY(0); }

.sheet-handle {
  width: 38px; height: 5px;
  border-radius: 999px;
  background: rgba(43,35,32,.18);
  margin: 12px auto 4px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
}
.sheet-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  margin: 0;
}
.sheet-close {
  border: none;
  background: rgba(43,35,32,.08);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-items {
  overflow-y: auto;
  padding: 8px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(43,35,32,.06);
  animation: itemIn .35s var(--smooth);
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sheet-item-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tint, var(--accent)) 16%, #fff);
  color: var(--tint, var(--accent));
  border-radius: 13px;
  flex: none;
}
.sheet-item-icon svg { width: 21px; height: 21px; }
.sheet-item-info { flex: 1; min-width: 0; }
.sheet-item-name { font-weight: 700; font-size: 14px; }
.sheet-item-price { font-size: 12px; color: var(--ink-soft); }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border-radius: 999px;
  padding: 4px;
}
.stepper button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .2s var(--spring);
}
.stepper button svg { width: 12px; height: 12px; }
.stepper button:active { transform: scale(.85); }
.stepper span { min-width: 16px; text-align: center; font-weight: 700; font-size: 13px; }

.sheet-footer {
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(43,35,32,.08);
  background: var(--cream);
}
.sheet-total {
  display: flex;
  justify-content: space-between;
  font-family: 'Fredoka', sans-serif;
  font-size: 16.5px;
  margin-bottom: 12px;
}
.checkout-btn {
  width: 100%;
  border: none;
  padding: 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(255, 77, 61, .4);
  transition: transform .3s var(--spring);
}
.checkout-btn:active { transform: scale(.96); }

.sheet-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Menu overview sheet ---------- */
.menu-sheet { max-height: 85%; }

.menu-list {
  overflow-y: auto;
  padding: 4px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-group-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tint, var(--accent));
  margin: 16px 2px 6px;
}
.menu-group-title:first-child { margin-top: 4px; }

.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .25s var(--smooth), transform .2s var(--spring);
}
.menu-row:active {
  background: rgba(43,35,32,.06);
  transform: scale(.98);
}
.menu-row-price {
  flex: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 12px 18px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0,0,0,.2);
  transform: translate(-50%, -140%);
  transition: transform .55s var(--spring);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast-icon { color: var(--accent); flex: none; }
.toast-title { font-weight: 700; font-size: 14px; }
.toast-sub { font-size: 11.5px; color: var(--ink-soft); }
