/* Sana Food – mobile menu site
   Plain CSS, no dependencies. Colours match the printed posters.
   Layout: 1 compact top row (logo + tabs) / poster area / slim contact bar.
   Everything is sized so the poster gets as much of the screen as possible. */

:root {
  --bg: #000;
  --line: #2a2a2a;
  --yellow: #FFC300;
  --orange: #F47A20;
  --red: #E31B23;
  --wa: #25D366;
  --text: #fff;
  --muted: #aaa;
  --top-h: 44px;
  --bar-h: 44px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;                 /* the panels scroll, not the page */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--yellow); }
img { max-width: 100%; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Top row: logo + tabs ---------- */
.top {
  flex: none;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #000;
  border-bottom: 1px solid var(--orange);
}

.logo {
  font-weight: 900;
  font-style: italic;
  font-size: 21px;
  letter-spacing: -0.5px;
  line-height: 1;
  white-space: nowrap;
}
.logo__sana { color: var(--yellow); }
.logo__food { color: #fff; margin-left: 4px; }
.logo--big { font-size: 34px; }

/* sound on/off */
.snd {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.snd .snd__off { display: none; }
.snd.is-off .snd__off { display: block; }
.snd.is-off .snd__wave { display: none; }

.tabs {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.tab {
  height: 32px;
  padding: 0 11px;
  background: #1a1a1a;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab.is-active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #111;
}

/* Offers: red, glowing, gently pulsing so it catches the eye */
.tab--offers {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
  background: var(--red);
  border-color: #ff5a5f;
  color: #fff;
  box-shadow: 0 0 10px rgba(227, 27, 35, 0.55);
  animation: offer-pulse 1.6s ease-in-out infinite;
}
.tab--offers::after {                       /* light sweep across the button */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
  border-radius: 999px;
  animation: offer-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}
.tab__flame {
  color: var(--yellow);
  filter: drop-shadow(0 0 3px rgba(255, 195, 0, 0.8));
  animation: flame-flicker 0.9s ease-in-out infinite alternate;
}
.tab__badge {
  position: absolute;
  top: -9px;
  right: -8px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #111;
  background: var(--yellow);
  border: 1px solid #000;
  border-radius: 999px;
  transform: rotate(8deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.tab--offers.is-active {                    /* already on Offers: stay bright, stop pulsing */
  background: var(--red);
  border-color: var(--yellow);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 195, 0, 0.7), 0 0 12px rgba(227, 27, 35, 0.7);
  animation: none;
}
.tab--offers.is-active::after { animation: none; display: none; }

@keyframes offer-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 6px rgba(227, 27, 35, 0.5), 0 0 0 0 rgba(227, 27, 35, 0.55); }
  50%      { transform: scale(1.06); box-shadow: 0 0 14px rgba(227, 27, 35, 0.9), 0 0 0 7px rgba(227, 27, 35, 0); }
}
@keyframes offer-shine {
  0%, 55% { left: -60%; }
  85%, 100% { left: 120%; }
}
@keyframes flame-flicker {
  from { transform: scale(0.95) rotate(-4deg); }
  to   { transform: scale(1.1) rotate(4deg); }
}

/* very narrow phones: keep the whole top row on one line */
@media (max-width: 359px) {
  .top { padding-left: 8px; padding-right: 6px; gap: 4px; }
  .logo { font-size: 18px; }
  .snd { width: 26px; }
  .tabs { gap: 3px; }
  .tab { padding: 0 8px; font-size: 13px; }
  .tab--offers { gap: 3px; }
  .tab__badge { right: -6px; }
}

.tab[hidden] { display: none; }

/* ---------- Poster area: one page per screen, flips like a book ---------- */
.main {
  flex: 1 1 auto;
  min-height: 0;                    /* lets the panels get a real height */
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.panel {
  position: relative;
  height: 100%;
  overflow: hidden;
  perspective: 1400px;              /* 3D depth for the page turn */
  touch-action: pinch-zoom;         /* we handle the horizontal swipe ourselves */
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.panel[hidden] { display: none; }
.panel.is-loading::before {           /* small spinner while the folder is being read */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid #333;
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  transform-origin: left center;    /* pages turn around the left edge, like a book */
  transform-style: preserve-3d;
  will-change: transform;
  contain: layout paint;            /* cheaper repaints while turning */
}
/* Finishing motions (durations must match T_TURN / T_LAND / T_SETTLE in js/app.js) */
.slide.is-turning  { transition: transform 0.62s cubic-bezier(0.55, 0.05, 0.35, 1); }  /* speeds up through the middle, like a real page */
.slide.is-landing  { transition: transform 0.52s cubic-bezier(0.15, 0.85, 0.25, 1); }  /* comes in fast, lands softly */
.slide.is-settling { transition: transform 0.38s cubic-bezier(0.25, 0.9, 0.35, 1); }

/* front of the page: the poster (hidden once the page turns past 90deg) */
.slide > img,
.slide > .count,
.slide--info > * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* back of the page: plain dark paper, seen while the page is turning */
.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #262626, #151515 40%, #0d0d0d);
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* shading that deepens as the page lifts (set from JS via --shade) */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 70%);
  opacity: var(--shade, 0);
  pointer-events: none;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;              /* whole poster fits, as large as the screen allows */
  background: var(--bg);
  color: transparent;               /* no alt text flash while loading */
  cursor: zoom-in;
  pointer-events: none;             /* the panel handles taps and swipes */
  -webkit-user-drag: none;
}

/* tiny page counter floating over the poster corner, takes no space */
.count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 999px;
  pointer-events: none;
}

/* Info slide (address, phone) */
.slide--info {
  pointer-events: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  font-size: 16px;
}
.slide--info p { margin: 0; }
.badges span {
  display: inline-block;
  margin: 0 3px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 999px;
}

/* ---------- Guide hint (how to turn the page): small pill in the middle ---------- */
.hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  background: rgba(0, 0, 0, 0.8);
  border: 1.5px solid var(--yellow);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hint.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.hint__anim { position: relative; width: 66px; height: 30px; }
.hint__hand {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
}
.hint__hand svg { width: 100%; height: 100%; }
.hint__arrows {
  position: absolute;
  top: 0;
  font-size: 22px;
  line-height: 30px;
  font-weight: 900;
  letter-spacing: -3px;
  color: var(--yellow);
  opacity: 0;
}
.hint__arrows--l { left: 2px; }
.hint__arrows--r { right: 5px; }
.hint__ring {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  opacity: 0;
}
.hint__text { font-size: 13px; font-weight: 800; }

/* swipe left */
.hint--left .hint__hand { animation: hand-left 1.4s ease-in-out infinite; }
.hint--left .hint__arrows--l { animation: arrows-blink 1.4s ease-in-out infinite; }
/* swipe right */
.hint--right .hint__hand { animation: hand-right 1.4s ease-in-out infinite; }
.hint--right .hint__arrows--r { animation: arrows-blink 1.4s ease-in-out infinite; }
/* tap */
.hint--tap .hint__hand { animation: hand-tap 1.3s ease-in-out infinite; }
.hint--tap .hint__ring { animation: ring-tap 1.3s ease-out infinite; }

@keyframes hand-left {
  0%   { transform: translateX(20px); opacity: 0.3; }
  20%  { opacity: 1; }
  75%  { transform: translateX(-22px); opacity: 1; }
  100% { transform: translateX(-22px); opacity: 0.3; }
}
@keyframes hand-right {
  0%   { transform: translateX(-20px); opacity: 0.3; }
  20%  { opacity: 1; }
  75%  { transform: translateX(22px); opacity: 1; }
  100% { transform: translateX(22px); opacity: 0.3; }
}
@keyframes arrows-blink {
  0%, 15% { opacity: 0; }
  35%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes hand-tap {
  0%, 100% { transform: translateY(0) scale(1); }
  40%      { transform: translateY(4px) scale(0.9); }
}
@keyframes ring-tap {
  0%, 35% { opacity: 0; transform: scale(0.4); }
  45%     { opacity: 1; }
  100%    { opacity: 0; transform: scale(2.2); }
}

/* double-tap: two quick taps, then a pause */
.hint--dtap .hint__hand { animation: hand-dtap 1.6s ease-in-out infinite; }
.hint--dtap .hint__ring { animation: ring-dtap 1.6s ease-out infinite; }
@keyframes hand-dtap {
  0%, 60%, 100% { transform: translateY(0) scale(1); }
  12%, 36%      { transform: translateY(4px) scale(0.9); }
  24%, 48%      { transform: translateY(0) scale(1); }
}
@keyframes ring-dtap {
  0%, 10%  { opacity: 0; transform: scale(0.4); }
  14%      { opacity: 1; }
  30%      { opacity: 0; transform: scale(2); }
  34%      { opacity: 0; transform: scale(0.4); }
  38%      { opacity: 1; }
  54%, 100% { opacity: 0; transform: scale(2); }
}

/* ---------- Contact bar ---------- */
.bar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  background: #000;
  border-top: 1px solid var(--orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { flex: none; }
.btn--call { color: #111; background: var(--yellow); }
.btn--wa   { color: #fff; background: var(--wa); }
.btn--map  { color: var(--yellow); background: #111; border: 1px solid var(--yellow); }
.btn:active { filter: brightness(0.9); }

/* ---------- Zoom viewer ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #000;
  animation: viewer-in 0.22s ease-out;
}
.viewer[hidden] { display: none; }

.viewer__top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 14px 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.viewer__title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px #000;
}
.viewer__close {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #111;
  background: var(--yellow);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.viewer__close:active { filter: brightness(0.9); }

.viewer__stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;               /* we handle pinch, pan and taps ourselves */
  user-select: none;
  -webkit-user-select: none;
}
.viewer__stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  -webkit-user-drag: none;
  animation: viewer-img-in 0.26s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.viewer__stage img.is-snapping { transition: transform 0.22s ease-out; }

@keyframes viewer-in     { from { opacity: 0; } to { opacity: 1; } }
@keyframes viewer-img-in { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .slide::after { display: none; }
}
