:root {
  --butter: #FFD25A;
  --ink: #2B1B12;
  --ink-soft: #4A3B32;
  --muted: #6B5D55;
  --line: #EFE7E1;
  --chip: #F6F1EC;
  --white: #FFFFFF;
  --open: #1F6B37;
  --closed: #9A2B2B;
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chip);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button { font-family: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* Шапка */
.brand {
  background: var(--butter);
  padding: calc(14px + env(safe-area-inset-top)) 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.brand__id { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.5px; }
.brand__status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--open); flex-shrink: 0; }
.dot.is-closed { background: var(--closed); border-radius: 2px; }

.langs { display: flex; flex-shrink: 0; background: rgba(43, 27, 18, 0.12); border-radius: 999px; padding: 3px; }
.langs button {
  border: 0; width: 46px; height: 44px; border-radius: 999px;
  background: transparent; font-weight: 700; font-size: 12px;
}
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

/* Липкая панель: поиск, вкладки, категории */
.bar {
  position: sticky; top: 0; z-index: 3;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex; align-items: center; gap: 10px;
  height: 50px; margin: 0; padding: 0 6px 0 16px;
  background: var(--white); color: var(--muted);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(43, 27, 18, 0.14);
  position: relative;
}
.bar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 31px;
  background: var(--butter);
}
.bar { padding-top: 6px; }
.bar > * { position: relative; }
.bar > .search { margin: 0 16px; }
.bar.is-searching { padding-bottom: 12px; }
.search input {
  flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent;
  font: 400 16px var(--body); color: var(--ink);
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search__clear {
  border: 0; width: 44px; height: 44px; border-radius: 50%; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 0; }
.tab {
  height: 56px; border-radius: 16px; border: 2px solid var(--ink); background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 0 6px;
}
.tab b { font-weight: 700; font-size: 16px; }
.tab span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--white); }

.chips {
  display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--chip); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.chip i { font-style: normal; font-weight: 500; color: var(--muted); }
.chip.is-active { background: var(--butter); }
.chip.is-active i { color: var(--ink); }

/* Лента */
main { flex: 1; }
h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 18px; line-height: 1.3; }

.hits { padding: 16px 0 4px; }
.hits h2 { margin: 0 16px 12px; }
.hits__row { display: flex; gap: 12px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.hits__row::-webkit-scrollbar { display: none; }
.hit {
  flex: 0 0 168px; border: 0; padding: 0; background: transparent; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.hit img { width: 168px; height: 132px; object-fit: cover; border-radius: 18px; display: block; background: var(--chip); }
.hit__name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.price { font-weight: 700; font-size: 15px; white-space: nowrap; }

.sec { padding: 0 16px; }
.sec__head { display: flex; align-items: baseline; gap: 8px; padding: 20px 0 4px; }
.sec__head span { font-size: 14px; color: var(--muted); }

.row {
  display: flex; gap: 14px; align-items: center; width: 100%; min-height: 60px;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left;
}
.row:last-child { border-bottom: 0; }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.row__cat { font-size: 12px; font-weight: 600; color: var(--muted); }
.row__name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.row img { width: 84px; height: 84px; object-fit: cover; border-radius: 16px; flex-shrink: 0; background: var(--chip); }

/* Поиск */
.results { padding: 14px 16px 24px; }
.results__label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.kws { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.kws .chip.is-active { background: var(--ink); color: var(--white); }
.empty { margin-top: 12px; background: var(--chip); border-radius: 16px; padding: 18px 16px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

/* Подвал */
.foot {
  margin-top: 24px; background: var(--chip);
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.foot__info { font-size: 14px; color: var(--ink-soft); }
.foot__row { display: flex; gap: 10px; }
.btn {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 50px; padding: 8px 12px; border-radius: 16px; border: 0;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn--dark { background: var(--ink); color: var(--white); }
.btn--light { background: var(--white); color: var(--ink); }

/* Карточка блюда */
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sheet__backdrop { position: absolute; inset: 0; border: 0; background: rgba(43, 27, 18, 0.55); animation: fade 0.2s ease; }
.sheet__panel {
  position: relative; width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--white); border-radius: 24px 24px 0 0;
  animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet__img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--chip); }
.sheet__body { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet__cat { align-self: flex-start; background: var(--butter); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.sheet h1 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.3; }
.sheet__alts { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--muted); }
.sheet__price { font-weight: 700; font-size: 26px; }
.sheet__say { background: var(--chip); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.sheet__say span { font-size: 13px; color: var(--muted); }
.sheet__say b { font-size: 16px; font-weight: 600; }
.sheet .btn { flex: none; min-height: 54px; font-size: 16px; margin-top: 4px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sheet__backdrop, .sheet__panel { animation: none; }
  html { scroll-behavior: auto; }
}
