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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f0f13;
  color: #e2e8f0;
  min-height: 100vh;
}

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

/* ─── Header ─────────────────────────────────────────────── */
.header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15,15,19,0.96);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.header-brand span {
  color: #818cf8;
}

.header-nav {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 52px 24px 36px;
}

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(129,140,248,0.4);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 0.9rem;
  color: #94a3b8;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Notice ─────────────────────────────────────────────── */
.notice-bar {
  max-width: 680px;
  margin: 0 auto 28px;
  padding: 0 24px;
}

.notice-inner {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.83rem;
  color: #fde68a;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Products ───────────────────────────────────────────── */
.products-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.product-card {
  background: #1c1c26;
  border: 2px solid #2e2e3d;
  border-radius: 14px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
}

.product-card:hover {
  border-color: #818cf8;
  background: #21212e;
}

.product-card.selected {
  border-color: #818cf8;
  background: rgba(99,102,241,0.1);
}

.product-card.selected::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px;
  background-repeat: no-repeat;
  background-position: center;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.product-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 10px;
  min-height: 32px;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #818cf8;
}

.product-price span {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 2px;
}

.product-stock {
  font-size: 0.71rem;
  color: #4ade80;
  margin-top: 5px;
  font-weight: 500;
}

.product-stock.low {
  color: #fbbf24;
}

.product-stock.out {
  color: #f87171;
}

/* ─── Order Form ─────────────────────────────────────────── */
.order-form {
  background: #1c1c26;
  border: 1px solid #2e2e3d;
  border-radius: 16px;
  padding: 24px;
}

.form-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: #12121a;
  border: 1.5px solid #353545;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #6366f1;
}

.form-input::placeholder {
  color: #4a4a62;
}

.pay-methods {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #2e2e3d;
  border-radius: 10px;
  background: #12121a;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pay-btn:hover {
  border-color: #818cf8;
  color: #e2e8f0;
}

.pay-btn.active {
  border-color: #818cf8;
  background: rgba(99,102,241,0.1);
  color: #c7d2fe;
}

.submit-btn {
  width: 100%;
  padding: 13px;
  background: #6366f1;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  margin-top: 6px;
}

.submit-btn:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-1px);
}

.submit-btn:disabled {
  background: #252535;
  color: #5a5a72;
  cursor: not-allowed;
  transform: none;
}

.form-hint {
  font-size: 0.73rem;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
  line-height: 1.5;
}

/* ─── Empty / Loading ────────────────────────────────────── */
.products-loading {
  text-align: center;
  padding: 40px 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* ─── Order Status Page ──────────────────────────────────── */
.order-page {
  max-width: 560px;
  margin: 48px auto;
  padding: 0 24px;
}

.order-card {
  background: #1c1c26;
  border: 1px solid #2e2e3d;
  border-radius: 16px;
  overflow: hidden;
}

.order-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #2e2e3d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.status-badge.pending {
  background: rgba(251,191,36,0.12);
  color: #fde68a;
  border: 1px solid rgba(251,191,36,0.35);
}

.status-badge.completed {
  background: rgba(74,222,128,0.12);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.35);
}

.status-badge.failed {
  background: rgba(248,113,113,0.12);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.35);
}

.order-card-body {
  padding: 20px 24px;
}

.order-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #252535;
  font-size: 0.84rem;
}

.order-info-row:last-child {
  border-bottom: none;
}

.order-info-label {
  color: #94a3b8;
}

.order-info-value {
  color: #f1f5f9;
  font-weight: 500;
}

/* CDK reveal */
.cdk-reveal {
  margin-top: 20px;
  background: #12121a;
  border: 1.5px solid rgba(129,140,248,0.4);
  border-radius: 12px;
  padding: 18px;
}

.cdk-reveal-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cdk-code-display {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  word-break: break-all;
  margin-bottom: 8px;
}

.cdk-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(129,140,248,0.4);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #c7d2fe;
  cursor: pointer;
  transition: all 0.15s;
}

.cdk-copy-btn:hover {
  background: rgba(99,102,241,0.3);
}

.verify-hash-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2e2e3d;
}

.verify-hash-label {
  font-size: 0.73rem;
  color: #94a3b8;
  margin-bottom: 5px;
}

.verify-hash-value {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #cbd5e1;
  word-break: break-all;
}

/* Pending state animation */
.pending-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #2e2e3d;
  border-top-color: #818cf8;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pending-section {
  text-align: center;
  padding: 24px 0;
}

.pending-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.pending-sub {
  font-size: 0.83rem;
  color: #94a3b8;
  line-height: 1.6;
}

.order-actions {
  padding: 16px 24px;
  border-top: 1px solid #2e2e3d;
  display: flex;
  gap: 10px;
}

.btn-outline {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #353545;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-outline:hover {
  border-color: #818cf8;
  color: #c7d2fe;
}

.btn-primary-sm {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 9px;
  background: #6366f1;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-primary-sm:hover {
  background: #4f46e5;
}

.order-no-label {
  font-size: 0.73rem;
  color: #64748b;
  margin-top: 14px;
  text-align: center;
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 0.75rem;
  color: #4a5568;
}

/* ─── Alert ──────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.83rem;
  margin-bottom: 14px;
}

.alert-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: #fca5a5;
}

/* ─── Query Section ──────────────────────────────────────── */
.query-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 20px;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.query-divider::before,
.query-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2e2e3d;
}

.query-form {
  background: #1c1c26;
  border: 1px solid #2e2e3d;
  border-radius: 16px;
  padding: 24px;
}

.query-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  background: #252535;
  border: 1.5px solid #353545;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.query-btn:hover:not(:disabled) {
  border-color: #818cf8;
  color: #c7d2fe;
  background: rgba(99,102,241,0.1);
}

.query-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Query result list */
.query-order-item {
  background: #12121a;
  border: 1px solid #2e2e3d;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.query-order-item:last-child { margin-bottom: 0; }

.query-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.query-order-no {
  font-size: 0.72rem;
  color: #64748b;
  font-family: monospace;
}

.query-order-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

.query-cdk-box {
  background: #1c1c26;
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.query-cdk-code {
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.query-copy-btn {
  flex-shrink: 0;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #c7d2fe;
  cursor: pointer;
  transition: all 0.15s;
}

.query-copy-btn:hover { background: rgba(99,102,241,0.28); }

.query-pending-tip {
  font-size: 0.78rem;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: 36px 20px 24px; }
  .products-section { padding: 0 16px 40px; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .order-page { margin: 24px auto; padding: 0 16px; }
}
