:root {
  --bg: #0a0a0a;
  --card: #141414;
  --card-2: #1c1c1c;
  --line: #262626;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --accent: #0faa6d;
  --accent-dark: #006849;
  --danger: #ff6b6b;
  --radius: 18px;
  --font: "TT Firs Neue", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 64px; border-bottom: 1px solid var(--line); }
.brand { display: block; height: 28px; width: auto; }
.secure { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.secure svg { width: 16px; height: 16px; fill: var(--muted); }

.layout { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 20px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; flex: 1; }
.layout.single { grid-template-columns: 1fr; max-width: 520px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; padding-top: 20px; } }

.col { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

.resto { display: flex; align-items: center; gap: 14px; }
.resto img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--card-2); }
.resto .logo-fallback { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-dark); display: grid; place-items: center; font-weight: 700; }
.resto h2 { margin: 0; font-size: 18px; }
.resto p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.mode { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.mode strong { display: block; margin-top: 4px; }
.mode span { font-size: 13px; color: var(--muted); }

.head-row { display: flex; justify-content: space-between; align-items: baseline; }
.head-row h3 { margin: 0; font-size: 18px; }

.item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--card-2); }
.item .body { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .opts { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.item .price { font-weight: 600; white-space: nowrap; }

.totals .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 4px 0; }
.totals .row.discount span:last-child { color: var(--accent); }
.totals .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.totals .total strong { font-size: 18px; }
.totals .total .amount { font-size: 28px; font-weight: 700; }
.totals small { color: var(--muted); font-size: 11px; }
.savings { margin-top: 14px; background: var(--card-2); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; font-size: 13px; }

.pay h2 { margin: 0; font-size: 24px; }
.pay > p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#express-checkout:empty + .divider { display: none; }

.btn { width: 100%; margin-top: 20px; padding: 16px; border: 0; border-radius: 14px; background: var(--accent); color: #02130d; font: 700 16px var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); text-decoration: none; }

.error { margin-top: 12px; color: var(--danger); font-size: 14px; min-height: 1em; }

.state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }
.state h2 { margin: 16px 0 8px; }
.state p { color: var(--muted); margin: 0 auto; max-width: 420px; }
.state .icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--card-2); }
.state .icon.ok { background: var(--accent); color: #02130d; }
.state .order-no { display: inline-block; margin-top: 18px; padding: 10px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.state .btn { max-width: 340px; margin: 24px auto 0; }

.spinner { width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 20px 28px; }

@media (max-width: 860px) { .topbar { padding: 16px 20px; } .brand { height: 24px; } }
.btn { background: #ffffff; color: #0a0a0a; }
.btn.secondary { background: var(--card-2); color: var(--text); }
.state .icon.ok { background: var(--accent); color: #ffffff; }
