:root {
  --bg: #070714;
  --bg-secondary: #0f1024;
  --panel: rgba(17, 19, 40, 0.8);
  --text: #e8ebff;
  --muted: #a3a7c4;
  --accent: #7d5bff;
  --accent-2: #5dd0ff;
  --border: rgba(125, 91, 255, 0.4);
  --radius: 18px;
  --glow: 0 0 15px rgba(125, 91, 255, 0.45);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body.neon-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(125, 91, 255, 0.18), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(93, 208, 255, 0.15), transparent 35%),
              var(--bg);
  position: relative;
  padding-bottom: 86px;
  overflow-x: hidden;
}

.bg-gradient, .bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient {
  background: radial-gradient(circle at 10% 30%, rgba(125, 91, 255, 0.25), transparent 35%),
              radial-gradient(circle at 90% 10%, rgba(93, 208, 255, 0.2), transparent 30%),
              linear-gradient(135deg, rgba(7, 7, 20, 0.9), rgba(7, 7, 20, 0.7));
  filter: blur(12px);
}

.bg-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.35;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(15, 16, 36, 0.92) 0%, rgba(15, 16, 36, 0.7) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--glow);
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: clamp(2.25rem, 6vw, 3rem);
  height: clamp(2.25rem, 6vw, 3rem);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(125, 91, 255, 0.7);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b0c19;
  letter-spacing: 0.5px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-title {
  font-weight: 700;
  letter-spacing: 0.8px;
}

.logo-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.top-actions {
  display: flex;
  flex: 1;
  min-width: 260px;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chip {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(93, 208, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(93, 208, 255, 0.25);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.chip.muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.chip:hover { box-shadow: var(--glow); }

.page-shell {
  position: relative;
  z-index: 1;
  max-width: clamp(700px, 90%, 1200px);
  margin: clamp(12px, 3vw, 36px) auto clamp(56px, 8vh, 96px);
  padding: 0 1rem 2rem;
}

.section {
  background: rgba(12, 13, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-title { margin: 0; font-size: 22px; }
.section-sub { margin: 0; color: var(--muted); font-size: 14px; }

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(135deg, rgba(125, 91, 255, 0.9), rgba(93, 208, 255, 0.9));
  box-shadow: var(--glow);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); filter: brightness(0.95); }

.detail-btn {
  min-width: 6.5rem;
  padding: 0.45rem 0.75rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  height: auto;
}

.btn.ghost {
  background: transparent;
  border-color: rgba(93, 208, 255, 0.35);
  box-shadow: none;
  display: inline-flex;
  font-weight: 600;
}

.btn.soft {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn.secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 28vw, 280px), 1fr));
  gap: 0.75rem;
}

.card {
  background: linear-gradient(160deg, rgba(17, 19, 40, 0.95), rgba(11, 12, 26, 0.9));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-box {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, rgba(125, 91, 255, 0.15), rgba(255, 255, 255, 0.02));
  border: 1px dashed rgba(93, 208, 255, 0.35);
  display: grid;
  place-items: center;
}

.image-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price { font-weight: 700; font-size: 18px; }
.muted { color: var(--muted); }

.review-rating { display: inline-flex; align-items: center; gap: 4px; }
.star { font-size: 14px; color: rgba(255,255,255,0.22); }
.star.filled { color: var(--accent-2); text-shadow: 0 0 6px rgba(93,208,255,0.18); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; }

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.toast-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.toast {
  background: rgba(17, 19, 40, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(93, 208, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(93, 208, 255, 0.15);
}

label { color: var(--muted); font-size: 14px; }

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(93, 208, 255, 0.1);
  border: 1px solid rgba(93, 208, 255, 0.3);
  color: var(--text);
  font-size: 13px;
}

.order-block {
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.order-block h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.list {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: none !important;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(17, 19, 40, 0.6);
  border: 1px solid rgba(93, 208, 255, 0.25);
  box-shadow: 0 0 12px rgba(93, 208, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: none !important;
}

.list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(125, 91, 255, 0.45);
  box-shadow: none !important;
}

.item-name {
  color: var(--accent-2);
  font-weight: 600;
  box-shadow: none !important;
}

.item-flavor {
  color: var(--accent);
  box-shadow: none !important;
}

.text-small {
  font-size: 13px;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.table th { color: var(--muted); font-weight: 600; }

.card-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(93, 208, 255, 0.4), transparent);
  margin: 8px 0;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 13, 26, 0.92);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 10px;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:last-child { border-right: none; }
.nav-item:hover { background: rgba(93, 208, 255, 0.06); }

.nav-icon { font-size: 18px; }

.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .two-column { grid-template-columns: 1fr 1fr; }
  .topbar { border-radius: 0 0 18px 18px; }
}

.empty-state {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.flex-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.stack { display: grid; gap: 10px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.soft-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.divider { height: 1px; background: rgba(255, 255, 255, 0.06); margin: 10px 0; }

.highlight { color: var(--accent-2); }

form p { margin: 0 0 12px; }
form p label { display: block; margin-bottom: 6px; }

.table-scroll { overflow: auto; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.06); }

.badge-success { background: rgba(73, 217, 139, 0.15); border-color: rgba(73, 217, 139, 0.4); }
.badge-warning { background: rgba(255, 193, 59, 0.15); border-color: rgba(255, 193, 59, 0.4); }
.badge-danger { background: rgba(244, 79, 119, 0.16); border-color: rgba(244, 79, 119, 0.4); }

.hero {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(125, 91, 255, 0.15), rgba(12, 13, 26, 0.9));
  box-shadow: var(--shadow);
  max-height: clamp(140px, 30vh, 220px);
  overflow: hidden;
}

.hero-title { margin: 0; font-size: 22px; line-height: 1.1; }
.hero-sub { margin: 0; color: var(--muted); font-size: 13px; }

.text-center { text-align: center; }

/* Кастомный select */
select {
    width: 100%;
    padding: 10px 14px;
    background: #0d0f1a;
    border: 1px solid #5dd0ff;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: 0.25s ease;
}

select:hover { border-color: #5dd0ff; }
select:focus { border-color: #5dd0ff; box-shadow: 0 0 8px rgba(150, 107, 255, 0.5); }

select option {
    background: #0d0f1a;
    color: #ffffff;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "▼";
    font-size: 12px;
    color: #b998ff;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

body.neon-body.tg-webapp {
  padding-bottom: 12px;
}

.tg-webapp .page-shell {
  margin-top: 12px;
  margin-bottom: 12px;
}

.tg-webapp .section {
  border-radius: 16px;
  padding: 14px;
}

.miniapp-chip {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(125, 91, 255, 0.18);
  border: 1px solid rgba(125, 91, 255, 0.4);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.checkout-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 12px 0;
}

.step-pill {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--muted);
}

.clickcontinue {
  background: transparent;
  border-color: rgba(93, 208, 255, 0.35);
  box-shadow: none;
  display: inline-flex;
  font-weight: 600;
}

/* Mobile-first adjustments */
@media (max-width: 480px) {
  html { font-size: 15px; }

  /* Topbar: compact, hide secondary text to save space */
  .topbar {
    padding: 10px;
    gap: 8px;
  }
  .logo-text { gap: 2px; }
  .logo-sub { display: none; }

  /* Collapse actions to a compact area (can be replaced by hamburger later) */
  .top-actions { display: none; }

  /* Page container: tighter padding */
  .page-shell { padding: 0 12px 3.25rem; margin: 12px auto 80px; }

  /* Product grid: single column for narrow screens */
  .product-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Cards: slightly larger padding and touch target */
  .card { padding: 14px; border-radius: 12px; }

  /* Inline actions stack vertically and become full-width */
  .inline-actions { flex-direction: column; align-items: stretch; }
  .inline-actions .btn, .inline-actions form, .inline-actions a { width: 100%; }

  /* Make buttons easier to tap */
  .btn { min-height: 44px; padding: 12px 16px; font-size: 1rem; }

  /* Detail button full width when stacked */
  .detail-btn { min-width: auto; width: 100%; }

  /* Bottom nav: larger targets and taller bar */
  .bottom-nav { grid-template-columns: repeat(4, 1fr); padding: 6px 0; }
  .nav-item { padding: 10px 6px; font-size: 0.95rem; }

  /* Hero: vertical layout */
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-title { font-size: 1.1rem; }

  /* Inputs larger and full width */
  input, select, textarea { font-size: 1rem; padding: 12px; }
}