:root {
  --ink: #1a1d24;
  --ink-soft: #4a5160;
  --asphalt: #12151a;
  --asphalt-2: #1c222c;
  --amber: #f0a000;
  --amber-deep: #c47e00;
  --surface: #f3f5f7;
  --white: #ffffff;
  --line: rgba(26, 29, 36, 0.1);
  --ok: #2f9e6b;

  --font-brand: "Unbounded", ui-sans-serif, sans-serif;
  --font-ui: "Sora", ui-sans-serif, system-ui, sans-serif;

  --app-width: 560px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--asphalt);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  max-width: var(--app-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  overflow-x: hidden;
}

body.in-telegram {
  max-width: none;
  width: 100%;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: none; flex-shrink: 0; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 16px;
  background: transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
  color: var(--white);
}

.header.is-light {
  background: rgba(243, 245, 247, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  color: var(--ink);
}

.header.is-solid {
  background: rgba(18, 21, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.header__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
}

.logo {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.header__actions { margin-left: auto; display: flex; gap: 4px; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}

.counter {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--asphalt);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.counter--tab {
  top: 2px;
  right: calc(50% - 28px);
}

/* ---------- App shell ---------- */
.app {
  min-height: calc(100vh - 56px - var(--tabbar-h) - var(--safe-bottom));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
}

body.has-actionbar .app {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 88px);
}

body.has-mainbutton .tabbar,
body.has-mainbutton .actionbar { display: none !important; }

.view { animation: rise 0.55s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: -56px 0 0;
  padding: 88px 20px 36px;
  min-height: min(72vh, 560px);
  color: var(--white);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 10%, rgba(240, 160, 0, 0.28), transparent 55%),
    radial-gradient(90% 70% at 10% 90%, rgba(91, 141, 239, 0.18), transparent 50%),
    linear-gradient(165deg, #1a1f28 0%, #12151a 45%, #0c0e12 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  pointer-events: none;
}

.hero__orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -40px;
  top: 120px;
  background: radial-gradient(circle at 35% 35%, #ffc44d, #f0a000 45%, transparent 70%);
  filter: blur(4px);
  opacity: 0.85;
  animation: drip 5s var(--ease) infinite;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 360px;
  animation: brandIn 0.7s var(--ease) both;
}

.hero__brand {
  font-family: var(--font-brand);
  font-size: clamp(48px, 14vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 18px;
  background: linear-gradient(90deg, #ffffff 0%, #c8ccd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero__sub {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  max-width: 280px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--amber);
  color: var(--asphalt);
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.hero__cta:active { transform: scale(0.98); }

.hero__note {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.hero__note svg { width: 18px; height: 18px; color: var(--amber); }

/* ---------- Sections ---------- */
.section {
  padding: 28px 16px 8px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section__title {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.muted { color: var(--ink-soft); font-size: 13px; }

.perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-top: -18px;
  position: relative;
  z-index: 2;
}

.perk {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(18, 21, 26, 0.06);
}

.perk svg { color: var(--amber-deep); width: 22px; height: 22px; }
.perk b { font-size: 14px; font-weight: 600; }
.perk span { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }

/* ---------- Fuel grid ---------- */
.fuel-grid {
  display: grid;
  gap: 12px;
}

.fuel-card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.fuel-card:active { transform: scale(0.985); }

.fuel-card__can {
  width: 88px;
  height: 96px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #2a303a, #15191f);
}

.fuel-card__can::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 14%;
  top: 28%;
  border-radius: 10px 10px 12px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 75%, white), var(--tone));
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.18);
}

.fuel-card__can::before {
  content: "";
  position: absolute;
  left: 34%;
  right: 34%;
  top: 10%;
  height: 14px;
  border-radius: 4px;
  background: #3a424e;
  z-index: 1;
}

.fuel-card__meta { min-width: 0; }
.fuel-card__grade {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 2px;
}
.fuel-card__tag { margin: 0; font-size: 13px; color: var(--ink-soft); }
.fuel-card__price {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.fuel-card__price small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: right;
}

.badge-hot {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(240, 160, 0, 0.16);
  color: var(--amber-deep);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Product ---------- */
.product-hero {
  margin: -56px 0 0;
  padding: 88px 20px 28px;
  color: var(--white);
  background:
    radial-gradient(80% 70% at 85% 20%, color-mix(in srgb, var(--tone) 55%, transparent), transparent 60%),
    linear-gradient(165deg, #1c222c, #12151a 70%);
  min-height: 280px;
}

.product-hero__grade {
  font-family: var(--font-brand);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 10px;
}

.product-hero__name { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.product-hero__blurb { margin: 0; color: rgba(255, 255, 255, 0.65); font-size: 14px; max-width: 340px; }

.panel {
  margin: -20px 16px 0;
  padding: 18px;
  background: var(--white);
  border-radius: 18px;
  border: 1px solid var(--line);
  position: relative;
  z-index: 2;
  box-shadow: 0 12px 40px rgba(18, 21, 26, 0.08);
}

.panel + .panel { margin-top: 12px; }

.panel__label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.volume-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.volume {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.volume.is-active {
  border-color: var(--asphalt);
  background: var(--asphalt);
  color: var(--white);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px;
}

.stepper button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
}

.stepper button svg { width: 18px; height: 18px; }
.stepper strong { min-width: 28px; text-align: center; font-size: 15px; }

.price-line {
  text-align: right;
}
.price-line b {
  display: block;
  font-size: 22px;
  font-family: var(--font-brand);
  letter-spacing: -0.03em;
}
.price-line span { font-size: 12px; color: var(--ink-soft); }

.facts {
  display: grid;
  gap: 10px;
  padding: 8px 16px 0;
}

.fact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--line);
}

.fact svg { color: var(--amber-deep); margin-top: 2px; }
.fact b { display: block; font-size: 14px; margin-bottom: 2px; }
.fact span { font-size: 12px; color: var(--ink-soft); }

/* ---------- Cart ---------- */
.page-head {
  padding: 8px 16px 4px;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.cart-list { display: grid; gap: 10px; padding: 8px 16px; }

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.cart-item__can {
  width: 64px;
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(160deg, #2a303a, #15191f);
  position: relative;
  overflow: hidden;
}
.cart-item__can::after {
  content: "";
  position: absolute;
  inset: 22% 20% 16%;
  border-radius: 8px;
  background: var(--tone);
}

.cart-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cart-item__top b { font-size: 15px; }
.cart-item__top span { font-size: 14px; font-weight: 600; white-space: nowrap; }

.summary {
  margin: 8px 16px 0;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.summary__row--total {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
}

.delivery-banner {
  margin: 12px 16px 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(240, 160, 0, 0.12);
  color: var(--ink);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.delivery-banner svg { color: var(--amber-deep); width: 20px; height: 20px; flex-shrink: 0; }

.empty {
  padding: 64px 24px;
  text-align: center;
}
.empty svg { width: 40px; height: 40px; color: var(--ink-soft); margin: 0 auto 12px; }
.empty h3 {
  margin: 0 0 6px;
  font-family: var(--font-brand);
  font-size: 22px;
}
.empty p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 12px;
  padding: 8px 16px;
}

.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.field__input:focus { border-color: var(--asphalt); }
.field__input.is-invalid { border-color: #d64545; }
textarea.field__input { min-height: 88px; resize: vertical; }

.mode-lock {
  margin: 0 16px 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--asphalt);
  color: var(--white);
  display: flex;
  gap: 12px;
  align-items: center;
}
.mode-lock svg { color: var(--amber); }
.mode-lock b { display: block; font-size: 14px; margin-bottom: 2px; }
.mode-lock span { font-size: 12px; color: rgba(255, 255, 255, 0.62); }

/* ---------- Success ---------- */
.success {
  margin: -56px 0 0;
  min-height: calc(100vh - var(--tabbar-h));
  padding: 120px 24px 40px;
  text-align: center;
  color: var(--white);
  background:
    radial-gradient(70% 50% at 50% 20%, rgba(47, 158, 107, 0.35), transparent 60%),
    linear-gradient(180deg, #1c222c, #12151a);
}
.success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok);
  animation: brandIn 0.6s var(--ease) both;
}
.success__icon svg { width: 28px; height: 28px; stroke: #fff; }
.success h1 {
  margin: 0 0 10px;
  font-family: var(--font-brand);
  font-size: 28px;
  letter-spacing: -0.03em;
}
.success p {
  margin: 0 auto 24px;
  max-width: 320px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* ---------- Buttons / chrome ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  background: var(--asphalt);
  color: var(--white);
}
.btn--amber { background: var(--amber); color: var(--asphalt); }
.btn--white { background: var(--white); color: var(--asphalt); }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--app-width));
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 12px var(--safe-bottom);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
}

body.in-telegram .tabbar {
  left: 0;
  transform: none;
  width: 100%;
}

.tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
}
.tabbar__item.is-active { color: var(--asphalt); }
.tabbar__item svg { width: 22px; height: 22px; }

.actionbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  width: min(100%, var(--app-width));
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  z-index: 45;
}

body.in-telegram .actionbar {
  left: 0;
  transform: none;
  width: 100%;
}

.actionbar__price { display: grid; }
.actionbar__price .caption { font-size: 11px; color: var(--ink-soft); }
.actionbar__price b { font-size: 18px; font-family: var(--font-brand); letter-spacing: -0.02em; }
.actionbar .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(12px);
  max-width: min(90%, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--asphalt);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
  z-index: 80;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.has-actionbar .toast {
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 96px);
}
