:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f0f3fa;
  --border: #e2e8f0;
  --text: #1a2332;
  --muted: #64748b;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-soft: rgba(124, 58, 237, 0.1);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --radius: 18px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
.container { width: min(960px, 92%); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.05rem;
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; font-weight: 900;
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-weight: 500; font-size: .88rem;
  padding: 8px 12px; border-radius: 10px; text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--surface2); }
.nav-toggle {
  display: none; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; width: 40px; height: 40px; border-radius: 11px; cursor: pointer;
}
.main { padding: 20px 0 56px; min-height: 55vh; }

.hero { padding: 8px 0 18px; text-align: left; }
.hero h1 {
  font-size: clamp(1.3rem, 4vw, 1.7rem); line-height: 1.25; margin: 0 0 6px;
  font-weight: 800; letter-spacing: -.02em;
}
.hero p { color: var(--muted); margin: 0 0 14px; font-size: .9rem; max-width: 480px; }

.menu-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px;
}
.menu-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 6px; text-align: center; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.menu-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text); }
.menu-icon {
  width: 42px; height: 42px; margin: 0 auto 8px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.2rem;
}
.menu-icon.purple { background: #f3e8ff; }
.menu-icon.blue { background: #e0f2fe; }
.menu-icon.green { background: #dcfce7; }
.menu-icon.orange { background: #ffedd5; }
.menu-label {
  font-size: .65rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .03em; font-weight: 600; display: block;
}
.menu-title { font-size: .8rem; font-weight: 700; margin-top: 2px; display: block; }

.balance-card {
  background: linear-gradient(145deg, #1e1b4b 0%, #4c1d95 45%, #7c3aed 100%);
  border-radius: 20px; padding: 18px; color: #fff; margin-bottom: 20px;
  box-shadow: 0 12px 32px rgba(124,58,237,.25); position: relative; overflow: hidden;
}
.balance-card .label { font-size: .7rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.balance-card .amount { font-size: 1.75rem; font-weight: 800; margin: 6px 0 4px; }
.balance-card .sub { font-size: .8rem; opacity: .8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 700; font-size: .9rem; font-family: inherit;
  background: var(--primary); color: #fff; text-decoration: none;
  box-shadow: 0 4px 14px rgba(124,58,237,.25); transition: .12s;
}
.btn:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .8rem; border-radius: 10px; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn-outline:hover { background: var(--surface2); color: var(--text); }
.btn-success { background: var(--success); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-img {
  aspect-ratio: 1; background: var(--surface2); display: grid; place-items: center;
  color: var(--muted); font-size: 12px; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px; }
.card-body h3 {
  margin: 6px 0 4px; font-size: .86rem; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--primary); }
.card-body .desc {
  color: var(--muted); font-size: .74rem; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price { font-weight: 800; font-size: .98rem; color: var(--primary); }
.price s { color: var(--muted); font-weight: 500; font-size: .76rem; margin-right: 4px; }

.badge {
  display: inline-flex; font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; text-transform: uppercase;
}
.badge-auto { background: var(--success-soft); color: var(--success); }
.badge-manual { background: var(--warning-soft); color: var(--warning); }
.section-title { margin: 4px 0 14px; font-size: 1.08rem; font-weight: 800; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.form-control {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: .92rem; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-control::placeholder { color: #94a3b8; }

.alert { padding: 11px 13px; border-radius: 12px; margin-bottom: 12px; font-size: .85rem; }
.alert-error { background: var(--danger-soft); border: 1px solid rgba(220,38,38,.2); color: #b91c1c; }
.alert-success { background: var(--success-soft); border: 1px solid rgba(22,163,74,.2); color: #15803d; }
.alert-info { background: var(--primary-soft); border: 1px solid rgba(124,58,237,.2); color: #6d28d9; }
.alert-warning { background: var(--warning-soft); border: 1px solid rgba(217,119,6,.2); color: #b45309; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; max-width: 400px; margin: 0 auto; box-shadow: var(--shadow);
}
.panel h1 { margin: 0 0 6px; font-size: 1.12rem; font-weight: 800; }
.panel-wide { max-width: 480px; }
@media (max-width: 480px) { .panel, .panel-wide { max-width: 100%; padding: 14px; } }

.product-hero { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) {
  .product-hero { grid-template-columns: 120px 1fr; align-items: start; gap: 16px; }
}
.product-img {
  border-radius: 14px; overflow: hidden; background: var(--surface2);
  aspect-ratio: 1; border: 1px solid var(--border); max-width: 140px;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.product-price { font-size: 1.3rem; font-weight: 800; color: var(--primary); margin: 4px 0 8px; }
.product-desc { color: var(--muted); font-size: .85rem; white-space: pre-wrap; line-height: 1.55; margin: 0 0 6px; }
.checkout-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.field-hint { font-size: .72rem; color: var(--muted); margin-top: 3px; }

.pay-amount { font-size: 1.85rem; font-weight: 800; color: var(--primary); margin: 8px 0 12px; }
.pay-status {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); margin-bottom: 14px;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); flex-shrink: 0; margin-top: 5px; }
.status-dot.ok { background: var(--success); }
.status-dot.fail { background: var(--danger); }
.qr-box {
  background: #fff; border-radius: 16px; padding: 12px; width: min(240px, 100%);
  margin: 14px auto; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.qr-box img { width: 100%; display: block; }
.pay-wait { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .75s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.invoice-card { max-width: 440px; }
.invoice-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.invoice-row:last-child { border-bottom: 0; }
.invoice-label { color: var(--muted); }
.invoice-value { font-weight: 600; text-align: right; word-break: break-word; }
.account-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-top: 10px; font-family: ui-monospace, monospace; font-size: .85rem;
  line-height: 1.65; white-space: pre-wrap; word-break: break-all;
}
.copy-btn { margin-top: 8px; font-size: .78rem; min-height: 32px; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0 36px; background: #fff; }
.footer-inner { display: grid; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-links a { color: var(--muted); font-size: .85rem; }
.copyright { color: var(--muted); font-size: .72rem; margin: 0; }
.empty-state {
  text-align: center; padding: 36px 16px; background: #fff;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted);
}

@media (max-width: 720px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 56px;
    background: #fff; border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 8px 4%; gap: 2px; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 12px 14px; }
}
