:root {
  --brand: #2850a8;
  --brand-dark: #1e3f86;
  --bg: #eef1f7;
  --card: #ffffff;
  --text: #1b2436;
  --muted: #6a7488;
  --border: #dde3ef;
  --bar-h: 76px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card);
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.app-header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 0;
  padding: 14px 0;
  text-align: center;
}

.catalogue {
  padding: 12px;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 24px);
}

.article {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.article.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.article-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef1ef;
  flex: 0 0 auto;
}

.article-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.article-name {
  font-weight: 600;
  font-size: 1rem;
}

.article-price {
  color: var(--muted);
  font-size: 0.9rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.step {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.step:active { background: #eef5f1; }

.step.plus {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.qty {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.contribution,
.loten {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  margin-top: 10px;
}

.loten {
  border-color: var(--brand);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--brand);
}

.section-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.contribution-text {
  margin: 0 0 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  flex: 0 0 auto;
  min-width: 64px;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill.active {
  background: var(--brand);
  color: #fff;
}

.pay-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: 0 16px env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.total-block {
  display: flex;
  flex-direction: column;
}

.total-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand);
}

.pay-btn {
  flex: 0 0 auto;
  min-width: 130px;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.pay-btn:disabled {
  background: #c3ccc7;
  cursor: not-allowed;
}

.pay-btn:active:not(:disabled) { background: var(--brand-dark); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay[hidden] { display: none; }

.overlay-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--brand);
}

.overlay-amount {
  color: var(--brand);
}

.overlay-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.qr img, .qr canvas {
  display: block;
}

.overlay-amount {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 16px 0;
}

.open-bunq {
  display: inline-block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.overlay-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #fff6e5;
  border: 1px solid #f1d9a6;
  border-radius: 10px;
  color: #7a5b12;
  font-size: 0.9rem;
  line-height: 1.35;
}

.overlay-txid {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.overlay-txid span {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.confirm-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #2e7d32;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.confirm-btn:disabled {
  background: #9bbf9d;
  cursor: not-allowed;
}

.done-check {
  width: 72px;
  height: 72px;
  margin: 4px auto 12px;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-size: 2.4rem;
  line-height: 72px;
}

.done-text {
  margin: 0 0 4px;
  color: var(--text);
}

.done-text span {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
}
