:root {
  --pix-red: #e82127;
  --pix-ink: #111318;
  --pix-muted: #60646c;
  --pix-line: #dedfe3;
  --pix-success: #168447;
}

html.upsell-pix-open,
html.upsell-pix-open body { overflow: hidden; }

.upsell-pix-overlay[hidden] { display: none; }

.upsell-pix-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--pix-ink);
  font-family: Inter, Arial, sans-serif;
}

.upsell-pix-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(7px);
}

.upsell-pix-card {
  position: relative;
  width: min(100%, 500px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 14px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.upsell-pix-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f1f2f4;
  color: #363940;
  font-size: 24px;
  cursor: pointer;
}

.upsell-pix-brand {
  margin: 0 44px 8px 0;
  color: var(--pix-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.upsell-pix-card h2 {
  margin: 0 44px 8px 0;
  color: var(--pix-ink);
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.upsell-pix-description {
  max-width: 62ch;
  margin: 0 0 18px;
  color: var(--pix-muted);
  font-size: 14px;
  line-height: 1.55;
}

.upsell-pix-qr {
  display: block;
  width: 190px;
  height: 190px;
  margin: 0 auto 18px;
  object-fit: contain;
}

.upsell-pix-card label {
  display: block;
  margin-bottom: 7px;
  color: var(--pix-ink);
  font-size: 13px;
  font-weight: 700;
}

.upsell-pix-code-row { display: flex; gap: 8px; }

#upsell-pix-code {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--pix-line);
  border-radius: 9px;
  background: #f7f7f8;
  padding: 11px 12px;
  color: #33363d;
  font: 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#upsell-pix-copy,
.upsell-pix-retry,
.upsell-pix-return {
  border: 0;
  border-radius: 9px;
  padding: 11px 16px;
  font: 700 13px/1 Inter, Arial, sans-serif;
  cursor: pointer;
}

#upsell-pix-copy,
.upsell-pix-retry { background: var(--pix-ink); color: #fff; }

.upsell-pix-amount {
  margin: 15px 0 10px;
  color: var(--pix-ink);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.upsell-pix-status {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 10px;
  background: #f3f4f6;
  padding: 12px;
  color: #383c44;
  font-size: 13px;
  line-height: 1.4;
}

.upsell-pix-status[data-state="confirmed"] { background: #e9f7ef; color: #0d6836; }
.upsell-pix-status[data-state="error"] { background: #fff0f0; color: #a11c22; }

.upsell-pix-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: upsell-pix-spin .75s linear infinite;
}

.upsell-pix-status[data-state="confirmed"] .upsell-pix-spinner,
.upsell-pix-status[data-state="error"] .upsell-pix-spinner { animation: none; border-right-color: currentColor; }

.upsell-pix-retry { width: 100%; margin-top: 10px; }

.upsell-pix-return {
  width: 100%;
  margin-top: 9px;
  background: transparent;
  color: var(--pix-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upsell-pix-card button:focus-visible,
.upsell-pix-card input:focus-visible { outline: 3px solid rgba(232, 33, 39, .32); outline-offset: 2px; }

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

@media (max-width: 520px) {
  .upsell-pix-overlay { align-items: end; padding: 0; }
  .upsell-pix-card { width: 100%; max-height: 92dvh; border-radius: 14px 14px 0 0; padding: 24px 18px 20px; }
  .upsell-pix-qr { width: 170px; height: 170px; }
  .upsell-pix-code-row { flex-direction: column; }
  #upsell-pix-copy { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .upsell-pix-spinner { animation-duration: 1.5s; }
}
