/* ===== Foodly — дизайн-система (тёплая «вкусная» палитра) ===== */
:root {
  /* Основные — тёплый оранжевый/янтарь */
  --orange: #f97316;
  --orange-dark: #ea580c;
  --amber: #fbbf24;
  --amber-2: #fcd34d;

  /* Зелёный акцент — под логотип-авокадо, для «экономии»/эко-смыслов */
  --leaf: #65a30d;
  --leaf-dark: #4d7c0f;
  --leaf-soft: #ecfccb;

  /* Фоны и поверхности */
  --bg: #fcf9f7;          /* тёплый белый */
  --card: #ffffff;
  --peach-50: #fff6ed;
  --peach-100: #ffefe2;
  --footer-bg: #fcf2e9;

  /* Границы */
  --line: #fde3c5;
  --line-soft: #fff1e0;

  /* Текст */
  --ink: #2c2c2c;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  /* Статусы */
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --amber-soft: #fef3c7;

  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 1px 3px rgba(120, 60, 10, 0.05), 0 12px 28px rgba(120, 60, 10, 0.06);
  --shadow-soft: 0 8px 18px -6px rgba(249, 115, 22, 0.18);
  --max: 620px;
  --nav-h: 66px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.app {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 24px);
  position: relative;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(252, 249, 247, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Логотип-авокадо + вордмарк */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.brand img { height: 34px; width: 34px; }
.brand .word { color: var(--ink); }
.brand .word b { color: var(--orange); font-weight: 800; }
.brand small { color: var(--orange); font-weight: 800; }

/* Навигация в шапке — только на десктопе (см. media-запрос ниже) */
.top-nav { display: none; }

.content { padding: 16px 16px 8px; }

.page-title { font-size: 23px; font-weight: 800; margin: 6px 2px 4px; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin: 0 2px 16px; font-size: 14px; }

/* ---- HERO (лендинг покупателя) ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #fff5e9, #ffefe2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    radial-gradient(circle at 82% 22%, rgba(251,191,36,0.20), transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(249,115,22,0.14), transparent 40%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: 27px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.hero h1 .accent { color: var(--orange); }
.hero p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* плитки еды в hero */
.food-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.food-tile {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 16px; padding: 12px 6px; text-align: center;
  backdrop-filter: blur(4px);
}
.food-tile .emo { font-size: 30px; }
.food-tile .lbl { font-size: 12px; font-weight: 700; color: var(--orange-dark); margin-top: 2px; }

/* ---- Section header ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-head h2 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.section-head a { color: var(--orange); font-size: 14px; font-weight: 700; }

/* ---- Filters / категории ---- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 9px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all 0.15s; box-shadow: 0 1px 2px rgba(120,60,10,0.04);
}
.chip:hover { background: var(--peach-50); border-color: var(--amber); }
.chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }

.search {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 14px; padding: 13px 15px; font-size: 15px; margin-bottom: 12px; font-family: inherit;
}
.search:focus { outline: 2px solid var(--peach-100); border-color: var(--orange); }

/* ---- Карточки офферов ---- */
.grid { display: grid; gap: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 26px -8px rgba(120,60,10,0.12); }
.card:active { transform: scale(0.99); }

.card-media {
  position: relative; height: 132px;
  background: linear-gradient(135deg, #ffe7cc, #fdd6ad);
  display: grid; place-items: center; font-size: 46px;
}
.badge-discount {
  position: absolute; top: 10px; right: 10px;
  background: var(--orange); color: #fff;
  font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-left {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(44,44,44,0.72); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
/* Таймер обратного отсчёта до конца самовывоза */
.timer-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.92); color: #9a3412;
  border: 1px solid rgba(249,115,22,0.25);
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px);
}

.card-body { padding: 12px 14px 14px; }
.store-row { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.card-title { font-weight: 700; font-size: 16px; margin: 2px 0 6px; letter-spacing: -0.01em; }
.pickup { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }

.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-old { color: var(--muted-2); text-decoration: line-through; font-size: 14px; }
.price-new { color: var(--orange); font-weight: 800; font-size: 20px; }

/* ---- Категория-бейдж ---- */
.cat {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--peach-100); color: var(--orange-dark);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}

/* ---- Кнопки ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none;
  background: var(--orange); color: #fff;
  font-weight: 700; font-size: 16px; padding: 14px 18px; border-radius: 14px;
  cursor: pointer; transition: background 0.15s, transform 0.1s; box-shadow: var(--shadow-soft);
  font-family: inherit;
}
.btn:hover { background: var(--orange-dark); }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: var(--peach-50); border-color: var(--amber); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; box-shadow: none; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { width: auto; padding: 10px 16px; font-size: 14px; border-radius: 12px; }
.btn.pill { border-radius: 999px; }

/* ---- Нижняя навигация ---- */
.bottom-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--max); height: var(--nav-h);
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; z-index: 30;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted-2); font-size: 11px; font-weight: 600;
}
.bottom-nav a .ico { font-size: 20px; }
.bottom-nav a.active { color: var(--orange); }

/* ---- Детальная страница оффера ---- */
.detail-media {
  height: 230px; position: relative;
  background: linear-gradient(135deg, #ffe7cc, #fdd6ad);
  display: grid; place-items: center; font-size: 76px;
}
.back-btn {
  position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255,255,255,0.92); border: none; display: grid; place-items: center; font-size: 18px; cursor: pointer;
}
.sheet {
  background: var(--card); border-radius: 24px 24px 0 0; margin-top: -24px; position: relative;
  padding: 22px 18px; box-shadow: var(--shadow);
}
.info-list { display: grid; gap: 12px; margin: 16px 0; }
.info-item { display: flex; gap: 12px; align-items: flex-start; }
.info-item .ico { font-size: 20px; width: 26px; text-align: center; }
.info-item .lbl { font-size: 12px; color: var(--muted); }
.info-item .val { font-weight: 600; }

.savings-box {
  background: var(--leaf-soft); border: 1px solid #d9f99d; border-radius: 16px;
  padding: 14px 16px; margin: 16px 0; display: flex; align-items: center; justify-content: space-between;
}
.savings-box .cur { font-size: 22px; font-weight: 800; color: var(--orange); }
.savings-box .big { font-size: 22px; font-weight: 800; color: var(--leaf-dark); }
.savings-box .lbl { font-size: 13px; color: var(--muted); }

/* ---- Как это работает ---- */
.how {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 20px 16px; margin: 8px 0 4px;
}
.how h2 { text-align: center; font-size: 19px; font-weight: 800; margin: 0 0 16px; }
.how-steps { display: grid; gap: 16px; }
.how-step { text-align: center; }
.how-step .circle {
  width: 56px; height: 56px; border-radius: 999px; background: var(--peach-100);
  display: grid; place-items: center; font-size: 26px; margin: 0 auto 8px;
}
.how-step h3 { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.how-step p { color: var(--muted); font-size: 13px; margin: 0; }

/* ---- Партнёрский CTA ---- */
.partner-cta {
  background: linear-gradient(120deg, var(--orange), var(--amber));
  color: #fff; border-radius: var(--radius-lg); padding: 22px 20px; margin: 20px 0 8px; text-align: center;
  box-shadow: var(--shadow);
}
.partner-cta h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.partner-cta p { margin: 0 0 16px; opacity: 0.95; font-size: 14px; }
.partner-cta .btn { background: #fff; color: var(--orange); box-shadow: none; }
.partner-cta .btn:hover { background: #fff7ee; }

/* ---- Отзывы ---- */
.review { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; box-shadow: 0 1px 2px rgba(120,60,10,0.04); }
.review .who { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review .ava { width: 38px; height: 38px; border-radius: 999px; background: var(--peach-100); color: var(--orange); font-weight: 800; display: grid; place-items: center; }
.review p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---- Брони / строки-списки ---- */
.rez { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.rez-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.pill.reserved { background: var(--leaf-soft); color: var(--leaf-dark); }
.pill.picked_up { background: #e0e7ff; color: #4338ca; }
.pill.cancelled { background: var(--danger-soft); color: var(--danger); }
.pill.expired { background: #f1f5f9; color: var(--muted); }
.pill.active { background: var(--leaf-soft); color: var(--leaf-dark); }
.pill.paused { background: var(--amber-soft); color: var(--warn); }
.pill.sold_out { background: #f1f5f9; color: var(--muted); }

/* ---- Код выдачи + QR ---- */
.code-box {
  margin-top: 12px; background: var(--peach-50); border: 1px dashed var(--orange);
  border-radius: 14px; padding: 14px; text-align: center;
}
.code-box .lbl { font-size: 12px; color: var(--muted); }
.code-box .code { font-size: 26px; font-weight: 800; letter-spacing: 0.15em; color: var(--orange-dark); }
.code-box .qr { width: 148px; height: 148px; margin: 10px auto 4px; background: #fff; padding: 8px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.code-box .qr svg, .code-box .qr img { width: 100%; height: 100%; display: block; }

/* ---- Формы ---- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px;
  font-size: 15px; font-family: inherit; background: var(--card); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--peach-100); border-color: var(--orange); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Auth ---- */
.auth-wrap { padding: 30px 20px; max-width: 430px; margin: 0 auto; }
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-logo img { width: 64px; height: 64px; margin: 0 auto 8px; }
.tabs { display: flex; background: var(--peach-100); border-radius: 12px; padding: 4px; margin: 20px 0; }
.tabs button { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; }
.tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.tg-btn { background: #229ED9; box-shadow: none; }
.tg-btn:hover { background: #1c8ac0; }
.divider { text-align: center; color: var(--muted-2); font-size: 13px; margin: 16px 0; position: relative; }
.divider::before, .divider::after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line); }
.divider::before { left: 0; } .divider::after { right: 0; }

/* ---- Утилиты ---- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; }
.stack { display: grid; gap: 10px; }
.flex { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty .ico { font-size: 46px; margin-bottom: 10px; }

.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  z-index: 100; box-shadow: var(--shadow); max-width: 88%; opacity: 0;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: var(--danger); }

/* ---- Сегментные табы (кабинет/админка) ---- */
.seg { display: flex; gap: 6px; margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  padding: 9px 15px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; font-family: inherit;
}
.seg button.active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---- Планшет ---- */
@media (min-width: 720px) and (max-width: 979px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid.single { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 30px; }
}

/* ======================================================================
   ДЕСКТОП: широкий лейаут. Мобилка/Telegram Mini App остаётся как есть.
   ====================================================================== */
@media (min-width: 980px) {
  .app { max-width: 1200px; padding-bottom: 32px; }

  /* Убираем нижнюю таб-панель — навигация уезжает в шапку */
  .bottom-nav { display: none; }

  /* Шапка во всю ширину */
  .topbar { padding: 16px 32px; }
  .brand { font-size: 22px; }
  .brand img { height: 38px; width: 38px; }
  .top-nav { display: flex; gap: 4px; margin: 0 auto 0 32px; }
  .top-nav a {
    padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px;
    color: var(--muted); transition: all 0.15s;
  }
  .top-nav a:hover { background: var(--peach-50); color: var(--ink); }
  .top-nav a.active { color: var(--orange); background: var(--peach-100); }

  .content { padding: 26px 32px 44px; }

  /* Контент-страницы (брони/кабинет/админка) — комфортная ширина */
  .content.narrow { max-width: 860px; margin: 0 auto; }

  /* HERO — две колонки */
  .hero { padding: 44px 48px; }
  .hero-inner { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 44px; }
  .hero-text { flex: 1; max-width: 560px; }
  .hero h1 { font-size: 42px; }
  .hero p { font-size: 18px; }
  .food-tiles { grid-template-columns: repeat(2, 1fr); width: 340px; margin-top: 0; gap: 12px; flex: 0 0 auto; }
  .food-tile { padding: 22px 10px; }
  .food-tile .emo { font-size: 38px; }

  /* Витрина — 3 колонки */
  .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .how { padding: 34px; }

  /* Партнёрский CTA — горизонтально */
  .partner-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; text-align: left; padding: 28px 36px; }
  .partner-cta .cta-text { flex: 1; }
  .partner-cta h2 { font-size: 24px; }

  /* Детальная страница оффера — по центру, не на всю ширину */
  .detail-media { max-width: 760px; margin: 20px auto 0; border-radius: 24px; }
  .sheet { max-width: 760px; margin: -24px auto 0; }

  /* Форма входа выше и по центру */
  .auth-wrap { padding-top: 56px; }
}

/* Очень широкие экраны — 4 колонки витрины */
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
