/* ============ Pearl — white professional digital menu ============ */

:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --ink: #101828;
  --muted: #475467;
  --faint: #667085;
  --line: #EAECF0;
  --accent: #C2410C;
  --accent-tint: #FEF0E7;
  --veg: #15803D;
  --nonveg: #B42318;
  --gold: #F59E0B;
  --radius: 16px;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.hdr-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.brand-meta b { color: var(--ink); font-weight: 600; }

.star { fill: var(--gold); flex-shrink: 0; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn[aria-expanded="true"] {
  background: var(--accent-tint);
  border-color: var(--accent-tint);
  color: var(--accent);
}

.searchbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 12px;
  display: flex;
  gap: 8px;
}

.searchbar input {
  flex-grow: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: 500 14px var(--font-body);
  color: var(--ink);
  background: var(--bg);
  outline: none;
}

.searchbar input:focus { border-color: var(--accent); }

.search-clear {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 0 14px;
  font: 600 12px var(--font-body);
  color: var(--muted);
  cursor: pointer;
}

/* ---------- offers strip ---------- */

.offers {
  background: #101828;
  color: #FCD9A8;
  font-size: 12px;
  font-weight: 500;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.offers span { animation: offerFade 0.45s ease; }

@keyframes offerFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- layout ---------- */

.layout {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  padding: 14px 14px 110px;
  align-items: flex-start;
}

/* sidebar */

.side {
  position: sticky;
  top: 86px;
  width: 76px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 2px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font: 500 9.5px var(--font-body);
  cursor: pointer;
}

.side button svg { stroke: currentColor; }

.side button.active {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}

/* content */

.content { flex-grow: 1; min-width: 0; }

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  font: 500 11px var(--font-body);
  color: var(--muted);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.chip-veg[aria-pressed="true"] {
  background: #EAF5EC;
  border-color: var(--veg);
  color: var(--veg);
}

/* section headings (All view) */

.cat-head {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  margin: 20px 2px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-head::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: var(--line);
}

#menuRoot > .grid:first-child { margin-top: 0; }

/* ---------- dish cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  animation: cardIn 0.4s ease backwards;
  transition: box-shadow 0.2s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
}

.card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08); }

.card-media { position: relative; }

.card-media img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.card-fallback {
  width: 100%;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
}

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #FFFFFF;
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 7px;
  border-radius: 6px;
}

.card-body {
  padding: 10px 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

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

.card-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.card-desc {
  margin: 0;
  font-size: 10.5px;
  color: var(--faint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.card-price { font-size: 14px; font-weight: 700; color: var(--ink); }

.card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--muted);
}

/* compact (no-photo) card */

.card.compact { flex-direction: row; align-items: center; gap: 12px; padding: 12px; grid-column: 1 / -1; }
.card.compact .card-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}
.card.compact .card-body { padding: 0; min-width: 0; }
.card-title { min-width: 0; }

.empty {
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  padding: 40px 10px;
}

/* ---------- bottom action bar ---------- */

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(246, 247, 249, 0.97) 70%, rgba(246, 247, 249, 0));
  pointer-events: none;
}

.bb-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font: 600 13px var(--font-body);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1);
}

.bb-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

/* ---------- footer ---------- */

.foot {
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 22px 18px 120px;
}

.foot-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
}

.foot h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.foot p { margin: 2px 0; font-size: 12px; color: var(--muted); }

.foot-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 0;
}

.foot-note { font-size: 11px; color: var(--faint); }

/* ---------- bottom sheet (dish details) ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 40;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  max-height: 86vh;
  overflow-y: auto;
  animation: sheetUp 0.28s ease;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.15);
}

.sheet-media img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.sheet-media .card-fallback { height: 120px; border-radius: 22px 22px 0 0; }

.sheet-body { padding: 16px 20px 14px; }

.sheet-title { display: flex; align-items: center; gap: 8px; }

.sheet-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}

.sheet-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tagchip {
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 6px;
}

.sheet-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.sheet-details {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sheet-price {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.sheet-spice {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}

.sheet-note { margin: 10px 0 4px; font-size: 11px; color: var(--faint); }

/* ---------- wider screens ---------- */

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .card-media img, .card-fallback { height: 130px; }
  .side { width: 88px; }
  .side button { font-size: 10.5px; padding: 13px 2px; }
  .brand h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { animation: none; }
  .sheet { animation: none; }
  .offers span { animation: none; }
}
