:root {
  --bg: #0d0d0f;
  --bg-elevated: #16161a;
  --surface: #1c1c22;
  --surface2: #24242c;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #e11d2e;
  --accent-hover: #c91726;
  --accent-soft: rgba(225, 29, 46, 0.15);
  --border: #2d2d35;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 58px;
  --frame-max: 440px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(145deg, #080809 0%, #141418 50%, #0a0a0c 100%);
  color: var(--text);
  line-height: 1.45;
}

.app-frame {
  width: 100%;
  max-width: var(--frame-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 25px 80px rgba(0, 0, 0, 0.55);
}

/* На телефоне раньше снимали max-width — из‑за этого в широком WebView MAX колонка «расползалась». Оставляем ту же макс. ширину, только убираем тень. */
@media (max-width: 480px) {
  .app-frame {
    box-shadow: none;
  }
}

.app-root {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px));
}

/* ——— Headers ——— */
.top-header {
  padding: 1rem 1rem 1.1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.top-header--sub {
  padding-top: 0.65rem;
}

.top-header h1 {
  margin: 0.4rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.link-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.link-back:hover {
  text-decoration: underline;
}

.content {
  padding: 0 0.9rem 1.25rem;
}

/* ——— Home: promo + categories ——— */
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.home-brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.hours-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.promo-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(125deg, #2a1810 0%, #1a1518 45%, #1e1218 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.promo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 20%, rgba(225, 29, 46, 0.35), transparent 55%);
  pointer-events: none;
}

.promo-card__badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.promo-card__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.promo-card__sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.4rem;
  transition: transform 0.12s ease, border-color 0.12s;
}

.category-tile:active {
  transform: scale(0.97);
}

.category-tile__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.45rem;
}

.category-tile__label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.tile-grad-a {
  background: linear-gradient(145deg, #3d2418, #1f1410);
}
.tile-grad-b {
  background: linear-gradient(145deg, #1a2832, #0f1820);
}
.tile-grad-c {
  background: linear-gradient(145deg, #2a2630, #15141a);
}

.staff-link {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.75rem;
}

.staff-link a {
  color: #52525b;
}

/* ——— Category chips + dish grid ——— */
.cat-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin: 0 -0.25rem 0.75rem;
  scrollbar-width: none;
}

.cat-chips::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.cat-chip--active {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.dish-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.dish-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.12s ease;
}

.dish-card:active {
  transform: scale(0.98);
}

.dish-card--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dish-card__img {
  aspect-ratio: 1;
  width: 100%;
  background-size: cover;
  background-position: center;
}

.dish-card__body {
  padding: 0.55rem 0.65rem 0.65rem;
}

.dish-card__name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-card__meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.dish-card__price {
  margin-top: 0.45rem;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
}

/* Dish visual gradients (no photos) */
.dish-visual--0 {
  background: linear-gradient(160deg, #4a3028, #1c1412);
}
.dish-visual--1 {
  background: linear-gradient(160deg, #283d35, #101816);
}
.dish-visual--2 {
  background: linear-gradient(160deg, #3a3548, #16141c);
}
.dish-visual--3 {
  background: linear-gradient(160deg, #4a3d28, #1a1610);
}
.dish-visual--4 {
  background: linear-gradient(160deg, #2d3838, #0f1414);
}
.dish-visual--5 {
  background: linear-gradient(160deg, #422828, #160e0e);
}
.dish-visual--6 {
  background: linear-gradient(160deg, #384022, #14160c);
}
.dish-visual--7 {
  background: linear-gradient(160deg, #2a3040, #0e1018);
}

/* ——— Product page ——— */
.product-scroll {
  padding-bottom: 5.5rem;
}

.product-hero {
  position: relative;
  margin: 0 -0.9rem;
}

.product-hero__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 280px;
}

.product-hero__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.product-sheet {
  padding-top: 1rem;
}

.product-page .product-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
  line-height: 1.5;
}

.nutrition {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.nutrition__title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
}

.nutrition__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  text-align: center;
}

.nutrition__val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.nutrition__key {
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.product-bar {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame-max);
  padding: 0.65rem 0.9rem;
  background: rgba(22, 22, 26, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  z-index: 40;
}

.product-bar__left {
  min-width: 0;
  flex: 1 1 40%;
}

.product-bar__name {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-bar__meta {
  font-size: 0.68rem;
  color: var(--muted);
}

.product-bar__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: 1 1 auto;
}

.product-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.product-bar .btn-primary {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}

@media (max-width: 480px) {
  .product-bar {
    max-width: 100%;
    left: 0;
    transform: none;
  }
}

/* ——— Cart ——— */
.cart-lines {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.cart-line {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.cart-line__thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
  align-self: center;
}

.cart-line__mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.cart-line__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.cart-line__title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
}

.cart-line__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-line__sum {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.upsell {
  margin: 1.25rem 0 0.5rem;
}

.upsell__title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.upsell__scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin: 0 -0.25rem;
  scrollbar-width: none;
}

.upsell__scroll::-webkit-scrollbar {
  display: none;
}

.upsell-card {
  flex: 0 0 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.upsell-card__img {
  height: 72px;
  width: 100%;
}

.upsell-card__body {
  padding: 0.4rem 0.45rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
}

.upsell-card__price {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.cart-checkout-bar {
  position: sticky;
  bottom: 0;
  margin-top: 1rem;
  padding-top: 0.5rem;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-wide {
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}

.btn-icon {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 10px;
}

/* ——— Lists / misc ——— */
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge-stop {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f87171;
}

.warn {
  color: #f87171;
  font-weight: 500;
}

.qty-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qty-val {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 1.5rem;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.cart-footer {
  padding-top: 0.25rem;
}

.cart-total {
  font-size: 1.05rem;
  margin: 0.5rem 0 0.85rem;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.checkout-form label,
.checkout-form fieldset {
  display: block;
  margin-bottom: 0.9rem;
}

.checkout-form input[type='text'],
.checkout-form input[type='tel'],
.checkout-form input[type='number'],
.checkout-form input[type='time'],
.checkout-form input[type='datetime-local'],
.checkout-form textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.radio-group legend {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  margin-bottom: 0.35rem;
}

.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
}

.mini-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.success-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.55rem;
}

.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #fda4af;
}

.small {
  font-size: 0.78rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.65rem;
}

.info-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.info-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.admin-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.admin-section h2 {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.stop-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stop-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.json-area {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.admin-orders {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-order select {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

/* ——— Bottom nav ——— */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame-max);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 0.4rem;
  background: rgba(13, 13, 15, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 50;
}

@media (max-width: 480px) {
  .bottom-nav {
    left: 0;
    transform: none;
    max-width: none;
  }
}

.bottom-nav[hidden] {
  display: none;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.58rem;
  color: #71717a;
  text-decoration: none;
  flex: 1;
  max-width: 72px;
  font-weight: 600;
}

.nav-item__icon {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0.85;
}

.nav-item--active {
  color: var(--accent);
}

.nav-item--active .nav-item__icon {
  opacity: 1;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: 4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 4px;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
}
