/* =====================================================================
   ШРИФТЫ
   ===================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/cormorant-500.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/cormorant-600.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/cormorant-700.woff2') format('woff2'); }

/* =====================================================================
   ПЕРЕМЕННЫЕ (СВЕТЛАЯ ТЕМА)
   ===================================================================== */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #241f1c;
  --muted: #7d7168;
  --line: #e9e1d6;
  --accent: #b0532c;
  --radius: 18px;
  --shadow: 0 2px 4px rgba(36,31,28,.04), 0 12px 28px -12px rgba(36,31,28,.16);
  
  --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* =====================================================================
   ТЕМНАЯ ТЕМА
   ===================================================================== */
body.dark-mode {
  --bg: #141110;
  --surface: #1f1a17;
  --ink: #ece3d9;
  --muted: #a69a8f;
  --line: #332b25;
  --accent: #d47045;
  --shadow: 0 2px 4px rgba(0,0,0,.2), 0 12px 28px -12px rgba(0,0,0,.5);
}
body.dark-mode .filter-nav { background: rgba(20, 17, 16, 0.88); }
body.dark-mode .dish__media { background: #2a221e; }
body.dark-mode .dish__media.is-loading { background: linear-gradient(90deg, #2a221e 25%, #3a2f29 50%, #2a221e 75%); background-size: 200% 100%; }
body.dark-mode .filter-btn:hover { background: #2a221e; }
body.dark-mode .site-footer { background: #0d0b0a; }
body.dark-mode .footer__label { color: #6b5f55; }
body.dark-mode .footer__bottom { border-top-color: #2a221e; }
body.dark-mode .back-to-top { background: var(--surface); border-color: var(--line); }
body.dark-mode .cart-fab { background: var(--surface); border: 1px solid var(--line); }

/* =====================================================================
   БАЗОВЫЕ СТИЛИ И БАННЕР ОФЛАЙНА
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: var(--transition-theme);
}
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; margin: 0; line-height: 1.15; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* СТИЛИ БАННЕРА ОФЛАЙН-РЕЖИМА */
.offline-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 16px;
  background: #8b3a1e;
  color: #fff;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .02em;
  transform: translateY(100%);
  transition: transform .3s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,.15);
}
body.offline .offline-banner { transform: translateY(0); }

/* =====================================================================
   АНИМАЦИИ
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.cards .reveal:nth-child(1) { transition-delay: 0.05s; }
.cards .reveal:nth-child(2) { transition-delay: 0.15s; }
.cards .reveal:nth-child(3) { transition-delay: 0.25s; }
.cards .reveal:nth-child(4) { transition-delay: 0.35s; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  position: relative; padding: 96px 24px 72px; text-align: center; color: #fff;
  background-color: #2a211c;
  background-image: linear-gradient(180deg, rgba(24,18,15,.80), rgba(24,18,15,.88)), url('../images/hero.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.hero__inner { max-width: 760px; margin: 0 auto; }
.hero__kicker { margin: 0 0 18px; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: #e7cbb8; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); letter-spacing: -.01em; }
.hero__text { margin: 20px auto 0; max-width: 520px; color: #e3d8cf; font-size: clamp(15px, 2vw, 16px); }
.hero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin-top: 34px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #cdbdb1; }
.hero__meta span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 9px; border-radius: 50%; background: var(--accent); vertical-align: middle; transform: translateY(-1px); }

/* =====================================================================
   НАВИГАЦИЯ (ФИЛЬТРЫ)
   ===================================================================== */
.filter-nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: var(--transition-theme);
}
.filter-nav__inner { 
  max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 6px; 
  padding: 12px 20px; overflow-x: auto; scrollbar-width: none; 
}
.filter-nav__inner::-webkit-scrollbar { display: none; }
.filter-btn {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; font-size: 14px;
  font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.filter-btn:hover { color: var(--ink); background: #f1eae1; }
.filter-btn.is-active { background: var(--ink); color: var(--bg); }
.filter-nav__order {
  margin-left: auto; flex: 0 0 auto; padding: 9px 20px !important; 
  background: var(--accent) !important; color: #fff !important; font-weight: 600;
  border-radius: 999px; font-size: 14px;
}
.filter-nav__order:hover { background: #984527 !important; }

/* Переключатель темы */
.theme-toggle {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 8px; margin-left: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: #f1eae1; color: var(--ink); }
body.dark-mode .theme-toggle:hover { background: #2a221e; }
.theme-toggle svg { display: none; }
body:not(.dark-mode) .theme-toggle .icon-moon { display: block; }
body.dark-mode .theme-toggle .icon-sun { display: block; }

/* =====================================================================
   LAYOUT (МЕНЮ)
   ===================================================================== */
.menu-container { max-width: 1180px; margin: 0 auto; padding: 40px 20px 80px; }

.category { padding-bottom: 40px; }
.category:last-child { padding-bottom: 0; }
.category__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 28px; }
.category__head h2 { font-size: clamp(30px, 4vw, 42px); white-space: nowrap; }
.category__rule { flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* =====================================================================
   CARDS
   ===================================================================== */
.dish { 
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); 
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; 
  transition: transform .3s ease, box-shadow .3s ease, var(--transition-theme); 
}
.dish:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(36,31,28,.05), 0 22px 44px -18px rgba(36,31,28,.28); }
.dish__media { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.dish__media.is-loading { background: linear-gradient(90deg, #f2e6da 25%, #e8d6c5 50%, #f2e6da 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dish__media::before { content: attr(data-emoji); position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; opacity: .5; z-index: 0; }
.dish__media img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease, transform .6s ease; cursor: zoom-in; z-index: 1; }
.dish__media img.is-loaded { opacity: 1; }
.dish:hover .dish__media img.is-loaded { transform: scale(1.06); }

.dish__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.dish__row { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.dish__row h3 { font-size: 22px; flex: 1; }
.dish__price { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.dish__desc { margin: 10px 0 0; font-size: 14px; color: var(--muted); flex: 1; }
.dish__weight { margin-top: 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: 0.7; }

/* Кнопка добавления в корзину */
.dish__add {
  position: absolute; bottom: 12px; right: 12px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: background 0.2s, color 0.2s, transform 0.2s;
}
.dish__add:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.1); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { margin-top: 72px; background: #241f1c; color: #e6ddd4; padding: 64px 20px 40px; transition: var(--transition-theme); }
.footer__inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; }
.site-footer h2 { color: #fff; font-size: 30px; margin-bottom: 12px; }
.footer__text { margin: 0 0 12px; color: #b6a79a; font-size: 15px; line-height: 1.6; max-width: 320px; }
.footer__label { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: #8e8075; margin: 0 0 12px; }
.footer__links a { display: block; color: #e6ddd4; font-size: 15px; padding: 4px 0; transition: color .2s; }
.footer__links a:hover { color: #e0a17f; }
.footer__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.footer__btn { display: inline-block; padding: 12px 26px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; font-family: inherit; border: 1px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.footer__btn:hover { background: #984527; }
.footer__btn--ghost { background: transparent; border-color: #4a403a; color: #e6ddd4; }
.footer__btn--ghost:hover { background: #3a322c; color: #fff; }
.footer__bottom { max-width: 1180px; margin: 48px auto 0; padding-top: 22px; border-top: 1px solid #3a322c; font-size: 13px; color: #8e8075; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; transition: var(--transition-theme); }

/* =====================================================================
   КНОПКИ "НАВЕРХ" и "КОРЗИНА"
   ===================================================================== */
.back-to-top, .cart-fab {
  position: fixed; z-index: 99; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s, var(--transition-theme);
}
.back-to-top {
  bottom: 24px; right: 24px; width: 48px; height: 48px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(20px);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.back-to-top svg { width: 20px; height: 20px; }

/* Плавающая корзина */
.cart-fab {
  bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  padding: 10px 24px; border-radius: 50px; gap: 16px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); opacity: 0; visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s, visibility 0.3s, var(--transition-theme);
}
.cart-fab.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.cart-fab:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.cart-fab__info { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.cart-fab__count { background: var(--accent); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cart-fab:hover .cart-fab__count { background: #fff; color: var(--accent); }
.cart-fab__total { font-weight: 700; font-size: 16px; }

/* =====================================================================
   МОДАЛЬНОЕ ОКНО КОРЗИНЫ
   ===================================================================== */
.cart-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; backdrop-filter: blur(4px); }
.cart-modal.is-open { opacity: 1; visibility: visible; }
.cart-modal__content { background: var(--surface); width: 100%; max-width: 500px; max-height: 90vh; border-radius: 24px 24px 0 0; padding: 24px; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), var(--transition-theme); overflow: hidden; }
@media (min-width: 768px) { 
  .cart-modal { align-items: center; } 
  .cart-modal__content { border-radius: 24px; transform: translateY(20px) scale(0.95); opacity: 0; } 
  .cart-modal.is-open .cart-modal__content { transform: translateY(0) scale(1); opacity: 1; } 
}
.cart-modal.is-open .cart-modal__content { transform: translateY(0); }
.cart-modal__close { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1; }
.cart-modal__title { font-size: 28px; margin-bottom: 16px; text-align: center; }
.cart-modal__items { flex: 1; overflow-y: auto; margin-bottom: 16px; padding-right: 8px; }
.cart-modal__items::-webkit-scrollbar { width: 6px; }
.cart-modal__items::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.cart-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.cart-item__info { flex: 1; }
.cart-item__name { font-weight: 500; font-size: 15px; }
.cart-item__price { color: var(--muted); font-size: 13px; }
.cart-item__qty { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 4px 10px; border-radius: 20px; }
.cart-item__btn { background: none; border: none; font-size: 18px; color: var(--ink); cursor: pointer; padding: 0 4px; }
.cart-item__num { font-weight: 600; font-size: 14px; min-width: 16px; text-align: center; }
.cart-modal__footer { border-top: 1px solid var(--line); padding-top: 16px; }
.cart-modal__total-row { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.cart-modal__hint { font-size: 13px; color: var(--muted); margin-bottom: 12px; text-align: center; }
.cart-modal__messengers { display: block; }
.btn-messenger { display: block; text-align: center; padding: 12px; border-radius: 12px; color: #fff; font-weight: 600; font-size: 14px; transition: opacity 0.2s; }
.btn-messenger:hover { opacity: 0.8; }
.btn-messenger--vk { background: #4C75A3; }

/* =====================================================================
   ЛАЙТБОКС
   ===================================================================== */
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(24,18,15,0.92); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; backdrop-filter: blur(4px); }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: #fff; font-size: 36px; cursor: pointer; line-height: 1; opacity: 0.7; transition: opacity 0.2s; }
.lightbox__close:hover { opacity: 1; }

/* =====================================================================
   ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ (TOAST)
   ===================================================================== */
.toast-notification {
  position: fixed;
  bottom: 90px; /* Над корзиной */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #25D366; /* Зеленый цвет успеха */
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
  text-align: center;
  width: max-content;
  max-width: 90vw;
}
.toast-notification.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 768px) {
  .toast-notification { bottom: 30px; left: auto; right: 90px; transform: translateY(20px); }
  .toast-notification.is-visible { transform: translateY(0); }
}

/* =====================================================================
   АДАПТИВ
   ===================================================================== */
@media (max-width: 768px) {
  .hero { padding: 72px 20px 56px; }
  .menu-container { padding-top: 24px; }
  .category__head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .category__rule { display: none; }
  .filter-nav__order { margin-left: 8px; }
  .footer__inner { gap: 32px; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: left; }
  .back-to-top { bottom: 20px; right: 20px; }
  .cart-fab { bottom: 20px; width: calc(100% - 40px); max-width: 400px; justify-content: space-between; border-radius: 30px; }
}
@media (max-width: 480px) {
  .dish__row h3 { font-size: 20px; }
  .footer__btn { width: 100%; text-align: center; }
  .footer__actions { flex-direction: column; width: 100%; }
  .back-to-top { bottom: 16px; right: 16px; width: 44px; height: 44px; }
  .cart-fab { bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}