/* ===== Design tokens ===== */
:root {
  --bg: #11131a;
  --surface: #1a1d28;
  --surface-hi: #232735;
  --border: #2b2f3f;
  --text: #edeef3;
  --muted: #8b8fa3;
  --accent: #ffb454;
  --accent-ink: #1a1206;
  --cyan: #5eead4;
  --success: #4ade80;
  --error: #f87171;

  --font-fa: "Vazirmatn", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-fa);
  direction: rtl;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

.num {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: plaintext;
}

/* ===== Layout shell ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 19, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

header.site .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

nav.main { display: flex; gap: 22px; align-items: center; }
nav.main a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
nav.main a:hover, nav.main a.active { color: var(--text); }

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.wallet-chip .num { color: var(--accent); font-weight: 600; }

main { padding: 40px 0 80px; }

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

/* ===== Buttons & inputs ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-fa);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { opacity: 0.92; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--muted); }

.btn-block { width: 100%; }

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-fa);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="number"] { font-family: var(--font-mono); direction: ltr; text-align: right; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 18px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-hi {
  background: var(--surface-hi);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 50px 0 70px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 20px 0 40px; }
  .hero .pulse-wrap { order: -1; height: 200px; }
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.25;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero p.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 28px;
  max-width: 46ch;
}
.hero .actions { display: flex; gap: 12px; }

.pulse-wrap {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse-core {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px 4px rgba(255, 180, 84, 0.5);
  z-index: 2;
}
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: pulse 3.6s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0s; }
.pulse-ring:nth-child(3) { animation-delay: 1.2s; }
.pulse-ring:nth-child(4) { animation-delay: 2.4s; }
@keyframes pulse {
  0% { width: 18px; height: 18px; opacity: 0.7; }
  100% { width: 300px; height: 300px; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-ring { animation: none; opacity: 0.25; width: 180px; height: 180px; }
}

/* ===== Category grid (editorial, not uniform) ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
@media (max-width: 780px) { .cat-grid { grid-template-columns: 1fr 1fr; } }

.cat-card {
  grid-column: span 2;
  padding: 26px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: block;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cat-card.featured {
  grid-column: span 3;
  background: linear-gradient(155deg, var(--surface-hi), var(--surface));
}
@media (max-width: 780px) {
  .cat-card, .cat-card.featured { grid-column: span 2; }
}

.cat-card .icon { font-size: 1.8rem; margin-bottom: 14px; }
.cat-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.cat-card p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

/* ===== Section headers ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-head h2 { font-size: 1.3rem; margin: 0; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none; border: none; font-family: var(--font-fa);
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ===== Product list ===== */
.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  gap: 14px;
  flex-wrap: wrap;
}
.product-row .name { font-weight: 600; }
.product-row .price { color: var(--accent); font-family: var(--font-mono); direction: ltr; }
.product-row .muted-note { color: var(--muted); font-size: 0.8rem; }

/* ===== Table-ish list (orders/tx) ===== */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.list-row:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.completed { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.badge.processing { background: rgba(255, 180, 84, 0.12); color: var(--accent); }
.badge.failed, .badge.refunded { background: rgba(248, 113, 113, 0.12); color: var(--error); }
.badge.pending { background: rgba(139, 143, 163, 0.15); color: var(--muted); }

/* ===== Alerts ===== */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert.error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); color: #ffb4b4; }
.alert.success { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); color: #b8f5c8; }
.alert.info { background: rgba(94, 234, 212, 0.08); border-color: rgba(94, 234, 212, 0.25); color: var(--cyan); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 7, 10, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 420px;
}
.modal h3 { margin-top: 0; }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; float: left;
}

/* ===== Utility ===== */
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.center-note { text-align: center; color: var(--muted); padding: 40px 0; }
.mt-24 { margin-top: 24px; }
.small { font-size: 0.82rem; color: var(--muted); }
