/* Shared layout for the pickup app. Mobile first; 768px is the desktop line.
   Colours, fonts and radii are --app-* variables set by each brand's theme.css. */
:root {
  --app-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --app-fast: 120ms;
  --app-base: 200ms;
  --app-slow: 360ms;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--app-font-body); font-size: 16px; line-height: 1.5;
  color: var(--app-text); background: var(--app-page);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button:focus-visible, input:focus-visible { outline: none; box-shadow: var(--app-focus); }
input::placeholder { color: var(--app-placeholder); }
::selection { background: var(--app-accent); color: var(--app-on-accent); }

.app { position: relative; width: 100%; height: 100dvh; overflow: hidden; background: var(--app-bg); color: var(--app-text); display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; }
.narrow { width: 100%; max-width: 640px; margin: 0 auto; }
.scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }

/* Header + bottom bar */
.topbar { flex: 0 0 auto; position: relative; z-index: 5; background: var(--app-header-bg); color: var(--app-header-text); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--app-header-line); }
.topbar-inner { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; }
.topbar-logo { height: 30px; width: auto; flex: 0 0 auto; }
.bar { flex: 0 0 auto; position: relative; z-index: 6; background: var(--app-bar-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--app-line); }
.bar-inner { display: flex; align-items: center; gap: 12px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
.hide-sm { display: none; }
@media (min-width: 440px) { .hide-sm { display: flex; } }

/* Welcome: stacked on phones, split on desktop */
.welcome { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; }
.welcome-hero { flex: 0 0 auto; height: 250px; position: relative; border-bottom: 1px solid var(--app-line-subtle); background: #0c0b0a; }
.welcome-body { flex: 1 1 auto; padding: 22px 20px 28px; display: flex; flex-direction: column; gap: 18px; width: 100%; }
.welcome-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,11,10,0.35) 0%, rgba(12,11,10,0.75) 55%, var(--app-bg) 100%); }
.welcome-title { --welcome-h: 32px; --app-logo-h: 44px; position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.welcome-actions { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 768px) {
  .welcome { flex-direction: row; overflow: hidden; }
  .welcome-hero { flex: 1 1 55%; height: auto; border-bottom: 0; border-right: 1px solid var(--app-line-subtle); }
  .welcome-body { flex: 0 0 min(480px, 45%); padding: 48px 40px; overflow-y: auto; justify-content: center; }
  .welcome-actions { margin-top: 12px; }
  .welcome-shade { background: linear-gradient(180deg, rgba(12,11,10,0.1) 0%, rgba(12,11,10,0.2) 45%, rgba(12,11,10,0.85) 100%); }
  .welcome-title { --welcome-h: 52px; --app-logo-h: 72px; left: 48px; right: 48px; bottom: 44px; gap: 12px; }
}

/* Menu */
.menu-hero { padding: 20px 16px 16px; }
.menu-grid { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 0; }
.chips { position: relative; display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar, .scroll::-webkit-scrollbar, .welcome::-webkit-scrollbar { width: 0; height: 0; }
.sec-head { padding: 20px 16px 4px; }
@media (min-width: 768px) {
  .menu-hero { padding: 36px 24px 28px; }
  .menu-title { font-size: 44px !important; }
  .menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 24px 0; }
  .chips, .sec-head { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1100px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.dish { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--app-card); border: 1px solid var(--app-line-subtle); border-radius: var(--app-radius); box-shadow: var(--app-shadow-md); transition: border-color var(--app-base) var(--app-ease); }
.dish:hover { border-color: var(--app-line-strong); }
.dish.is-off .dish-open, .dish.is-off .dish-photo { opacity: 0.55; }
.sec-off { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 16px 0; padding: 10px 10px 10px 14px; border: 1px dashed var(--app-line); border-radius: var(--app-radius); font-size: 13px; color: var(--app-text-muted); }
.sec-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--app-line-strong); background: transparent; color: var(--app-text-strong); font-family: var(--app-font-body); font-size: 13px; font-weight: 700; cursor: pointer; }
.sec-toggle:hover { background: var(--app-hover); }
@media (min-width: 768px) { .sec-off { margin-left: 24px; margin-right: 24px; } }
.dish-media { position: relative; flex: 0 0 auto; width: 108px; height: 108px; margin-bottom: 6px; }
.dish-photo { width: 100%; height: 100%; border-radius: var(--app-radius); overflow: hidden; background: var(--app-hover); border: 1px solid var(--app-line-subtle); cursor: pointer; }
.dish-add { position: absolute; right: -6px; bottom: -6px; }
@media (min-width: 768px) { .dish-media { width: 120px; height: 120px; } }
.dish-open { flex: 1 1 auto; align-self: stretch; min-width: 0; display: flex; gap: 12px; align-items: flex-start; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }

/* "What people order": a sideways row of cards, + on the photo's corner */
.picks { --pick-w: 150px; display: flex; gap: 12px; padding: 14px 16px 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.picks::-webkit-scrollbar { height: 0; }
.pick { position: relative; flex: 0 0 var(--pick-w); scroll-snap-align: start; display: flex; flex-direction: column; background: var(--app-card); border: 1px solid var(--app-line-subtle); border-radius: var(--app-radius); box-shadow: var(--app-shadow-md); overflow: hidden; transition: border-color var(--app-base) var(--app-ease); }
.pick:hover { border-color: var(--app-line-strong); }
.pick-open { flex: 1 1 auto; display: flex; flex-direction: column; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.pick-photo { display: block; width: 100%; height: calc(var(--pick-w) * 0.75); overflow: hidden; background: var(--app-hover); border-bottom: 1px solid var(--app-line-subtle); }
.pick-body { display: flex; flex-direction: column; gap: 6px; padding: 30px 12px 14px; }
.pick-add { position: absolute; right: 10px; top: calc(var(--pick-w) * 0.75 - 24px); }
@media (min-width: 768px) {
  .picks { --pick-w: 200px; padding-left: 24px; padding-right: 24px; scroll-padding: 0 24px; }
}

/* Slot grid */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }

/* Dish sheet: bottom sheet on phones, centred dialog on desktop */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: var(--app-backdrop); display: flex; align-items: flex-end; justify-content: center; animation: appFade var(--app-base) var(--app-ease); }
.sheet { position: relative; width: 100%; max-height: 92%; display: flex; flex-direction: column; background: var(--app-bg); color: var(--app-text); border: 1px solid var(--app-line); border-bottom: 0; border-radius: var(--app-radius-sheet) var(--app-radius-sheet) 0 0; box-shadow: var(--app-shadow-lg); overflow: hidden; animation: appSheetUp var(--app-slow) var(--app-ease); }
.sheet-body { flex: 1 1 auto; overflow-y: auto; }
.sheet-foot { flex: 0 0 auto; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--app-line); background: var(--app-bg-deep); display: flex; gap: 12px; align-items: center; }
@media (min-width: 768px) {
  .sheet-backdrop { align-items: center; }
  .sheet { width: min(520px, calc(100% - 48px)); max-height: 86%; border-radius: var(--app-radius-sheet); border-bottom: 1px solid var(--app-line); animation: appPop var(--app-base) var(--app-ease); }
}

/* Choice buttons (options, payment) with radio / checkbox marks */
.choice { min-height: 44px; padding: 10px 14px; border-radius: var(--app-radius); border: 1px solid var(--app-line); background: var(--app-card); color: var(--app-text); font-family: var(--app-font-body); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; transition: background var(--app-fast) var(--app-ease), border-color var(--app-fast) var(--app-ease); }
.choice:hover:not(:disabled) { background: var(--app-hover); }
.choice:disabled { cursor: not-allowed; }
.choice[aria-checked="true"] { border-color: var(--app-accent); background: var(--app-accent-tint); color: var(--app-text-strong); }
.mark-radio, .mark-check { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--app-text-subtle); display: inline-flex; align-items: center; justify-content: center; }
.mark-radio { border-radius: 50%; }
.mark-check { border-radius: 3px; }
[aria-checked="true"] > .mark-radio { border-color: var(--app-accent); background: radial-gradient(var(--app-accent) 40%, transparent 45%); }
[aria-checked="true"] > .mark-check { border-color: var(--app-accent); background: var(--app-accent); }
[aria-checked="true"] > .mark-check::after { content: '✓'; color: var(--app-on-accent); font-size: 11px; line-height: 1; }

/* Toast */
.toast { position: absolute; left: 50%; bottom: 96px; z-index: 30; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--app-toast-bg); border: 1px solid var(--app-accent); color: var(--app-toast-text); font-size: 13px; font-weight: 700; box-shadow: var(--app-shadow-lg); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; animation: appToast 2.2s var(--app-ease) forwards; pointer-events: none; }

/* What flies into the bag */
.fly { position: fixed; z-index: 50; border-radius: 8px; object-fit: cover; pointer-events: none; box-shadow: var(--app-shadow-lg); }
.fly-dot { border-radius: 50%; background: var(--app-accent); }

@keyframes appFade { from { opacity: 0; } }
@keyframes appSheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes appPop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }
@keyframes appToast { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
@keyframes appBump { 50% { transform: scale(1.12); } }
@keyframes appPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.bump { animation: appBump 320ms var(--app-ease); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
