:root {
  --bg: #10140F;
  --bg-deep: #0A0C08;
  --surface: #FFFFFF;
  --surface-raised: #EFF4EC;
  --line: #E2E8DE;
  --chili: #22873F;
  --chili-dim: #1B6E32;
  --saffron: #4FCB3A;
  --saffron-text: #178A43;
  --error: #E5372E;
  --text: #201C18;
  --text-muted: #8C8479;
  --text-faint: #B6AEA2;
  --text-invert: #F2F7EF;
  --text-invert-muted: #B9C7B4;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) fixed;
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

h1, h2, h3 { font-family: 'Unbounded', 'Manrope', sans-serif; margin: 0; }

img { max-width: 100%; display: block; }

button { font-family: inherit; border: none; background: none; cursor: pointer; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
  position: relative;
}

/* ===== HERO ===== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.hero {
  position: relative;
}
.hero__banner {
  width: 100%;
  aspect-ratio: 1400 / 347;
  overflow: hidden;
}
.hero__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 20px 4px;
}
.fact {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-invert-muted);
}
.fact__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-invert-muted);
  transition: background .2s ease, box-shadow .2s ease;
}
.fact__dot--live { background: #67c76a; box-shadow: 0 0 0 3px rgba(103,199,106,.2); }
.fact__dot--off { background: #cf6a4a; box-shadow: 0 0 0 3px rgba(207,106,74,.18); }
.fact__icon { color: var(--saffron); font-size: 13px; }

/* ===== CATEGORY NAV ===== */
.catnav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catchip {
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.catchip.is-active {
  color: #0E1A0C;
  background: var(--saffron);
  border-color: var(--saffron);
}

/* ===== MENU ===== */
.menu { padding: 4px 16px 8px; }

.section { margin-top: 26px; }
.section:first-child { margin-top: 6px; }
.section__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-invert);
  margin-bottom: 12px;
  scroll-margin-top: 64px;
  position: relative;
  padding-left: 12px;
}
.section__title::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--chili), var(--saffron));
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(32,28,24,.05);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.card:active {
  transform: scale(.985);
  box-shadow: 0 1px 4px rgba(32,28,24,.06);
}

.card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  overflow: hidden;
  position: relative;
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
}
.card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--chili);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.card__badge--static { position: static; display: inline-block; margin-bottom: 8px; }

.card__body { flex: 1; min-width: 0; padding: 10px 12px 12px; display: flex; flex-direction: column; }
.card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__weight {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.card__desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card__price {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.card__add {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chili);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s ease, background .15s ease;
}
.card__add:active { transform: scale(.9); }

.card__stepper {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 4px;
}
.card__stepper button {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--chili);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.card__stepper span {
  min-width: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
.card__stepper--lg {
  padding: 6px;
  gap: 14px;
}
.card__stepper--lg button {
  width: 34px; height: 34px;
  font-size: 18px;
}
.card__stepper--lg span { font-size: 16px; min-width: 18px; }

.footnote {
  padding: 6px 24px 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-invert-muted);
  text-align: center;
}

/* ===== CART BAR ===== */
.cartbar {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  max-width: 528px;
  margin: 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--chili);
  color: #fff;
  padding: 13px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(34,135,63,.35);
  animation: rise .22s ease;
}
@keyframes rise {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* ===== CALL / PROFILE BUTTONS ===== */
.call-fab-wrap {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  max-width: 528px;
  margin: 0 auto;
  z-index: 32;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  transition: bottom .2s ease;
}
body.has-cartbar .call-fab-wrap {
  bottom: calc(82px + var(--safe-bottom));
}
.call-fab {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--chili);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(34,135,63,.4);
  transition: transform .1s ease;
}
.call-fab:active { transform: scale(.92); }
.call-fab--phone {
  background: var(--error);
  box-shadow: 0 8px 22px rgba(229,55,46,.4);
}

.cartbar__count {
  background: rgba(255,255,255,.22);
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.cartbar__label {
  font-weight: 700;
  font-size: 14.5px;
  flex: 1;
  text-align: left;
}
.cartbar__sum { font-weight: 800; font-size: 14.5px; }

/* ===== CART SHEET / PRODUCT MODAL SHARED ===== */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,7,5,.55);
  z-index: 40;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(20px + var(--safe-bottom));
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sheetUp .22s ease;
  border: 1px solid var(--line);
  border-bottom: none;
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet__handle {
  width: 38px; height: 4px;
  border-radius: 3px;
  background: var(--line);
  margin: 4px auto 12px;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.sheet__head h2 { font-size: 18px; font-weight: 600; }
.sheet__close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 14px;
}
.sheet__items {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sheet-row__media {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.sheet-row__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet-row__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sheet-row__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-row__price {
  font-size: 13px;
  color: var(--text-muted);
}
.sheet-row__remove {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, background .15s ease;
}
.sheet-row__remove:active { background: var(--surface-raised); color: var(--error); }

/* ===== БЫСТРЫЕ ДОПЫ В КОРЗИНЕ ===== */
.sheet__addons {
  flex: none;
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sheet__addons:empty { display: none; }
.addon-tile {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.addon-tile__media {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.addon-tile__media img { width: 100%; height: 100%; object-fit: cover; }
.addon-tile__name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.addon-tile__price {
  font-size: 11px;
  font-weight: 700;
  color: var(--saffron-text);
}
.addon-tile__add {
  background: var(--chili);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
}
.addon-tile .card__stepper { align-self: center; }

.sheet__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 2px 10px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.sheet__total strong { font-size: 19px; color: var(--saffron-text); }
.sheet__checkout {
  background: var(--chili);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  padding: 15px;
  border-radius: var(--radius-md);
}

/* ===== ORDER FORM ===== */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px 12px;
}
.order-form__toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.order-form__toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}
.order-form__toggle-btn.is-active {
  color: #0E1A0C;
  background: var(--saffron);
  border-color: var(--saffron);
}
.order-form__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.order-form__input::placeholder { color: var(--text-faint); }
.order-form__input:focus { outline: none; border-color: var(--saffron); }
.order-form__textarea { resize: none; min-height: 56px; }
.order-form__persons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 600;
}
.order-form__error {
  color: var(--error);
  font-size: 12.5px;
  margin: 2px 2px 0;
}

.empty-cart {
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  padding: 30px 0;
}

/* ===== ORDER HISTORY ===== */
.order-history-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.order-history-item__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.order-history-item__date {
  font-size: 12px;
  color: var(--text-faint);
}
.order-history-item__total {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--saffron-text);
}
.order-history-item__items {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 6px;
}
.order-history-item__delivery {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ===== PRODUCT DETAIL MODAL ===== */
.product-modal {
  padding: 10px 0 calc(20px + var(--safe-bottom));
  max-height: 88vh;
}
.product-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: rgba(22,17,13,.55);
  backdrop-filter: blur(4px);
}
.product-modal__scroll {
  overflow-y: auto;
}
.product-modal__media {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.product-modal__emoji { font-size: 72px; }
.product-modal__info { padding: 18px 20px 4px; }
.product-modal__name {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}
.product-modal__price {
  font-size: 17px;
  font-weight: 800;
  color: var(--saffron-text);
  margin: 0 0 12px;
}
.product-modal__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}
.product-modal__compo {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 20px;
}
.product-modal__compo-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.product-modal__compo p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}
.product-modal__footer { display: flex; }
.product-modal__add {
  width: 100%;
  background: var(--chili);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  padding: 15px;
  border-radius: var(--radius-md);
  transition: transform .1s ease;
}
.product-modal__add:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  .cartbar, .sheet { animation: none; }
}

/* ===== ШИРОКИЕ ЭКРАНЫ (планшет/десктоп) ===== */
@media (min-width: 640px) {
  .app { max-width: 720px; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .app { max-width: 980px; }
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1440px) {
  .app { max-width: 1180px; }
}
