:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-soft: #F2EDE4;
  --border: rgba(120, 98, 76, 0.13);
  --text: #1C1917;
  --text-muted: #78716C;
  --brand: #C23B0B;
  --brand-soft: rgba(194, 59, 11, 0.1);
  --badge-pop-bg: #FEF3C7;
  --badge-pop-text: #B45309;
  --shadow-sm: 0 2px 10px rgba(28, 25, 23, 0.045);
  --shadow-md: 0 10px 28px rgba(28, 25, 23, 0.08);
  --sticky-bg: rgba(250, 247, 242, 0.92);
}

html[data-theme="dark"] {
  --bg: #12100E;
  --surface: #1C1917;
  --surface-soft: #292524;
  --border: rgba(255, 248, 235, 0.09);
  --text: #F5F5F4;
  --text-muted: #A8A29E;
  --brand: #EA580C;
  --brand-soft: rgba(234, 88, 12, 0.16);
  --badge-pop-bg: rgba(245, 158, 11, 0.16);
  --badge-pop-text: #FBBF24;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  --sticky-bg: rgba(18, 16, 14, 0.92);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero Cover */
.hero {
  position: relative;
}

.hero-cover {
  height: 205px;
  width: 100%;
  background: linear-gradient(135deg, #431407 0%, #7c2d12 50%, #1c1917 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

@media (min-width: 641px) {
  .hero-cover {
    height: 230px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.52) 100%
  );
}

.top-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 18, 16, 0.62);
  backdrop-filter: blur(8px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.93);
}

/* Brand Identity */
.brand-card {
  padding: 0 18px 10px;
  text-align: center;
  position: relative;
  z-index: 3;
}

.logo-frame {
  width: 94px;
  height: 94px;
  margin: -47px auto 10px;
  border-radius: 22px;
  background: #ffffff;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-subtitle {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.info-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.info-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  text-decoration: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* Search Bar */
.search-section {
  padding: 10px 16px 6px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 38px 12px 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--brand);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  position: absolute;
  right: 10px;
  border: none;
  background: var(--surface-soft);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Sticky Horizontal Category Pills */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--sticky-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-top: 4px;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.cat-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(194, 59, 11, 0.28);
}

/* Menu Sections & Item Cards */
.menu-container {
  padding: 12px 16px 28px;
  flex: 1;
}

.menu-section {
  scroll-margin-top: 68px;
  margin-bottom: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-heading h2 {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.items-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 13px;
  transition: transform 0.14s ease;
}

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

.item-body {
  flex: 1;
  min-width: 0;
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.item-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.pop-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--badge-pop-bg);
  color: var(--badge-pop-text);
  letter-spacing: 0.01em;
}

.item-price {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
}

.item-price.unpriced {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 2px 10px;
  border-radius: 8px;
}

.item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-search {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.loading-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

/* Footer */
.menu-footer {
  text-align: center;
  padding: 20px 16px 34px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-brand {
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.76rem;
  opacity: 0.8;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header .clear-btn {
  position: static;
}

.wifi-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.copy-wifi-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #1C1917;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 80;
}

.hidden {
  display: none !important;
}

/* Branches */
.branches { padding: 4px 16px 8px; }
.branches.hidden { display: none; }
.branches-title { font-size: 1rem; margin-bottom: 8px; }
.branch-card { border: 1px solid rgba(128, 128, 128, 0.25); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.branch-card h3 { font-size: 0.95rem; margin-bottom: 2px; }
.branch-card p { font-size: 0.8rem; opacity: 0.75; margin-bottom: 8px; }
.branch-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Photo category cards */
.category-grid { display: none; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 16px 20px; }
.view-home .category-grid { display: grid; }
.view-home .category-nav, .view-home .menu-container { display: none; }
.cat-card { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--surface-soft); box-shadow: var(--shadow-sm); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-card i { font-size: 2rem; font-style: normal; }
.cat-card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font: 700 0.85rem inherit; font-family: inherit; }
.back-pill { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; background: var(--surface); color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.item-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }
