/* =============================================================
   Sunny Menu — главный стиль
   ============================================================= */

/* ─── CSS переменные ─────────────────────────────────────────── */
:root {
  /* Цвета приложения */
  --bg:          #0d0804;
  --surface:     #1c1108;
  --card:        #261508;
  --card-hover:  #321c0a;
  --border:      rgba(255, 190, 100, 0.10);
  --border-mid:  rgba(255, 190, 100, 0.18);

  --accent:      #f5a623;
  --accent-2:    #ffd166;
  --accent-dim:  rgba(245, 166, 35, 0.18);

  --text-1: #f5ece0;
  --text-2: #a08060;
  --text-3: #6b4530;

  --green: #4caf88;
  --red:   #e05252;

  --r:  12px;
  --r2: 18px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);

  /* Анимированный градиент фона (главная страница) */
  --bg-start: rgb(10, 4, 1);
  --bg-end:   rgb(30, 12, 3);
  --c1: 255, 130, 10;       /* оранжевый */
  --c2: 210, 35, 65;        /* красно-розовый */
  --c3: 250, 195, 5;        /* золотой */
  --c4: 255, 80, 25;        /* красно-оранжевый */
  --c5: 200, 220, 10;       /* желто-зелёный */
  --cp: 255, 165, 20;       /* тёплое золото (pointer) */
  --gsize: 80%;
  --blend: hard-light;
}

/* ─── Reset + база ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ─── Анимированный градиент фона (главная) ──────────────────── */

.page-home {
  height: 100%;
  overflow: hidden;
}

.page-home body {
  height: 100%;
  overflow: hidden;
}

svg.goo-filter { position: absolute; width: 0; height: 0; }

.bg-animated {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(40deg, var(--bg-start), var(--bg-end));
  z-index: 0;
}

.gradients-container {
  position: absolute;
  inset: 0;
  filter: url(#blurMe) blur(40px);
}
.gradients-container.simple-blur {
  filter: blur(24px);
}

/* 5 анимированных блобов */
.g1, .g2, .g3, .g4, .g5 {
  position: absolute;
  width: var(--gsize);
  height: var(--gsize);
  top:  calc(50% - var(--gsize) / 2);
  left: calc(50% - var(--gsize) / 2);
  mix-blend-mode: var(--blend);
}

.g1 {
  background: radial-gradient(circle at center, rgb(var(--c1)) 0%, rgba(var(--c1), 0) 50%) no-repeat;
  transform-origin: center center;
  animation: moveVertical 30s ease infinite;
}
.g2 {
  background: radial-gradient(circle at center, rgba(var(--c2), 0.8) 0%, rgba(var(--c2), 0) 50%) no-repeat;
  transform-origin: calc(50% - 400px);
  animation: moveInCircle 20s reverse infinite;
}
.g3 {
  background: radial-gradient(circle at center, rgba(var(--c3), 0.8) 0%, rgba(var(--c3), 0) 50%) no-repeat;
  transform-origin: calc(50% + 400px);
  animation: moveInCircle 40s linear infinite;
}
.g4 {
  background: radial-gradient(circle at center, rgba(var(--c4), 0.8) 0%, rgba(var(--c4), 0) 50%) no-repeat;
  transform-origin: calc(50% - 200px);
  animation: moveHorizontal 40s ease infinite;
  opacity: 0.7;
}
.g5 {
  background: radial-gradient(circle at center, rgba(var(--c5), 0.8) 0%, rgba(var(--c5), 0) 50%) no-repeat;
  transform-origin: calc(50% - 800px) calc(50% + 800px);
  animation: moveInCircle 20s ease infinite;
}

/* Блоб, следующий за курсором/тачем */
.g-pointer {
  position: absolute;
  width: 100%;
  height: 100%;
  top:  -50%;
  left: -50%;
  background: radial-gradient(circle at center, rgba(var(--cp), 0.8) 0%, rgba(var(--cp), 0) 50%) no-repeat;
  mix-blend-mode: var(--blend);
  opacity: 0.7;
}

@keyframes moveInCircle {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
@keyframes moveVertical {
  0%   { transform: translateY(-50%); }
  50%  { transform: translateY(50%); }
  100% { transform: translateY(-50%); }
}
@keyframes moveHorizontal {
  0%   { transform: translateX(-50%) translateY(-10%); }
  50%  { transform: translateX(50%) translateY(10%); }
  100% { transform: translateX(-50%) translateY(-10%); }
}

/* Слой контента поверх анимации */
.content-layer {
  position: relative;
  z-index: 10;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Общий layout страниц (все кроме главной) ───────────────── */
.page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 100px; /* под FAB */
}

/* ─── Загрузочный экран ──────────────────────────────────────── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(245, 166, 35, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Шапка страницы (category / dish) ──────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 8, 4, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-1);
  flex-shrink: 0;
}
.back-btn:active { opacity: 0.7; }

/* ─── Кнопки ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn:active { opacity: 0.8; }

.btn-primary {
  background: var(--accent);
  color: #0d0804;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: var(--accent-dim); }
.btn-surface {
  background: var(--surface);
  color: var(--text-1);
}
.btn-danger {
  background: var(--red);
  color: white;
}

/* ─── FAB (плавающая кнопка корзины) ────────────────────────── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0d0804;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.5);
  transition: transform .15s;
}
.fab.visible { display: flex; }
.fab:active { transform: scale(0.96); }
.fab svg { width: 20px; height: 20px; }
.fab-badge {
  background: #0d0804;
  color: var(--accent);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}

/* ─── Главная страница ───────────────────────────────────────── */
.home-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 120px;
}

/* Hero */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 2px solid var(--border-mid);
}
.hero-name {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.hero-tagline {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}

/* Секции главной */
.home-section {
  background: rgba(26, 17, 8, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 18px 20px;
  margin-bottom: 14px;
}

/* About */
.about-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}

/* Info (hours + address) */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  padding: 5px 0;
}
.info-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.info-label {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Socials */
.socials {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-mid);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  transition: background .15s;
}
.social-btn:active { background: rgba(255,255,255,0.14); }

/* Карта */
.map-wrap {
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 10px;
}
.map-wrap iframe {
  width: 100%;
  height: 200px;
  border: none;
  display: block;
}

/* Категории */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.category-card {
  aspect-ratio: 1;
  border-radius: var(--r2);
  overflow: hidden;
  background: var(--surface);
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  transition: transform .15s;
}
.category-card:active { transform: scale(0.97); }
.category-card[data-slug="kitchen"]   { background-color: #0d2b1a; }
.category-card[data-slug="bar"]       { background-color: #0d1530; }
.category-card[data-slug="desserts"]  { background-color: #2d0d20; }
.category-card[data-slug="gift-shop"] { background-color: #2a1800; }
.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.category-card-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ─── Страница категории ─────────────────────────────────────── */

/* Табы подкатегорий */
.tabs-wrap {
  position: sticky;
  top: 57px;
  z-index: 90;
  background: rgba(13, 8, 4, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Секция подкатегории */
.subcategory-section {
  padding: 0 16px;
  margin-top: 20px;
}
.subcategory-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-top: 4px;
}

/* Карточка блюда (горизонтальная) */
.dish-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: background .15s;
}
.dish-card:active { background: var(--card-hover); }
.dish-card-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}
.dish-card-img-placeholder {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 28px;
}
.dish-card-body {
  flex: 1;
  padding: 12px 12px 12px 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dish-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dish-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
}
.dish-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.dish-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.dish-unavailable-badge {
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Счётчик количества */
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.qty-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background .1s;
}
.qty-btn:active { background: rgba(245,166,35,0.15); }
.qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
/* Кнопка «+» когда qty=0 (показывается одна) */
.qty-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d0804;
  font-size: 20px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .1s;
}
.qty-add:active { opacity: 0.8; }

/* ─── Детальная карточка блюда ───────────────────────────────── */
.dish-detail-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
}
.dish-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dish-detail-body {
  padding: 20px 16px;
}
.dish-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dish-detail-name {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  flex: 1;
}
.dish-detail-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}
.dish-detail-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* КБЖУ */
.nutrition-table {
  width: 100%;
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.nutrition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.nutrition-row:last-child { border-bottom: none; }
.nutrition-label { color: var(--text-2); }
.nutrition-val { font-weight: 600; color: var(--text-1); }

/* Ингредиенты */
.ingredients-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.ingredients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.ingredient-tag {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-2);
}

/* Sticky кнопка "add to cart" */
.dish-add-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: rgba(13, 8, 4, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.dish-add-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}
.dish-add-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--r);
  background: var(--accent);
  color: #0d0804;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  transition: opacity .15s;
}
.dish-add-btn:active { opacity: 0.85; }
.dish-add-btn.in-cart {
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--border-mid);
}

/* ─── Корзина ────────────────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-2);
}
.cart-empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.cart-item-img-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--surface);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price { font-size: 13px; color: var(--text-2); }
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.cart-total-val { color: var(--accent); }
.cart-note {
  padding: 16px;
}
.cart-note label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.cart-note textarea {
  width: 100%;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 80px;
}
.cart-note textarea::placeholder { color: var(--text-3); }
.cart-note textarea:focus { outline: none; border-color: var(--border-mid); }
.cart-actions {
  padding: 16px;
  display: flex;
  gap: 10px;
}

/* ─── 404 ────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 32px;
  gap: 16px;
}
.error-code {
  font-size: 80px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.error-msg { font-size: 18px; font-weight: 700; }
.error-sub { font-size: 14px; color: var(--text-2); }
