*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  --bg: oklch(0.985 0.003 85);
  --surface: oklch(1 0 0);
  --surface-hover: oklch(0.975 0.003 85);
  --surface-nav: oklch(0.985 0.003 85 / 0.88);
  --primary: oklch(0.47 0.14 33);
  --primary-hover: oklch(0.39 0.14 31);
  --primary-light: oklch(0.92 0.025 42);
  --primary-ultra-light: oklch(0.96 0.008 48);
  --text: oklch(0.17 0.003 80);
  --text-secondary: oklch(0.42 0.005 80);
  --text-muted: oklch(0.58 0.005 80);
  --border: oklch(0.88 0.005 80);
  --border-light: oklch(0.93 0.003 80);
  --like: oklch(0.50 0.18 22);
  --like-active: oklch(0.44 0.19 20);

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.04);
  --shadow-md: 0 2px 12px oklch(0 0 0 / 0.05);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ── */
.header {
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  text-align: center;
}

.header-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.header-tagline {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Category Navigation ── */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: var(--space-sm) 0;
}

.category-nav-inner {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 var(--space-lg);
}

@media (min-width: 640px) {
  .category-nav-inner {
    justify-content: center;
  }
}

.category-nav-inner::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}

.category-pill:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
}

.category-pill.active {
  background: var(--text);
  color: var(--surface);
}

/* ── Main Content ── */
.main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
}

/* ── Category Section ── */
.category-section {
  padding-top: var(--space-3xl);
}

.category-heading {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-lg);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.category-heading .count {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-muted);
  margin-left: var(--space-sm);
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Dish Card ── */
.dish-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.dish-card:hover {
  border-color: var(--border);
}

.dish-card.expanded {
  box-shadow: var(--shadow-md);
}

.dish-summary {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.dish-summary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

.dish-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--primary-light));
  flex-shrink: 0;
}

.dish-info {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.dish-name {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

.dish-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.dish-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-sm);
}

.dish-price {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.25rem 0.6rem 0.25rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 32px;
}

.like-btn:hover {
  border-color: var(--like);
  color: var(--like);
}

.like-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.like-btn.liked {
  color: var(--like-active);
  border-color: var(--like-active);
  background: oklch(0.44 0.19 20 / 0.06);
}

.like-btn .heart {
  font-size: 1em;
  line-height: 1;
  transition: transform 0.15s ease;
}

.like-btn.liked .heart {
  transform: scale(1.12);
}

.like-count {
  font-variant-numeric: tabular-nums;
}

/* ── Accordion Details ── */
.dish-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.dish-card.expanded .dish-details {
  grid-template-rows: 1fr;
}

.dish-details-inner {
  overflow: hidden;
}

.dish-details-content {
  padding: 0 var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.dish-details-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0 var(--space-md);
}

.dish-long-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Nutrition ── */
.nutrition {
  display: flex;
  gap: var(--space-sm) var(--space-md);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.nutrition-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nutrition-item strong {
  color: var(--text);
  font-weight: 600;
}

/* ── List Items (Tequila / Mezcal) ── */
.list-group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.list-card {
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
}

.list-card:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.list-card:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.list-card:first-child:last-child {
  border-radius: var(--radius-lg);
}

.list-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-md);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.list-row:hover {
  background: var(--surface-hover);
}

.list-row:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

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

.list-item-name {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.list-item-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.15em;
}

.list-item-price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.list-row-footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.list-card .dish-details-content {
  padding: var(--space-md);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.footer {
  border-top: 1px solid var(--border-light);
  padding: var(--space-2xl) var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-inner {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  justify-content: space-between;
}

.footer-col {
  min-width: 10rem;
}

.footer-name {
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15em;
}

.footer-col p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  box-shadow: 0 2px 10px oklch(0 0 0 / 0.08);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--text);
  opacity: 0.85;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ── Print ── */
@media print {
  .category-nav, .back-to-top, .like-btn { display: none; }
  .dish-card, .list-card { break-inside: avoid; }
  .dish-details { grid-template-rows: 1fr !important; }
  body { background: #fff; }
}
