:root {
  --accent: #F2760C;
  --accent-dark: #db5000;
  --accent-soft: #fff0e2;
  --bg: #F2F3F5;
  --card: #ffffff;
  --ink: #1F2226;
  --muted: #71757c;
  --line: #e6e8eb;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(31, 34, 38, 0.07);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* topbar */
.topbar {
  min-height: 5rem;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(242, 118, 12, 0.28);
}
.title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.topbar-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hours { font-size: 12px; font-weight: 600; opacity: 0.85; line-height: 1.2; }
.brand-logo { height: 36px; width: auto; display: block; flex-shrink: 0; scale:1.7 }

/* content */
.content {
  flex: 1;
  padding: 16px 14px calc(96px + var(--safe-bottom));
  overflow-y: auto;
}

.loading, .empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 15px;
}

/* sections */
.section { margin-bottom: 22px; }
.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 4px 6px 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

/* dish row */
.dish {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.dish-main { flex: 1; min-width: 0; }
.dish-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.dish-meta { margin-top: 5px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dish-meta .dot { color: var(--line); }
.dish-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  align-self: center;
}

/* combo card */
.combo {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.combo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #fff3e8, #ffe7cc);
  border-bottom: 1px solid var(--line);
}
.combo-name { font-size: 15px; font-weight: 800; line-height: 1.3; }
.combo-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}
.combo-items { list-style: none; padding: 8px 16px 14px; }
.combo-items li {
  padding: 9px 0;
  font-size: 15px;
  border-bottom: 1px dashed var(--line);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.combo-items li:last-child { border-bottom: none; }
.combo-items .b { color: var(--accent); font-weight: 700; }

/* bottom tabbar */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 460px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  z-index: 10;
  box-shadow: 0 -4px 20px rgba(34, 29, 26, 0.06);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tab .ico { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.tab.active .ico { transform: translateY(-1px); }

/* 'в комбо' badge (inline within .dish-meta, after weight · calories) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #ffd9b3;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* quantity counter (shown between − and price when item is in cart) */
.qty {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  min-width: 18px;
  text-align: center;
  align-self: center;
  line-height: 1;
}

/* dish right side (stepper? + price + add) */
.dish-right { display: flex; align-items: center; gap: 10px; }
.add-btn {
  width: 34px; height: 34px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.add-btn:active { transform: scale(0.92); }
/* minus variant: outlined, sits to the left of the price */
.add-btn.minus {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  font-size: 20px;
}

/* combo cards (list) */
.combo-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.combo-slot-pill {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #ffd9b3;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.combo-foot { padding: 0 16px 16px; }
.build-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.build-btn:active { transform: translateY(1px); }

/* builder view */
.builder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.back-btn {
  border: none;
  background: var(--card);
  border-radius: 10px;
  width: 38px; height: 38px;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.builder-title { font-size: 18px; font-weight: 800; }
.builder-price { margin-left: auto; font-size: 18px; font-weight: 800; color: var(--accent); }
.slot-block { margin-bottom: 18px; }
.slot-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 4px 4px 8px;
}
.slot-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
}
.pick {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pick.selected { border-color: var(--accent); background: var(--accent-soft); }
.pick-main { flex: 1; min-width: 0; }
.pick-name { font-size: 15px; font-weight: 700; }
.pick-meta { font-size: 13px; color: var(--muted); }
.radio {
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.pick.selected .radio { border-color: var(--accent); }
.pick.selected .radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.builder-add {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  position: sticky;
  bottom: 16px;
  -webkit-tap-highlight-color: transparent;
}
.builder-add:disabled { background: #c9cdd2; }

/* cart FAB */
.cart-fab {
  position: fixed;
  right: 16px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 20;
  width: 56px; height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(31, 34, 38, 0.3);
  -webkit-tap-highlight-color: transparent;
}
.cart-fab .ico { width: 24px; height: 24px; }
.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* cart sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 25, 0.5);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay[hidden] { display: none; }
.sheet {
  background: #fff;
  width: 100%;
  max-width: 460px;
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(12px + var(--safe-bottom));
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.22s ease;
}
@keyframes sheetUp { from { transform: translateY(50px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h3 { font-size: 18px; font-weight: 800; color: var(--ink); }
.sheet-head .x, .sheet-head .x { border: none; background: none; font-size: 26px; color: var(--muted); cursor: pointer; }
.sheet-body { overflow-y: auto; flex: 1; }
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cart-item-qty { font-size: 13px; font-weight: 700; color: var(--muted); }
.cart-item-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cart-item-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-item-price { font-weight: 800; color: var(--accent); white-space: nowrap; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { transform: scale(0.92); }
.cart-item-del {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}
.cart-item-del:hover { color: #b3261e; }
.cart-empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cart-total { font-size: 16px; font-weight: 800; color: var(--ink); }
.cart-total span { color: var(--accent); }
.btn { border: none; border-radius: 10px; padding: 9px 16px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn.danger { background: #fff; color: #b3261e; border: 1.5px solid var(--line); }
.btn:disabled { opacity: 0.5; }
.sheet-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
