/* Mobile-first styles for OMBU Grill */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --accent: #ef4444; /* red */
  --accent-2: #10b981; /* green */
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; height: auto; }
/* Performance optimizations */
img[loading="lazy"] { opacity: 0; transition: opacity 0.3s; }
img[loading="lazy"].loaded { opacity: 1; }
.menu-item img, .slide img, .store-photo { 
  background: var(--surface); 
  object-fit: cover; 
  will-change: transform; 
}
a { color: inherit; text-decoration: none; }

/* Language toggle */
.lang-toggle { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.lang-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 12px; cursor: pointer; }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Bilingual visibility rules */
html.lang-en [data-lang="es"] { display: none !important; }
html.lang-es [data-lang="en"] { display: none !important; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-size: 12px; }

/* Header */
.header { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; position: relative; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: 0.02em; }
.brand-logo { width: 24px; height: 24px; display: block; }

/* Navigation */
.nav { display: flex; align-items: center; gap: 20px; }
.nav-link { font-size: 14px; color: var(--text); font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: all 0.2s; }
.nav-link:hover { background: var(--surface); color: var(--accent); }
.nav-link.active { color: var(--accent); font-weight: 600; }
.header-link { font-size: 14px; color: var(--accent); font-weight: 600; }

/* Mobile navigation */
.mobile-nav-toggle { display: none; background: none; border: none; font-size: 18px; cursor: pointer; padding: 8px; }
.mobile-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 45; }
.mobile-nav .nav { flex-direction: column; align-items: stretch; padding: 16px; gap: 8px; }
.mobile-nav .nav-link { text-align: center; padding: 12px; }

@media (max-width: 768px) {
  /* 隐藏桌面导航，显示移动端入口（按钮与语言切换同一行） */
  .nav { display: none; }
  .header-inner { justify-content: flex-start; gap: 8px; }
  .brand { margin-right: auto; }
  .mobile-nav-toggle { display: block; position: static; margin-left: 8px; z-index: 1; background: var(--accent); color: #fff; border: 0; border-radius: 999px; width: 40px; height: 40px; line-height: 40px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
  .lang-toggle { margin-left: 0; }

  /* 弹出卡片：贴头部右侧展开 */
  .mobile-nav { display: none; position: absolute; top: calc(100% + 8px); right: 12px; left: auto; width: min(88vw, 340px); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,0.12); z-index: 100; }
  .mobile-nav.open { display: block; }
  .mobile-nav .nav { display: flex; flex-direction: column; align-items: stretch; padding: 12px; gap: 8px; }
  .mobile-nav .nav-link { text-align: left; }

  /* 提升手机端左右留白 */
  .container { padding: 22px; }
}

/* Hero */
.hero { padding: 32px 0 24px; padding-top: calc(32px + env(safe-area-inset-top)); }
.hero h1 { font-size: 28px; margin: 8px 0; }
.hero p { color: var(--muted); margin: 8px 0 16px; }
.hero .cta { display: flex; gap: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; 
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  font-weight: 600; font-size: 15px; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-tertiary { background: transparent; color: var(--muted); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card .sub { color: var(--muted); font-size: 14px; }

/* Features list */
.features { display: grid; grid-template-columns: 1fr; gap: 12px; }
.feature { padding: 12px; border-radius: 12px; border: 1px dashed var(--border); background: #fff; }
.feature b { display: block; margin-bottom: 4px; }

/* Sections */
.section { padding: 12px 0; }
.section h2 { font-size: 20px; margin: 0 0 8px; }

/* Locations */
.locations { display: grid; grid-template-columns: 1fr; gap: 12px; }
.location-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.location-card h3 { margin: 0 0 8px; font-size: 18px; }
.location-card .address { color: var(--text); font-size: 14px; }
.location-card .hours { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
.location-card .hours .status.open { color: var(--accent-2); font-weight: 600; }
.location-card .hours .status.closed { color: var(--muted); font-weight: 600; }
.location-card .actions { display: flex; gap: 8px; }
.location-card .actions .btn { flex: 1; }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(3, 1fr); z-index: 50; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.bottom-nav a .icon { width: 20px; height: 20px; }
.bottom-gap { height: calc(64px + env(safe-area-inset-bottom)); }

/* Active state by data-page */
body[data-page="home"] .nav-home,
body[data-page="menu"] .nav-menu,
body[data-page="locations"] .nav-locations {
  color: var(--accent);
}

/* Utility */
.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Larger screens (still simple) */
@media (min-width: 700px) {
  .hero h1 { font-size: 32px; }
  .locations { grid-template-columns: 1fr 1fr; }
}
/* Menu image grid */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; list-style: none; padding: 0; margin: 0; }
.menu-item { position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.menu-item img { order: 1; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; display: block; }
.menu-item .label { order: 2; position: static; margin: 6px 10px 0; background: transparent; color: #111; padding: 0; border-radius: 0; font-size: 13px; font-weight: 600; }

/* Allergen badges */
.menu-item .tags { order: 3; position: static; margin: 4px 10px 10px; display: inline-flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.badge-milk { background: var(--accent); /* red */ }
.badge-wheat { background: #f59e0b; /* amber */ }
.badge-no-wheat { background: var(--accent-2); /* green */ }
.notice { background: #fffbea; border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.notice .legend-note { color: #666; font-size: 0.85rem; margin-left: 6px; }

@media (min-width: 700px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Slider */
.slider { position: relative; }
.slides { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; scroll-snap-align: start; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.slide img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; display: block; }
.slide .label { position: absolute; left: 12px; bottom: 12px; background: rgba(17, 24, 39, 0.75); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.slider-nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--border); border: 0; }
.dot.active { background: var(--accent); }
.arrow { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 14px; }

/* Address navigation links */
.address-links { display: block; margin-top: 6px; }
.address-links a { color: var(--accent); font-weight: 600; font-size: 13px; }
.address-links a + a::before { content: " · "; color: var(--muted); margin: 0 4px; }

@media (min-width: 700px) {
  .slides { grid-auto-columns: 70%; }
}

/* Storefront photos on locations cards */
.location-card .store-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #f5f5f5;
}

@media (min-width: 768px) {
  .location-card .store-photo {
    aspect-ratio: 3 / 2;
    margin-bottom: 10px;
  }
}
@media (max-width: 600px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .filter-btn { padding: 10px 14px; font-size: 1rem; }
  .badge { font-size: 10px; }
  .menu-item .label { font-size: 14px; margin: 6px 12px 0; }
  .filters.sticky { top: 56px; }
}
.filters.sticky { position: sticky; top: 64px; z-index: 35; background: var(--bg); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 16px; }
.filter-btn { padding: 6px 10px; border: 1px solid #ccc; border-radius: 16px; background: #fff; cursor: pointer; font-size: 0.9rem; }
.filter-btn.active { background: #333; color: #fff; border-color: #333; }
.menu-item.hidden { display: none !important; }
.badge-nuts { background-color: #f5b6a8; }
.badge-egg { background-color: #f9e27d; color: #333; }
.badge-shellfish { background-color: #c6e0ff; color: #333; }

/* About page styles */
.about-content { max-width: 800px; margin: 0 auto; }
.story-section, .why-choose-section { margin: 32px 0; }
.story-section h2, .why-choose-section h2 { font-size: 24px; margin-bottom: 16px; color: var(--text); }
.story-section p { margin-bottom: 16px; line-height: 1.7; color: var(--muted); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 32px 0; }
.feature-card { background: var(--surface); padding: 24px; border-radius: 12px; border: 1px solid var(--border); }
.feature-card h3 { font-size: 18px; margin-bottom: 12px; color: var(--text); }
.feature-card p { color: var(--muted); line-height: 1.6; margin: 0; }

.benefits-list { list-style: none; padding: 0; }
.benefits-list li { margin-bottom: 12px; padding-left: 20px; position: relative; color: var(--muted); line-height: 1.6; }
.benefits-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: bold; }
.benefits-list strong { color: var(--text); }

.cta-section { text-align: center; margin: 48px 0 32px; padding: 32px; background: var(--surface); border-radius: 16px; border: 1px solid var(--border); }
.cta-section h2 { margin-bottom: 8px; }
.cta-section p { color: var(--muted); margin-bottom: 24px; }

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { padding: 20px; }
  .cta-section { padding: 24px; }
}

/* Home: Stores grid */
.store-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.store-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.store-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); }
.store-info { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 14px; }

@media (min-width: 700px) {
  .store-grid { grid-template-columns: 1fr 1fr; }
}

/* Home: Featured menu grid */
.featured-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feature-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: auto auto auto; }
.feature-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--surface); }
.feature-item b { margin: 8px 10px 4px; font-size: 14px; }
.feature-item span { margin: 0 10px 10px; font-size: 12px; color: var(--muted); }

@media (min-width: 700px) {
  .featured-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Home: Reviews */
.review-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; color: var(--muted); }

/* Home: Social links */
.social-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* Home: Promotions */
.promo-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.promo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }

@media (min-width: 700px) {
  .promo-grid { grid-template-columns: 1fr 1fr; }
}