:root {
  --bg: #050508;
  --bg2: #0c0814;
  --card: #12101c;
  --purple: #9333ea;
  --purple-light: #d8b4fe;
  --purple-dark: #6b21a8;
  --purple-glow: rgba(147, 51, 234, 0.45);
  --text: #faf8ff;
  --muted: #9d8fb8;
  --border: rgba(147, 51, 234, 0.22);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 18px;
  --hero-h: min(88vh, 920px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--purple-light); }

/* ── Hero ── */

.hero {
  position: relative;
  min-height: var(--hero-h);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.04);
  filter: saturate(1.15) contrast(1.05);
  animation: heroKenBurns 18s ease-in-out infinite alternate;
}

@keyframes heroKenBurns {
  from { transform: scale(1.04); }
  to   { transform: scale(1.1); }
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(5, 5, 8, 0.15) 0%,
      rgba(5, 5, 8, 0.05) 35%,
      rgba(5, 5, 8, 0.55) 70%,
      rgba(5, 5, 8, 0.97) 100%
    ),
    radial-gradient(ellipse 80% 60% at 50% 40%, transparent 0%, rgba(5, 5, 8, 0.35) 100%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 50%;
  background: radial-gradient(ellipse, var(--purple-glow) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.55;
  animation: glowPulse 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
  50%       { opacity: 0.7; transform: translateX(-50%) scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.5rem 1.75rem;
  background: rgba(12, 8, 20, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(147, 51, 234, 0.12);
}

.hero-logo {
  width: clamp(100px, 18vw, 160px);
  flex-shrink: 0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(147, 51, 234, 0.4);
  animation: logoFloat 5s ease-in-out infinite;
}

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

.hero-copy { flex: 1; min-width: 0; }

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: 0.4rem;
  opacity: 0.85;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 30%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}

.hero-tagline::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 0.6rem;
  background: linear-gradient(90deg, var(--purple), transparent);
  border-radius: 2px;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.65rem;
  letter-spacing: 0.06em;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1rem 1.5rem;
  background: rgba(12, 8, 20, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeUp 1s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat {
  flex: 1;
  text-align: center;
  padding: 0.25rem 1rem;
}

.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--purple-light);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.15rem;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.hero-scroll {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.4;
  animation: fadeUp 1s 0.5s both;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, var(--purple), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50%       { transform: scaleY(1); opacity: 1; }
}

/* ── Nav ── */

.topnav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.85rem 1rem;
  background: rgba(12, 8, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.nav-btn.active, .nav-btn:hover {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  border-color: transparent;
  transform: translateY(-1px);
}

.badge {
  background: var(--purple-light);
  color: #000;
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.hidden { display: none !important; }

/* ── Main ── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.container.narrow { max-width: 720px; }

.view { display: none; }
.view.active { display: block; }

.catalog { display: grid; gap: 2.5rem; }

.category-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.category-head h2 {
  color: var(--purple-light);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.category-count {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(147, 51, 234, 0.55);
  background: rgba(147, 51, 234, 0.06);
  box-shadow: 0 10px 28px rgba(147, 51, 234, 0.12);
  outline: none;
}

.product-top h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.product-excerpt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-bottom { margin-top: 1rem; }

.tier-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(147, 51, 234, 0.22);
}

.tier-qty { color: var(--muted); }

.tier-price {
  color: var(--purple-light);
  font-weight: 700;
}

.tier-more {
  font-size: 0.72rem;
  color: var(--muted);
  align-self: center;
  padding: 0 0.25rem;
}

.product-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.from-price {
  font-size: 0.85rem;
  color: var(--muted);
}

.from-price strong {
  color: var(--purple-light);
  font-size: 1rem;
}

.unit-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.1rem;
}

.product-cta .arrow {
  font-size: 0.78rem;
  color: var(--purple-light);
  font-weight: 600;
}

.empty-shop {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel.success { border-color: var(--success); }

.panel h2 { margin-bottom: 1rem; }

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cart-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.cart-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-row.total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.summary-row.total span:last-child {
  color: var(--purple-light);
}

.checkout-btn {
  width: 100%;
  margin-top: 1rem;
}

.checkout-hint {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.empty-cart {
  text-align: center;
  padding: 2rem 1rem;
}

.empty-cart-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.empty-cart .btn {
  margin-top: 1rem;
}

.hint, .label { color: var(--muted); font-size: 0.9rem; }

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin: 0.75rem 0;
  font-size: 1rem;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn.primary {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #fff;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.35);
}

.btn.primary:hover {
  box-shadow: 0 6px 28px rgba(147, 51, 234, 0.5);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn.pay {
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
  flex: 1;
  min-width: 120px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-product { max-width: 560px; }

.modal-head {
  padding: 1.35rem 1.5rem 0;
}

.modal-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--purple-light);
  margin-bottom: 0.35rem;
}

.modal-head h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  padding-right: 2rem;
}

.modal-body {
  padding: 1rem 1.5rem;
  max-height: min(50vh, 360px);
  overflow-y: auto;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.price-table-wrap {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.price-table-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(147, 51, 234, 0.08);
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.price-table th,
.price-table td {
  padding: 0.55rem 0.85rem;
  text-align: left;
}

.price-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.price-table tbody tr + tr {
  border-top: 1px solid var(--border);
}

.price-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.qty-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 100px;
}

.qty-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.qty-input {
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.modal-add-btn {
  flex: 1;
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.modal-close:hover { color: var(--text); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.modal-actions .input { flex: 0 0 100px; margin: 0; }

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.payment-page { padding-top: 2rem; }

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.qr {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
}

.wallet {
  word-break: break-all;
  font-size: 0.85rem;
}

.status-pending { color: #fbbf24; margin-top: 1rem; }
.status-paid { color: var(--success); margin-top: 1rem; }

.order-id { margin-bottom: 1rem; }

@media (max-width: 640px) {
  :root { --hero-h: min(92vh, 780px); }

  .hero-card {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .hero-tagline::after {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .stat-divider { display: none; }

  .stat {
    flex: 1 1 30%;
    padding: 0.5rem;
  }

  .hero-scroll { display: none; }

  .products-grid { grid-template-columns: 1fr; }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .qty-row { flex: none; width: 100%; }

  .pay-grid { grid-template-columns: 1fr; }
  .qr-wrap { text-align: center; }
}
