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

:root {
  --bg: #1c1a18;
  --surface: #272420;
  --surface2: #312d29;
  --border: #3d3731;
  --accent: #9b3f5e;
  --accent-hover: #b24e71;
  --text: #f0ebe4;
  --text-muted: #9a9189;
  --radius: 8px;
  --font: system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
header h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.header-logo { height: 32px; width: 32px; object-fit: contain; border-radius: 4px; display: none; }
header .slug-badge {
  font-size: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--text-muted);
}
.btn-nav-link:first-of-type { margin-left: auto; }
.btn-nav-link {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 0.85rem;
  min-height: 36px;
  min-width: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.btn-nav-link:hover { color: var(--text); border-color: var(--accent); }

/* category filter chips */
.filter-chips {
  padding: 0.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px;
  min-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chip:hover { color: var(--text); border-color: var(--border); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.search-bar {
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.search-field { display: flex; flex-direction: column; gap: 4px; }
label.field-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input[type="text"], select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font);
  width: 100%;
  outline: none;
  min-height: 44px;
  transition: border-color 0.15s;
}
input[type="text"]:focus, select:focus { border-color: var(--accent); }

/* combo */
.combo-wrap { position: relative; }
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.combo-list.open { display: block; }
.combo-item {
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.combo-item:hover, .combo-item.active { background: var(--surface); }
.combo-item .ci-sub { font-size: 0.75rem; color: var(--text-muted); }

/* results */
.results {
  padding: 0.75rem 0;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  min-height: 64px;
}
.result-item:hover { background: var(--surface); }
.result-item:active { background: var(--surface2); }

.ri-rack {
  min-width: 44px;
  min-height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ri-info { flex: 1; }
.ri-name { font-weight: 500; font-size: 0.95rem; line-height: 1.3; }
.ri-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.ri-prices {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  flex-shrink: 0;
}
.ri-prices strong { color: var(--text); font-size: 0.95rem; }

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── MODAL ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 600px) {
  .modal { border-radius: var(--radius); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.modal-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}
.modal-rack {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.btn-close {
  min-width: 44px;
  min-height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-close:hover { background: var(--border); }

.modal-prices {
  display: flex;
  gap: 1rem;
}
.price-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  text-align: center;
  flex: 1;
}
.price-chip .pc-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.price-chip .pc-val { font-size: 1.2rem; font-weight: 600; margin-top: 2px; }

.section-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.section-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}
.section-text.empty { color: var(--text-muted); font-style: italic; }
.section-text p { margin: 0 0 0.4rem; }
.section-text p:last-child { margin-bottom: 0; }
.section-text ul { margin: 0; padding-left: 1.2rem; }
.section-text li { margin-bottom: 0.25rem; }
.section-text strong { color: var(--text); }

.modal-images {
  display: flex;
  gap: 0.75rem;
}
.modal-img {
  flex: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 200px;
  object-fit: contain;
  background: var(--surface2);
}

.pairing-note { margin-bottom: 0.7rem; }
.pairing-note:last-child { margin-bottom: 0; }
.pairing-note-dish {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.food-pairing-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.food-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  padding: 3px 10px;
  color: var(--text);
}

@media (max-width: 640px) {
  .search-bar { grid-template-columns: 1fr; }
}
/* ── High-contrast accessibility mode ────────────────────────────────────────
   Toggled by the header button (persisted in localStorage). Muted greys render
   at full text colour; placeholders stay readable. !important is required
   because theme.js sets --text-muted inline per restaurant, and an inline style
   beats a normal stylesheet rule. */
:root[data-contrast="high"] {
  --text-muted: var(--text) !important;
}
:root[data-contrast="high"] ::placeholder {
  color: var(--text) !important;
  opacity: 0.7 !important;
}
.btn-contrast { gap: 6px; }
.btn-contrast.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
