/* =========================================================
   lb-base.css  —  shared foundation (tokens, reset, layout,
   buttons, skeletons, modal/sheet shell, toast)
   Load this on EVERY page that uses restaurant.css / product.css
   ========================================================= */
:root {
  --leaf-900: #0b3d2c;
  --leaf-700: #0f5c3f;
  --leaf-600: #138556;
  --leaf-100: #e3f3ea;
  --leaf: var(--leaf-700);
  --mango: #ffb81c;
  --mango-soft: #fff3d1;
  --chili: #e4432d;
  --chili-soft: #fde8e4;
  --ink: #17211c;
  --ink-2: #4a5a52;
  --ink-3: #7c8b83;
  --line: #e3e9e5;
  --bg: #f5f8f6;
  --card: #ffffff;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(15, 60, 44, .06), 0 4px 14px rgba(15, 60, 44, .06);
  --shadow-2: 0 10px 34px rgba(15, 60, 44, .16);

  --font-head: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Section shell ---------- */
.section { padding: 26px 0 6px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { font-size: clamp(20px, 2.4vw, 27px); }
.section__head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.section__nav { display: flex; gap: 8px; }
.round-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: var(--shadow-1);
  transition: transform .15s, background .15s;
}
.round-btn:hover { background: var(--leaf-100); }
.round-btn:active { transform: scale(.94); }

.rail {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 4px 2px 14px; margin-inline: -2px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--mango); color: var(--leaf-900); font-weight: 700;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn--green { background: var(--leaf-700); color: #fff; }
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }

/* ---------- Skeletons / states ---------- */
.skel { background: linear-gradient(100deg, #e8eeea 30%, #f4f7f5 50%, #e8eeea 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 26px; text-align: center; color: var(--ink-2); background: var(--card); border-radius: var(--r-md); border: 1px dashed var(--line); }
.empty button { margin-top: 10px; }
.sentinel { display: flex; justify-content: center; padding: 22px 0 46px; color: var(--ink-3); font-size: 14px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--leaf-100); border-top-color: var(--leaf-700); animation: spin .8s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Delivery status text (restaurant cards + location list) ---------- */
.location-status { display: inline-flex; align-items: center; white-space: nowrap; font-size: 11px; font-weight: 800; }
.location-status--yes { color: #16834a; }
.location-status--no { color: var(--chili); }

/* ---------- Modal / bottom sheet shell ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 24, 18, .55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.is-open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(100%, 560px); max-height: min(88vh, 760px); overflow: hidden; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: pop .28s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.sheet__hero { position: relative; height: clamp(220px, 42vw, 360px); background: var(--leaf-100); flex: none; }
.sheet__hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet__close { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); display: grid; place-items: center; z-index: 2; }
.sheet__close--plain { position: static; background: var(--bg); box-shadow: none; flex: none; }
.sheet__head { padding: 16px 20px 6px; }
.sheet__head h3 { font-size: 22px; }
.sheet__head p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sheet__title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.sheet__label { padding: 10px 20px 4px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.sheet__list { overflow-y: auto; padding: 6px 20px 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Toast (kept above the cart + related sheet) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 100020;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s; box-shadow: var(--shadow-2);
}
.toast.is-show { opacity: 1; translate: -50% -6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section__nav { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .wrap { width: min(100% - 24px, var(--wrap)); }
  .location-status { font-size: 10px; }
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 90vh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: slideup .3s ease; }
  @keyframes slideup { from { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
