
:root {
  --app-pink: #fe2c55;
  --app-cyan: #25f4ee;
  --app-bg: #f5f5f7;
  --app-card: #ffffff;
  --app-text: #111;
  --app-muted: #6b7280;
  --app-border: rgba(0,0,0,.08);
  --app-radius: 16px;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body[data-page="endereco"],
body[data-page="pix"] {
  overflow: auto;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--app-border);
}

.app-logo img { height: 28px; width: auto; display: block; }
.app-header-title { font-size: 14px; font-weight: 700; justify-self: end; padding-right: 4px; }
.app-icon-btn {
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer;
}
.app-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--app-cyan), #fff, var(--app-pink));
}
.app-main {
  flex: 1;
  padding: 16px 14px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--app-card);
  border-radius: var(--app-radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card.center { text-align: center; }
.card-soft { background: #fff; }
.card-title { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.card-sub { margin: 0 0 14px; color: var(--app-muted); font-size: 12.5px; }

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: #374151; }
.field input {
  height: 44px; border-radius: 12px; border: 1px solid #e5e7eb; background: #f9fafb;
  padding: 0 12px; font-size: 15px; font-weight: 500; color: #111; outline: none;
}
.field input:focus { border-color: var(--app-pink); background: #fff; box-shadow: 0 0 0 3px rgba(254,44,85,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: #dc2626; font-size: 12px; margin: 0; }

.mini-product { display: flex; gap: 12px; align-items: center; }
.mini-product img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #f3f4f6; }
.mini-product-name { font-size: 13px; font-weight: 700; }
.mini-product-price { font-size: 14px; font-weight: 800; color: var(--app-pink); margin-top: 2px; }

.app-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-btn {
  height: 48px; border: 0; border-radius: 999px; background: var(--app-pink); color: #fff;
  font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 30px -10px rgba(254,44,85,.7);
}
.cta-btn.secondary { background: #111; box-shadow: none; }
.cta-btn:active { transform: scale(.98); }
.secure-note { margin: 0; text-align: center; font-size: 11px; color: var(--app-muted); }
.text-link {
  border: 0; background: transparent; color: var(--app-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 6px;
}

.pix-status {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--app-muted);
}
.pix-status.is-pending { color: #b45309; }
.pix-status.is-paid { color: #059669; }
.pix-status.is-error { color: #dc2626; }

.pix-qr-wrap {
  display: grid;
  place-items: center;
  margin: 0 0 14px;
}
.pix-qr-img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
}

.pix-code-wrap {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.pix-code-wrap code,
#pix-code {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.45;
  color: #374151;
}
#btn-copy-pix,
.pix-copy-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Qty control */
.qty-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
}
.qty-box--overlay {
  position: relative;
  z-index: 50;
  width: calc(100% - 24px);
  margin: 10px 12px 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(254, 44, 85, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.qty-box--checkout {
  margin: 10px 0 14px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(254, 44, 85, 0.22);
  background: #fff;
}
.qty-box strong { font-size: 13px; }
.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.qty-controls button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  pointer-events: auto;
}
.qty-controls span {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
}

/* Loading overlay before PIX */
.pay-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(245,245,247,.92);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.pay-loading[hidden] { display: none !important; }
.pay-loading__card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
}
.pay-loading__spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #eee;
  border-top-color: #fe2c55;
  animation: payspin .8s linear infinite;
}
.pay-loading__title { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.pay-loading__sub { font-size: 12px; color: #6b7280; margin: 0; }
@keyframes payspin { to { transform: rotate(360deg); } }


.hint { text-align: center; color: #059669; font-size: 12px; font-weight: 700; margin: 0; }
.steps { margin: 0; padding-left: 18px; color: #374151; font-size: 13px; display: grid; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(420px, calc(100% - 24px)); background: #111; color: #fff; border-radius: 14px;
  padding: 14px 16px; display: grid; gap: 4px; z-index: 80; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.toast strong { font-size: 14px; }
.toast span { font-size: 12px; opacity: .85; }

/* Product option cards: only the active one keeps the red border */
body[data-page="produto"] button.offer-selected {
  border-width: 2px !important;
  border-color: hsl(var(--primary, 347 80% 58%)) !important;
  box-shadow: 0 0 0 1px hsl(var(--primary, 347 80% 58%) / 0.15);
}

body[data-page="produto"] button.offer-selected.border-foreground {
  border-color: hsl(var(--primary, 347 80% 58%)) !important;
}

/* Snapshot pages: keep overlays usable */
body[data-page="checkout"],
body[data-page="dados"] {
  overflow: hidden;
  height: 100dvh;
}

body[data-page="checkout"] [class*="fixed inset-0"] *,
body[data-page="dados"] [class*="fixed inset-0"] * {
  cursor: default;
}

/* Video modal (floating depoimento + fullscreen play) */
body.video-modal-open {
  overflow: hidden;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
}

.video-modal[hidden] {
  display: none !important;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.video-modal__dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(84dvh, 760px);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.video-modal__player {
  display: block;
  width: 100%;
  max-height: min(84dvh, 760px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
}

.video-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

