/*
 * QR-menu SUSHI & CHILL
 * Контраст (WCAG AA): основний текст ≥ 4.5:1, межі інтерактивних елементів ≥ 3:1.
 * Текст на заливці акценту — темний (#151515), бо білий на #ff5555 дає лише 3.1:1.
 */

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

:root {
  --bg: #000000;
  --card: #1A1A1D;
  --text: #F5F5F5;        /* 15.3:1 на --bg, 12.5:1 на --card */
  --muted: #B8B8B8          /* 8.8:1 на --bg, 7.9:1 на --card */
  --soft: #e10600;           /* алергени, склад: 12:1 */
  --accent: #FF6268;        /* 5.8:1 на --bg як текст */
  --accent-soft: #FF8A8F;    /* підписи дрібним шрифтом */
  --on-accent: #000000;      /* текст на заливці акценту: 5.8:1 */
  --line: #353539;              /* лише розділювачі */
  --line-strong: #66666D;    /* межі полів і кнопок: ≥ 3:1 */
  --radius: 10px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

a { color: inherit; }
img { max-width: 100%; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Шапка ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; margin: 4px 12px 4px 0; }
.brand-logo { height: 44px; width: auto; display: block; margin-right: 12px; }
.brand-name { font-weight: 800; letter-spacing: .06em; text-decoration: none; }
.brand-name span { color: var(--accent); }
.tagline { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }

.header-actions { display: flex; flex-wrap: wrap; align-items: center; margin: 4px 0; }

.phone-link,
.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 4px 8px 4px 0;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  font-size: .95rem;
}
.phone-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.social-links { display: flex; flex-wrap: wrap; }

/* ---------- Заголовок меню ---------- */

.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }

.menu-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 8px;
}
.menu-heading > div { margin-bottom: 8px; margin-right: 12px; }
.eyebrow { margin: 0 0 4px; font-size: .9rem; letter-spacing: .04em; color: var(--accent); }
.menu-heading h1 { margin: 0 0 4px; font-size: 1.8rem; line-height: 1.2; }
.muted { margin: 0; color: var(--muted); }

.language-switch { display: flex; margin-bottom: 8px; }
.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  margin-right: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.language-switch a:last-child { margin-right: 0; }
.language-switch a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

/* ---------- Примітки ---------- */

.notice {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: 10px;
  background: rgba(255, 85, 85, .1);
  font-size: 1rem;
  font-weight: 600;
}
.category-notice { margin: 0 0 14px; }

.info-line { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }

.allergen-info {
  margin: 0 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
}
.allergen-info summary {
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.allergen-info summary::-webkit-details-marker { display: none; }
.allergen-info summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); font-weight: 800; }
.allergen-info[open] summary::before { content: "\2212"; }
.allergen-info p { margin: 0 14px 12px; color: var(--soft); font-size: .95rem; }

/* ---------- Пошук ---------- */

.search-box { margin: 4px 0 12px; }
.search-box input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px: iOS не масштабує сторінку при фокусі */
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::placeholder { color: #9a9a9a; } /* 5.9:1 на --card */

/* ---------- Навігація категоріями ---------- */

.category-navigation {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: nowrap;
  margin: 0 -16px 20px;
  padding: 10px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  cursor: grab;
}
.category-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.category-link.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.category-navigation::after { content: ""; flex: 0 0 8px; }

@media (hover: none) {
  .category-navigation { scrollbar-width: none; -ms-overflow-style: none; }
  .category-navigation::-webkit-scrollbar { display: none; }
}
@media (hover: hover) {
  .category-navigation { scrollbar-width: thin; scrollbar-color: #555 transparent; }
  .category-navigation::-webkit-scrollbar { height: 6px; }
  .category-navigation::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
}

/* ---------- Картки страв ---------- */

.category-section { margin-bottom: 32px; }
.category-title {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  font-size: 1.3rem;
  letter-spacing: .04em;
}
.menu-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: 1fr 1fr; } }

.menu-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.item-photo {
  display: block;
  width: 100%;
  height: 200px;
  margin-bottom: 12px;
  object-fit: cover;
  border-radius: 10px;
  background: #2a2a2a;
}
.item-name { margin: 0 0 6px; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.item-description { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }
.item-meta { display: flex; flex-wrap: wrap; margin-top: 4px; font-size: .85rem; color: var(--soft); }
.item-meta span { margin: 0 8px 8px 0; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; }

/* Спойлер інгредієнтів */
details.item-ingredients { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
details.item-ingredients > summary.item-subtitle {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
details.item-ingredients > summary::-webkit-details-marker { display: none; }
details.item-ingredients > summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); font-weight: 800; }
details.item-ingredients[open] > summary::before { content: "\2212"; }
.ingredients-list { margin: 4px 0 0; padding-left: 18px; color: var(--soft); font-size: .9rem; }
.ingredients-list li { margin-bottom: 3px; overflow-wrap: anywhere; }

/* Алергени — юридично важлива інформація, тому не «дрібний сірий» текст */
.item-allergens { margin: 12px 0 0; color: var(--soft); font-size: .95rem; }
.allergen-label { color: var(--accent-soft); font-weight: 800; }

.item-price { margin: auto 0 0; padding-top: 12px; font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.item-price-promo { display: flex; flex-wrap: wrap; align-items: center; }
.promo-badge { margin-right: 8px; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: .85rem; }
.price-old { margin-right: 8px; font-size: .95rem; font-weight: 400; color: var(--muted); }

.status-message, .error-message { padding: 24px 0; text-align: center; color: var(--muted); }
.error-message { color: var(--accent); }

/* ---------- Футер ---------- */

.site-footer { padding: 24px 16px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; color: var(--muted); }
.site-footer p { margin: 0 0 4px; }
.site-footer .legal { margin-top: 10px; font-size: .85rem; }

/* ---------- Кнопка «Нагору» ---------- */

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }

/* ---------- Сторінка 404 ---------- */

.not-found { max-width: 480px; margin: 0 auto; padding: 56px 20px; text-align: center; }
.not-found h1 { margin: 0 0 12px; font-size: 3rem; }
.not-found p { color: var(--muted); }
.not-found a { display: inline-block; margin-top: 12px; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }

@media (max-width: 420px) {
  .menu-heading h1 { font-size: 1.5rem; }
  .brand-logo { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .to-top { transition: none; }
}
