:root {
  --bg: #0f1a2b;
  --bg-2: #15233a;
  --card: rgba(21, 35, 58, .84);
  --line: rgba(210, 182, 115, .22);
  --gold: #d2b673;
  --text: #f4f1ea;
  --muted: #a9b2c2;
  --radius: 16px;
  --tabs-h: 56px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Фон (фото или стандартное небо, задаётся в админке) ---------- */
/* Отдельный fixed-слой вместо background-attachment: fixed — тот не работает на iPhone. */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(10, 17, 30, calc(var(--bg-dim, .55) - .15)) 0%,
      rgba(10, 17, 30, var(--bg-dim, .55)) 35%,
      rgba(10, 17, 30, min(calc(var(--bg-dim, .55) + .2), .95)) 100%),
    var(--bg-image, none) center / cover no-repeat,
    var(--bg);
}

/* ---------- Шапка ---------- */
.hero {
  padding: calc(40px + env(safe-area-inset-top)) 16px 30px;
  text-align: center;
}
.logo {
  display: block;
  width: min(260px, 66vw);
  height: auto;
  margin: 0 auto;
}
.hero-sub {
  margin-top: 14px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .25em;
  text-transform: uppercase;
}

/* ---------- Вкладки разделов ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 20, 34, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tabs-inner {
  display: flex;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tab.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1d1d1d;
}

/* ---------- Меню ---------- */
.menu {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}
.category {
  padding-top: 28px;
  scroll-margin-top: calc(var(--tabs-h) + 4px);
}
.category-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.category-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin-top: 10px;
  background: var(--gold);
}
.category-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.dishes {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.dish {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
}
.dish-body { flex: 1; min-width: 0; }
.dish-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.dish-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dish-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 10px;
}
.price {
  color: var(--gold);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.portion { color: var(--muted); font-size: 13px; }

.dish-photo {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: zoom-in;
}
.dish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Метки */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge-new { color: #8fd3a8; }
.badge-hit { color: var(--gold); }
.badge-spicy { color: #f08a7a; }
.badge-veg { color: #a8d47a; }

/* Стоп-лист */
.dish.is-off .dish-name,
.dish.is-off .dish-desc,
.dish.is-off .price,
.dish.is-off .portion,
.dish.is-off .badges,
.dish.is-off .dish-photo { opacity: .45; }
.off-label {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: 12px;
}

.empty { padding: 60px 16px; text-align: center; color: var(--muted); }

.foot {
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- Окно с фото ---------- */
.photo-dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden auto;
  background: #18273f;
  color: var(--text);
}
.photo-dialog::backdrop { background: rgba(5, 10, 18, .78); }
.dialog-img { display: block; width: 100%; max-height: 62vh; object-fit: cover; background: var(--bg-2); }
.dialog-body { padding: 16px 18px 20px; }
.dialog-title { font-size: 18px; font-weight: 600; }
.dialog-desc { margin-top: 8px; color: var(--muted); font-size: 14px; }
.dialog-desc:empty { display: none; }
.dialog-meta { margin-top: 12px; display: flex; gap: 12px; align-items: baseline; }
.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 16, 28, .7);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 640px) {
  .dish-photo { width: 128px; height: 128px; }
  .dish { padding: 16px; }
}
