/* Tokens — mirror the Figma file "Everest N1 — Telegram Mini App" */
:root {
  --bg: #F4FBFC;
  --white: #FFFFFF;
  --teal: #1FB3C1;
  --teal-d: #0E8A97;
  --teal-l: #E3F4F7;
  --pink: #F0508C;
  --ink: #0F2A30;
  --muted: #6B8389;
  --line: #DCEBEE;
  --shadow-card: 0 4px 16px rgba(14, 138, 151, 0.10);
  --shadow-cart: 0 8px 20px rgba(14, 138, 151, 0.35);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 48px; height: 48px; border-radius: 24px; display: block; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 26px; }
.delivery { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; line-height: 16px; color: var(--pink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }
.actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 22px; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card);
}
.notif {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #FF3B30; color: var(--white);
  font-weight: 800; font-size: 11px; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Tabs */
.tabs-wrap { padding: 0 16px; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--teal-l); border-radius: 18px; }
.tab {
  flex: 1; padding: 11px 12px; border-radius: 14px;
  font-weight: 800; font-size: 14px; line-height: 20px; color: var(--muted);
  transition: background .15s, color .15s;
}
.tab.is-active { background: var(--white); color: var(--teal-d); box-shadow: var(--shadow-card); }

/* Categories */
.categories { display: flex; gap: 8px; padding: 14px 16px; overflow-x: auto; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 18px; background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700; font-size: 13px; line-height: 18px; color: var(--ink);
}
.chip.is-active { background: var(--ink); color: var(--white); box-shadow: none; }

/* Section title (desserts) */
.section-title { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.section-title h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 30px; }
.section-title p { font-size: 13px; line-height: 18px; color: var(--muted); }

/* Product list */
.list { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.card {
  display: flex; gap: 12px; padding: 12px; background: var(--white); border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card);
}
.card-img { width: 96px; height: 96px; flex: none; border-radius: 14px; object-fit: cover; background: var(--teal-l); display: block; }
.info { flex: 1; min-width: 0; height: 96px; display: flex; flex-direction: column; justify-content: space-between; }
.info-top { display: flex; flex-direction: column; gap: 4px; }
.name { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 22px; }
.desc { font-size: 12px; line-height: 16px; color: var(--muted); }
.sizes { display: flex; gap: 6px; }
.size {
  padding: 4px 10px; border-radius: 12px; background: var(--teal-l); color: var(--teal-d);
  font-weight: 700; font-size: 12px; line-height: 16px;
}
.size.is-active { background: var(--teal); color: var(--white); }
.price-row { display: flex; align-items: center; justify-content: space-between; }
.price { display: flex; align-items: center; gap: 4px; }
.price-value { font-weight: 800; font-size: 18px; line-height: 24px; color: var(--teal-d); }
.price-cur { font-weight: 600; font-size: 12px; line-height: 16px; color: var(--muted); }
.add {
  width: 36px; height: 36px; border-radius: 18px; background: var(--teal);
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
}
.add:active { transform: scale(.9); }
.stepper {
  height: 36px; border-radius: 18px; background: var(--teal); color: var(--white);
  display: flex; align-items: center;
}
.stepper button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 18px; }
.stepper button:active { background: rgba(255, 255, 255, .2); }
.qty { min-width: 20px; text-align: center; font-weight: 800; font-size: 15px; line-height: 20px; }

/* Cart bar */
.cart-wrap { position: sticky; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 6; }
.cart {
  width: 100%; height: 60px; padding: 0 16px; border-radius: 22px; background: var(--teal);
  display: flex; align-items: center; justify-content: space-between; color: var(--white);
  box-shadow: var(--shadow-cart); font-weight: 800; font-size: 15px; line-height: 20px;
}
.cart-left, .cart-right { display: flex; align-items: center; gap: 10px; }
.badge {
  width: 28px; height: 28px; border-radius: 14px; background: var(--white); color: var(--teal-d);
  display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 18px;
}

/* ============ Views / sub-pages ============ */
.view[hidden] { display: none; }
.pad8 { padding: 8px 16px; }
.pad16 { padding: 16px 16px 8px; }

.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px; }
.back-btn {
  width: 44px; height: 44px; border-radius: 22px; background: var(--white);
  display: flex; align-items: center; justify-content: center; justify-self: start;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card);
}
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 28px; }
.topbar-action { justify-self: end; font-weight: 800; font-size: 13px; line-height: 18px; color: var(--pink); padding: 8px 0; }
.topbar-spacer { width: 44px; justify-self: end; }
.tabs-static { position: static; }

/* Cart */
.cart-list { padding-top: 4px; }
.cart-item { display: flex; gap: 12px; padding: 12px; background: var(--white); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card); }
.cart-item .card-img { width: 80px; height: 80px; }
.cart-item .info { height: 80px; }
.cart-item .name { font-size: 16px; line-height: 20px; }
.unit { font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.line-total { font-weight: 800; font-size: 16px; line-height: 22px; color: var(--teal-d); }

/* Summary */
.summary { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--white); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card); }
.sum-row { display: flex; align-items: center; justify-content: space-between; }
.sum-row span:first-child { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--muted); }
.sum-row span:last-child { font-weight: 800; font-size: 14px; line-height: 20px; }
.sum-row.accent span:last-child { color: var(--pink); }
.sum-row.strong span:first-child { font-weight: 800; font-size: 17px; line-height: 24px; color: var(--ink); }
.sum-row.strong span:last-child { font-size: 18px; line-height: 24px; color: var(--teal-d); }
.sum-divider { height: 1px; background: var(--line); }

/* CTA */
.cta-wrap { position: sticky; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 6; }
.cta {
  width: 100%; height: 60px; padding: 0 20px; border-radius: 22px; background: var(--teal); color: var(--white);
  display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-cart);
  font-weight: 800; font-size: 16px; line-height: 22px;
}
.cta-right { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 20px; }
.cta[disabled] { opacity: .6; }
.form-error { margin-top: 10px; text-align: center; font-weight: 700; font-size: 13px; line-height: 18px; color: #E5384B; }

/* Centered states (empty cart / success) */
.center-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 32px; min-height: calc(100vh - 72px); text-align: center; }
.empty-logo { width: 120px; height: 120px; border-radius: 60px; }
.state-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 30px; }
.state-title.big { font-size: 26px; line-height: 32px; }
.state-text { font-size: 14px; line-height: 20px; color: var(--muted); }
.btn-pill { padding: 14px 28px; border-radius: 22px; background: var(--teal); color: var(--white); font-weight: 800; font-size: 15px; line-height: 20px; box-shadow: var(--shadow-cart); }
.btn-wide { width: 100%; padding: 16px; border-radius: 22px; background: var(--teal); color: var(--white); font-weight: 800; font-size: 16px; line-height: 22px; box-shadow: var(--shadow-cart); margin-top: 8px; }
.center-state.success { padding: 0 24px; min-height: 100vh; }
.halo { width: 112px; height: 112px; border-radius: 56px; background: var(--teal-l); display: flex; align-items: center; justify-content: center; }
.disc { width: 72px; height: 72px; border-radius: 36px; background: var(--teal); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-cart); }
.order-no { font-weight: 800; font-size: 15px; line-height: 20px; color: var(--teal-d); }
.summary.full { width: 100%; text-align: left; margin-top: 4px; }

/* Checkout form */
.block { display: flex; flex-direction: column; gap: 10px; }
.block[hidden] { display: none; }
.block-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 22px; }
.field { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; background: var(--white); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.field-label { font-weight: 700; font-size: 11px; line-height: 14px; color: var(--muted); }
.field input { border: 0; outline: 0; background: transparent; font: 600 15px/20px var(--font-body); color: var(--ink); width: 100%; padding: 0; }
.field input::placeholder { color: var(--muted); font-weight: 600; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--teal); }
.field.is-error { box-shadow: inset 0 0 0 2px #E5384B; }
.btn-soft { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 16px; background: var(--teal-l); color: var(--teal-d); font-weight: 800; font-size: 14px; line-height: 20px; }
.btn-soft.is-done { background: var(--teal); color: var(--white); }
.btn-soft.is-done svg path, .btn-soft.is-done svg circle { stroke: #fff; }
.pay { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--white); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pay.is-active { box-shadow: inset 0 0 0 2px var(--teal); }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); flex: none; display: flex; align-items: center; justify-content: center; }
.pay.is-active .radio { background: var(--teal); box-shadow: none; }
.pay.is-active .radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--white); }
.pay-text { display: flex; flex-direction: column; gap: 2px; }
.pay-text b { font-weight: 800; font-size: 15px; line-height: 20px; }
.pay-text small { font-size: 12px; line-height: 16px; color: var(--muted); }

.demo-note { padding: 10px 14px; border-radius: 14px; background: var(--pink-l, #FDE6EF); color: var(--pink); font-weight: 700; font-size: 12px; line-height: 16px; }
.demo-note[hidden] { display: none; }
