:root {
  --s37-pix-accent: var(--vux-theme-primary, var(--skin__primary, var(--skin__accent, #0c913f)));
  --s37-pix-accent-strong: color-mix(in srgb, var(--s37-pix-accent) 82%, #000);
  --s37-pix-bg: #1b1c22;
  --s37-pix-surface: #24262e;
  --s37-pix-surface-2: #2c2e36;
  --s37-pix-border: rgba(255, 255, 255, 0.09);
  --s37-pix-text: #f5f6f8;
  --s37-pix-muted: #9a9da6;
  --s37-pix-warning: #f0c45a;
}

.s37-pix-host {
  position: relative !important;
  overflow: hidden !important;
}

.s37-pix-host > .s37-pix-checkout {
  width: 100%;
  height: 100%;
}

.s37-pix-checkout {
  position: absolute;
  inset: 0;
  z-index: 120;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--s37-pix-bg);
  color: var(--s37-pix-text);
  font-family: inherit;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.s37-pix-checkout [hidden] {
  display: none !important;
}

.s37-pix-checkout::-webkit-scrollbar {
  display: none;
}

.s37-pix-checkout.s37-pix-overlay {
  position: fixed;
  z-index: 100000010;
  width: min(100%, 430px);
  max-width: 430px;
  margin: 0 auto;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
}

.s37-pix-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  min-height: 52px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  border-bottom: 1px solid var(--s37-pix-border);
  background: rgba(27, 28, 34, 0.97);
  padding: max(2px, env(safe-area-inset-top)) 5px 0;
}

.s37-pix-header h2 {
  overflow: hidden;
  margin: 0;
  color: var(--s37-pix-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s37-pix-icon-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #d9dbe0;
  cursor: pointer;
  padding: 0;
}

.s37-pix-icon-button svg {
  width: 22px;
  height: 22px;
}

.s37-pix-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px 20px calc(28px + env(safe-area-inset-bottom));
}

.s37-pix-brand {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  padding-bottom: 10px;
}

.s37-pix-brand img {
  display: block;
  width: auto;
  max-width: 112px;
  height: 38px;
  object-fit: contain;
}

.s37-pix-tips {
  margin: 0 0 13px;
  padding: 0 0 0 18px;
  color: var(--s37-pix-muted);
  font-size: 12px;
  line-height: 1.48;
}

.s37-pix-tips li + li {
  margin-top: 4px;
}

.s37-pix-tips .is-warning {
  color: var(--s37-pix-warning);
}

.s37-pix-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 4px 0 10px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.s37-pix-amount small {
  color: var(--s37-pix-accent);
  font-size: 15px;
  font-weight: 800;
}

.s37-pix-amount strong {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.s37-pix-qr-wrap {
  position: relative;
  display: flex;
  width: min(36vw, 135px);
  height: min(36vw, 135px);
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 auto;
  border: 0;
  border-radius: 3px;
  background: #fff;
}

.s37-pix-qr {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.s37-pix-qr.is-generated {
  box-sizing: border-box;
  padding: 3px;
}

.s37-pix-qr img,
.s37-pix-qr canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.s37-pix-qr-state {
  color: #50545c;
  font-size: 13px;
  text-align: center;
}

.s37-pix-paid {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.s37-pix-checkout.is-paid .s37-pix-paid {
  display: flex;
}

.s37-pix-paid__icon {
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--s37-pix-accent);
  color: #fff;
  overflow: hidden;
}

.s37-pix-paid__icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.s37-pix-timer {
  margin: 12px 0 14px;
  color: var(--s37-pix-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.s37-pix-timer strong {
  color: var(--s37-pix-warning);
  font-weight: 700;
}

.s37-pix-copy {
  display: flex;
  width: min(43.34vw, 147px);
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 4px;
  background: var(--s37-pix-accent);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 auto;
  transition: background 120ms ease;
}

.s37-pix-copy:active {
  background: var(--s37-pix-accent-strong);
}

.s37-pix-copy:disabled {
  cursor: default;
  opacity: 0.45;
}

.s37-pix-copy svg {
  width: 12px;
  height: 12px;
}

.s37-pix-copy span {
  white-space: nowrap;
}

.s37-pix-code-tail {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  margin: 8px auto 2px;
  max-width: 230px;
  color: #757983;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.s37-pix-code-tail > span,
.s37-pix-code-tail > strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.s37-pix-code-tail > strong {
  max-width: 105px;
  color: #a6a9b1;
  font-weight: 600;
}

.s37-pix-mini-copy,
.s37-pix-refresh {
  display: inline-flex;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--s37-pix-accent);
  cursor: pointer;
  padding: 0;
}

.s37-pix-mini-copy svg,
.s37-pix-refresh svg {
  width: 16px;
  height: 16px;
}

.s37-pix-order {
  margin: 13px 0 0;
}

.s37-pix-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 12px;
  line-height: 1.3;
}

.s37-pix-order dt {
  color: var(--s37-pix-muted);
}

.s37-pix-order dd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 62%;
  overflow: hidden;
  margin: 0;
  color: #e6e7ea;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s37-pix-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--s37-pix-warning);
  font-weight: 700;
}

.s37-pix-refresh {
  color: var(--s37-pix-warning);
}

.s37-pix-refresh svg {
  animation: s37-pix-spin 0.8s linear infinite;
}

.s37-pix-checkout.is-paid .s37-pix-status {
  color: #67dc98;
}

.s37-pix-checkout.is-paid .s37-pix-refresh svg,
.s37-pix-checkout.is-expired .s37-pix-refresh svg {
  animation: none;
}

.s37-pix-checkout.is-expired .s37-pix-status {
  color: #e26f75;
}

.s37-pix-checkout.is-paid .s37-pix-refresh {
  color: #67dc98;
}

.s37-pix-checkout.is-expired .s37-pix-refresh {
  color: #e26f75;
}

.s37-pix-toast {
  position: sticky;
  bottom: 12px;
  display: none;
  width: fit-content;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  margin: 12px auto 0;
  border: 1px solid var(--s37-pix-border);
  border-radius: 4px;
  background: #30323a;
  color: #fff;
  padding: 8px 12px;
  font-size: 11px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.s37-pix-toast.is-visible {
  display: block;
}

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

@media (max-width: 360px) {
  .s37-pix-content {
    padding-right: 13px;
    padding-left: 13px;
  }

  .s37-pix-tips {
    font-size: 11px;
  }

  .s37-pix-order-row {
    gap: 8px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .s37-pix-status::before {
    animation-duration: 1.8s;
  }
}
