/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --surface:     #161616;
  --border:      rgba(255,255,255,0.08);
  --green:       #4ade80;
  --green-dim:   #22c55e;
  --red:         #f87171;
  --text:        #ffffff;
  --text-sub:    rgba(255,255,255,0.6);
  --text-dim:    rgba(255,255,255,0.35);
  --card-radius: 22px;
  --header-h:    56px;
  --cats-h:      52px;
  --action-h:    72px;
  --swipe-h:     72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  /* dvh = dynamic viewport height — shrinks/grows as browser chrome hides/shows */
  height: -webkit-fill-available;
  height: 100dvh;
}
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input  { font-family: inherit; }

.hidden { display: none !important; }

/* ─── App Shell ─────────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  animation: fadeIn .4s ease;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.modal-paw {
  font-size: 52px;
  margin-bottom: 16px;
  animation: floatPaw 2.5s ease-in-out infinite;
}

@keyframes floatPaw {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.modal-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 30%, var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 28px;
}

/* ─── How-to-use guide grid ──────────────────────────────── */
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 28px;
}

.guide-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 12px 18px;
  gap: 10px;
}

.guide-arrow--skip { color: var(--red); }
.guide-arrow--add  { color: var(--green); }

.guide-big-emoji { font-size: 26px; line-height: 1; }

.guide-filter-icon { color: var(--text-sub); }

.guide-cell-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.start-btn {
  width: 100%;
  padding: 17px 24px;
  background: var(--green);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, opacity .15s;
  margin-bottom: 14px;
}
.start-btn:active { transform: scale(0.97); opacity: .9; }
.btn-arrow { font-size: 18px; }

/* ─── Main wrapper ───────────────────────────────────────── */
#main {
  flex: 1;           /* fill #app (which is position:fixed full-viewport flex column) */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;     /* lets flex children shrink below their natural size */
  pointer-events: none; /* pass touches through transparent areas to the card */
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: all;
  background: transparent;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon { width: 36px; height: 36px; object-fit: contain; }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .2s, transform .15s;
}
.cart-btn:active { transform: scale(0.92); }

/* ─── Header Filter Buttons ──────────────────────────────── */
.header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 50px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.filter-pill.active {
  background: rgba(74,222,128,0.18);
  border-color: rgba(74,222,128,0.4);
  color: var(--green);
}
.filter-pill:active { transform: scale(0.93); }

.filter-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  transition: background .2s, color .2s, transform .15s;
}
.filter-icon-btn.active {
  background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.4);
  color: #fbbf24;
}
.filter-icon-btn:active { transform: scale(0.92); }

.allergen-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #fbbf24;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Allergen Sheet ─────────────────────────────────────── */
.allergen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.allergen-sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px 32px;
}
.allergen-header { margin: 12px 0 20px; }
.allergen-title  { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.allergen-sub    { font-size: 13px; color: var(--text-sub); }
.allergen-chips  { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.allergen-chip {
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background .2s, border-color .2s, color .2s;
}
.allergen-chip.active {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.5);
  color: #fca5a5;
}
.allergen-footer {
  display: flex;
  gap: 12px;
}
.btn-ghost-sm {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
}
.btn-primary-sm {
  flex: 2;
  height: 48px;
  border-radius: 14px;
  background: var(--green);
  border: none;
  color: #000;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--green);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badgePop .25s cubic-bezier(0.175,0.885,0.32,1.5);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ─── Category Tabs ──────────────────────────────────────── */
.categories-wrap {
  height: var(--cats-h);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  pointer-events: all;
  background: transparent;
}

/* Left + right edge fade — hints at more tabs */
.categories-wrap::before,
.categories-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  z-index: 2;
  pointer-events: none;
}
.categories-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.4) 20%, transparent);
}
.categories-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(0,0,0,0.4) 20%, transparent);
}

.categories {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  height: 100%;
  align-items: center;
  overflow-x: scroll;   /* JS controls this via scrollLeft */
  scrollbar-width: none;
  cursor: grab;
  will-change: scroll-position;
}
.categories.dragging { cursor: grabbing; }
.categories::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.08);
  transition: color .22s, background .22s, border-color .22s,
              transform .18s, box-shadow .22s, font-size .22s, padding .22s;
  white-space: nowrap;
  user-select: none;
}
.cat-tab.active {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  font-size: 14px;
  padding: 9px 22px;
  box-shadow: 0 0 18px rgba(74,222,128,0.35);
}

/* ─── Card Area ──────────────────────────────────────────── */
.card-area {
  flex: 1;
  position: relative;
  overflow: visible;
  padding: 0;
  pointer-events: none;
  background: transparent;
}

/* ─── Card Stack ─────────────────────────────────────────── */
.card-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  will-change: transform;
  touch-action: none;
  cursor: grab;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transition: transform .35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card:active { cursor: grabbing; }

.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  transition: transform .4s ease;
  animation: shimmer 2s ease-in-out infinite;
}
/* Stop shimmer once image has loaded, or when there is no image */
.card-bg[style*="url("],
.card-bg.no-image { animation: none; }

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

.card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5,5,5,0.97) 0%,
    rgba(5,5,5,0.72) 35%,
    rgba(5,5,5,0.15) 60%,
    transparent 100%
  );
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* "Not our image" stamp — marks placeholder photos that aren't from the café */
.image-stamp {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) rotate(-9deg);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 22px;
  border: 3px solid rgba(255,255,255,0.92);
  border-radius: 12px;
  background: rgba(20,20,20,0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
  color: #fff;
}
.image-stamp-icon  { font-size: 22px; line-height: 1; }
.image-stamp-title { font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.image-stamp-sub   { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; opacity: 0.9; text-transform: none; }

/* Peek mode: hide all overlays so the image is fully visible */
.card--peek .card-gradient,
.card--peek .card-side-badges,
.card--peek .card-info {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.card-side-badges { transition: opacity 0.3s ease; }
.card-info        { transition: opacity 0.3s ease; }


/* All badges — stacked vertically at middle-right */
.card-side-badges {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(10px);
}
.badge-new     { background: rgba(250,204,21,0.25); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.badge-popular { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.badge-veg     { background: rgba(74,222,128,0.2); color: var(--green); border: 1px solid rgba(74,222,128,.25); font-size: 13px; }
.badge-spicy      { background: rgba(248,113,113,0.18); color: #fca5a5; border: 1px solid rgba(248,113,113,.25); font-size: 13px; }
.badge-signature  { background: rgba(251,191,36,0.18); color: #fbbf24; border: 1px solid rgba(251,191,36,.35); }

/* Like / Nope indicators */
.like-indicator,
.nope-indicator {
  position: absolute;
  top: calc(var(--header-h) + var(--cats-h) + 12px);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  line-height: 1.3;
  transform: rotate(-15deg);
}
.like-indicator {
  left: 24px;
  color: var(--green);
  border: 3px solid var(--green);
  transform: rotate(-15deg);
}
.nope-indicator {
  right: 24px;
  color: var(--red);
  border: 3px solid var(--red);
  transform: rotate(15deg);
}

/* Card Info overlay */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px calc(var(--swipe-h) + 16px);
  pointer-events: none;
}

.card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--green);
  margin-bottom: 6px;
}

.card-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.1;
  margin-bottom: 8px;
  pointer-events: all;
  cursor: pointer;
}

.card-description {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: all;
  cursor: pointer;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: all;
}
.card-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-meta-right .badge {
  padding: 5px 8px;
  font-size: 14px;
}

.card-price {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.card-love-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  border-radius: 20px;
  padding: 4px 10px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.price-large {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.7;
}

.cal-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background .2s, color .2s;
  cursor: pointer;
}
.cal-toggle.revealed {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.3);
  color: #fca5a5;
}
.cal-toggle:active { transform: scale(0.95); }

/* ─── Like Button ────────────────────────────────────────── */

/* ─── Heart Burst Animation ──────────────────────────────── */
.heart-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform-origin: center;
  animation: heartFloat var(--dur, 1s) ease-out forwards;
  will-change: transform, opacity;
}
@keyframes heartFloat {
  0%   { opacity: 1;   transform: translate(0, 0)                          scale(1)   rotate(0deg); }
  20%  { opacity: 1;   transform: translate(calc(var(--drift)*0.2), -60px) scale(1.35) rotate(calc(var(--spin)*0.3)); }
  60%  { opacity: 0.8; transform: translate(calc(var(--drift)*0.7), -180px) scale(0.9) rotate(calc(var(--spin)*0.7)); }
  100% { opacity: 0;   transform: translate(var(--drift), -280px)           scale(0.2) rotate(var(--spin)); }
}

/* ─── Nutrition Panel ────────────────────────────────────── */
.nutrition-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 32px 28px;
  gap: 0;
  pointer-events: all;
  animation: fadeIn .2s ease;
}

.nutrition-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--green);
  margin-bottom: 16px;
  text-align: center;
}

.nutrition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}
.nutrition-row:last-of-type { border-bottom: none; }
.nutrition-row span:last-child { font-weight: 700; color: #fff; }

.nutrition-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

/* Full description panel — anchored to bottom, grows upward to fit text */
.desc-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 78%;
  background: rgba(5,5,5,0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
  border-radius: 20px 20px 0 0;
}
.desc-panel.hidden { display: none; }
.desc-panel-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.4px;
  margin-bottom: 12px;
}
.desc-panel-text {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
}
.desc-panel-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: .03em;
}


/* ─── Action Bar ─────────────────────────────────────────── */
.swipe-buttons {
  height: var(--swipe-h);
  padding: 0 24px calc(var(--safe-bottom) + 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: all;
  z-index: 10;
  position: relative;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20,20,20,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 60px;
  padding: 8px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.06) inset;
}

.action-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.5);
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
}
.action-icon-btn:active {
  transform: scale(0.88);
  background: rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.85);
}

.action-like-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 50px;
  border-radius: 50px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.11);
  color: #fff;
  transition: background .15s, border-color .15s, transform .1s;
  flex-shrink: 0;
}
.action-like-btn:active  { transform: scale(0.93); }
.action-like-btn:disabled { opacity: 0.45; }
#bottom-like-heart { font-size: 22px; line-height: 1; }
#bottom-like-count {
  font-size: 15px;
  font-weight: 800;
  min-width: 14px;
  color: rgba(255,255,255,0.75);
  letter-spacing: -0.3px;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
  pointer-events: all;
}

.empty-emoji { font-size: 56px; margin-bottom: 4px; }

.empty-state h2 {
  font-size: 24px;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-sub);
  font-size: 15px;
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
}

.btn-primary {
  padding: 15px 24px;
  background: var(--green);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50px;
  transition: transform .15s, opacity .15s;
}
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  padding: 14px 24px;
  background: transparent;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.25); color: var(--text); }
.btn-ghost:active { transform: scale(0.97); }

#empty-cat-label { color: var(--green); }


/* ─── Cart Overlay ───────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  animation: fadeIn .25s ease;
}

.cart-sheet {
  width: 100%;
  max-height: 88vh;
  background: #111;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp .35s cubic-bezier(0.25,0.46,0.45,0.94);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.cart-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.cart-header {
  padding: 16px 20px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-title {
  font-size: 20px;
  font-weight: 700;
}

.cart-table-label {
  font-size: 13px;
  color: var(--text-sub);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.cart-qty-btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 300;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.cart-qty-btn:active { background: rgba(255,255,255,.08); }
.cart-qty-num {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.cart-footer {
  padding: 16px 20px calc(var(--safe-bottom) + 16px);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}

.cart-total-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cart-total-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}
.gst-note {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.2px;
}

.counter-btn {
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: transform .15s, opacity .15s;
}
.counter-btn:active { transform: scale(0.97); opacity: .9; }

/* ─── Counter Overlay ────────────────────────────────────── */
.counter-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  animation: fadeIn .3s ease;
}

.counter-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.counter-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--green);
  text-align: center;
  margin-bottom: 8px;
}

.counter-table {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.counter-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.counter-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.counter-item-qty {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
  min-width: 32px;
}

.counter-item-name {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
}

.counter-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-sub);
}

.counter-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0 12px;
}

.counter-total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  font-size: 18px;
  font-weight: 600;
}

.counter-total-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -1px;
}

.counter-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.counter-close-btn {
  width: 100%;
  padding: 14px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  transition: border-color .2s, color .2s;
}
.counter-close-btn:active { transform: scale(0.97); }

.close-cart-btn {
  width: 100%;
  padding: 14px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  transition: border-color .2s, color .2s;
}
.close-cart-btn:hover { border-color: rgba(255,255,255,.25); color: var(--text); }
.close-cart-btn:active { transform: scale(0.97); }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--swipe-h) + var(--action-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ─── Install Banner ─────────────────────────────────────── */
/* ─── Update Banner ─────────────────────────────────────── */
.update-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: calc(100% - 32px);
  max-width: 400px;
  animation: slideDownFade .35s cubic-bezier(0.25,0.46,0.45,0.94);
  pointer-events: all;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.update-banner-inner {
  background: rgba(22,22,22,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(74,222,128,.08);
}

.update-icon { font-size: 20px; flex-shrink: 0; }

.update-text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.update-reload-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  background: var(--green);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50px;
  transition: transform .15s;
}
.update-reload-btn:active { transform: scale(0.95); }

.update-dismiss {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-sub);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-banner {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 12px);
  left: 12px;
  right: 12px;
  z-index: 400;
  animation: slideUpBanner .4s cubic-bezier(0.25,0.46,0.45,0.94);
}
@keyframes slideUpBanner {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.install-banner-inner {
  background: rgba(22,22,22,0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(74,222,128,.1);
}

.install-icon { font-size: 26px; flex-shrink: 0; }

.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-text strong { font-size: 13px; font-weight: 700; color: var(--text); }
.install-text span   { font-size: 11px; color: var(--text-sub); line-height: 1.4; }

.install-action-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--green);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50px;
  transition: transform .15s;
}
.install-action-btn:active { transform: scale(0.95); }

.install-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-sub);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Your Usual Sheet ───────────────────────────────────── */
.usual-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
}

.usual-sheet {
  width: 100%;
  background: #1a1a1a;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px calc(var(--safe-bottom) + 28px);
  animation: slideUp .35s cubic-bezier(0.25,0.46,0.45,0.94);
}

.usual-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 16px;
}

.usual-emoji { font-size: 36px; }

.usual-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.usual-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.usual-summary {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 6px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.usual-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
  margin: 10px 0 18px;
}

.usual-order-btn {
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border-radius: 16px;
  margin-bottom: 10px;
  transition: transform .15s, opacity .15s;
}
.usual-order-btn:active { transform: scale(0.98); opacity: 0.9; }

.usual-skip-btn {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ─── Size Picker Sheet ──────────────────────────────────── */
.size-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
}

.size-sheet {
  width: 100%;
  background: #1a1a1a;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px calc(var(--safe-bottom) + 24px);
  animation: slideUp .32s cubic-bezier(0.25,0.46,0.45,0.94);
}

.size-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 8px 0 4px;
  line-height: 1.3;
}

.size-label {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 20px;
}

.size-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  transition: background .15s, border-color .15s, transform .15s;
}
.size-btn:active { transform: scale(0.96); }

.size-btn--large {
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.4);
}

.size-btn-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.size-btn-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.size-btn--large .size-btn-price { color: var(--green); }

.size-close-btn {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  transition: color .15s;
}
.size-close-btn:active { color: var(--text-sub); }

/* ─── Extras Overlay ─────────────────────────────────────── */
.extras-overlay {
  position: fixed;
  top: calc(var(--header-h) + var(--cats-h));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.extras-header {
  padding: 20px 20px 10px;
  flex-shrink: 0;
}

.extras-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.extras-sub {
  font-size: 12px;
  color: var(--text-sub);
}

.extras-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px calc(var(--safe-bottom) + 24px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.addon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s;
}

.addon-card--active { border-color: rgba(74,222,128,0.5); }

.addon-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.addon-weight {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.addon-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.addon-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.addon-counter {
  display: flex;
  align-items: center;
  gap: 5px;
}

.addon-inc, .addon-dec {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(74,222,128,0.14);
  color: var(--green);
  font-size: 18px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  pointer-events: all;
}
.addon-inc:active, .addon-dec:active {
  transform: scale(0.88);
  background: rgba(74,222,128,0.28);
}

.addon-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 14px;
  text-align: center;
}

/* ─── Cart Upsell Strip ──────────────────────────────────── */
.cart-upsell {
  padding: 14px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.cart-upsell-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cart-upsell-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cart-upsell-chips::-webkit-scrollbar { display: none; }

.upsell-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background .15s, border-color .15s, transform .15s;
  pointer-events: all;
}
.upsell-chip:active {
  transform: scale(0.94);
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.35);
}

.upsell-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.upsell-chip-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* ─── Cart item: no-image placeholder (add-ons) ─────────── */
.cart-item-img--addon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--green);
  font-weight: 300;
}

/* ─── Personality Summary ────────────────────────────────── */
.empty-state.has-personality .empty-emoji,
.empty-state.has-personality h2,
.empty-state.has-personality #empty-sub { display: none; }

.personality-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0 24px;
  width: 100%;
  animation: fadeIn .4s ease;
}

.p-emoji { font-size: 64px; line-height: 1; margin-bottom: 8px; }

.p-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.p-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
  text-align: center;
  line-height: 1.2;
  margin-top: 2px;
}

.p-sub {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
  text-align: center;
  margin-top: 2px;
}

.p-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12px;
  color: var(--text-sub);
}
.p-stat-val { font-weight: 700; color: #fff; margin-right: 3px; }
.p-stat-sep { color: var(--text-dim); }

.p-share-btn {
  margin-top: 14px;
  background: rgba(74,222,128,0.1);
  border: 1.5px solid rgba(74,222,128,0.3);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 11px 24px;
  border-radius: 50px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.p-share-btn:active { transform: scale(0.96); background: rgba(74,222,128,0.18); }

/* ─── Mood Picker ────────────────────────────────────────── */
.mood-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  animation: fadeIn .35s ease;
}
.mood-overlay.hidden { display: none; }

.mood-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.mood-paw-icon {
  font-size: 44px;
  margin-bottom: 16px;
  animation: floatPaw 2.5s ease-in-out infinite;
}

.mood-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 28px;
  line-height: 1.25;
}

.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.mood-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 22px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  font-family: inherit;
}
.mood-btn:hover {
  background: rgba(74,222,128,0.08);
  border-color: rgba(74,222,128,0.3);
}
.mood-btn:active { transform: scale(0.96); }

.mood-btn-emoji {
  font-size: 28px;
  line-height: 1;
}

.mood-btn-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.mood-skip-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 16px;
  transition: color .15s;
}
.mood-skip-btn:hover { color: var(--text-sub); }

/* ─── Desktop max-width ──────────────────────────────────── */
@media (min-width: 480px) {
  #app {
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 32px 80px rgba(0,0,0,.8);
  }
  body { background: #050505; }
}
