:root {
  --green: #2563eb; /* Blue primary */
  --green-dark: #1d4ed8;
  --green-light: rgba(37, 99, 235, 0.08);
  --red: #ef4444;
  --ink: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.08);
  --bg-color: #f8fafc;
  --white: #ffffff;
  --primary: #2563eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

body.checkout-page {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar-checkout {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.topbar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.topbar-text {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.timer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: monospace;
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
}

/* Main Layout */
.checkout-main {
  padding: 40px 16px;
  flex: 1;
}

.checkout-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

/* Product Column */
.checkout-product {
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.secure-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.product-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
}

.product-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.product-price-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.product-price-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.product-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--green);
}

.trust-badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.trust-icon {
  font-size: 18px;
}

/* Form Column */
.checkout-form-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checkout-step, .pix-state-panel {
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--ink);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.step-title {
  font-size: 20px;
  font-weight: 800;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  background: #ffffff;
  color: var(--ink);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Payment Method */
.payment-method {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--white);
  transition: all 0.2s;
}

.payment-method.selected {
  border-color: var(--green);
  background: var(--green-light);
}

.payment-method-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-method.selected .radio-circle {
  border-color: var(--green);
}

.radio-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}

.payment-method.selected .radio-inner {
  background: var(--green);
}

.payment-method-name {
  font-weight: 800;
  font-size: 16px;
}

.payment-method-tag {
  background: var(--green);
  color: #040d0a;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  margin-left: auto;
}

.payment-method-body p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding-left: 34px;
}

.payment-method.selected .payment-method-body p {
  color: var(--green-dark);
}

/* Order Bump */
.order-bump {
  display: grid;
  grid-template-columns: auto 72px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 2px dashed rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.05);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  margin: 0 0 22px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.order-bump:has(input:checked) {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.order-bump input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bump-check {
  width: 24px;
  height: 24px;
  border: 2px solid #d97706;
  border-radius: 6px;
  background: var(--white);
  position: relative;
}

.order-bump input:checked + .bump-check {
  background: var(--green);
  border-color: var(--green);
}

.order-bump input:checked + .bump-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid var(--white);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.bump-image,
.bump-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--white);
}

.bump-image {
  object-fit: cover;
  display: block;
}

.bump-thumb {
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 900;
}

.bump-thumb-neymar {
  background: linear-gradient(135deg, #0a7f39, #f7c948);
  color: #040d0a;
}

.bump-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bump-kicker {
  color: #d97706;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bump-content strong {
  font-size: 15px;
  line-height: 1.25;
}

.bump-content small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
}

.bump-price {
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

/* Order Summary */
.order-summary {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 32px 0 24px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.summary-row:last-child {
  margin-bottom: 0;
}

.summary-row.total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

/* Button */
.btn-checkout {
  width: 100%;
  background: var(--green);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 20px;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-checkout:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}

.btn-checkout:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.checkout-microcopy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin-top: 12px;
  text-align: center;
}

/* PIX States */
.pix-state-panel {
  text-align: center;
  padding: 40px 32px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

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

.pix-success-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pix-state-panel h3 {
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
}

.pix-expiry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

.pix-expiry strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
}

.pix-instructions {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 24px;
}

.qr-wrapper {
  background: var(--white);
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 24px;
}

.qr-wrapper img, .qr-wrapper canvas {
  width: 200px;
  height: 200px;
  display: block;
}

.copy-paste-wrapper {
  text-align: left;
}

.copy-paste-wrapper label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.copy-paste-wrapper textarea {
  width: 100%;
  height: 80px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: monospace;
  font-size: 13px;
  resize: none;
  margin-bottom: 12px;
  background: #ffffff;
  color: var(--ink);
}

.btn-copy {
  width: 100%;
  background: #e2e8f0;
  color: #0f172a;
  border: 0;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

.btn-copy:hover {
  background: #cbd5e1;
  transform: translateY(-1px);
}

.waiting-payment {
  margin-top: 32px;
  padding: 20px;
  background: var(--green-light);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.waiting-pulse {
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  margin-bottom: 8px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.waiting-payment p {
  color: var(--green-dark);
  font-weight: 800;
  font-size: 15px;
}

.waiting-payment small {
  color: var(--green-dark);
  opacity: 0.8;
  font-weight: 500;
}

/* Footer */
.checkout-footer {
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  background: var(--white);
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.footer-micro {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.5;
}

.whatsapp-help-image {
  display: block;
  max-width: 318px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.whatsapp-help-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.whatsapp-help-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Responsive */
@media (max-width: 860px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .topbar-container {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .checkout-main {
    padding: 18px 10px 28px;
  }

  .topbar-checkout {
    padding: 10px 12px;
  }

  .topbar-text {
    font-size: 12px;
    text-align: center;
  }

  .timer-badge {
    font-size: 14px;
  }

  .checkout-step, .pix-state-panel {
    padding: 20px 14px;
    border-radius: 20px;
  }
  
  .checkout-product {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .secure-badge-top {
    margin-bottom: 14px;
    font-size: 11px;
  }

  .product-image {
    margin-bottom: 14px;
    border-radius: 14px;
  }

  .product-title {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .product-price-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 0;
    margin-bottom: 16px;
  }

  .product-price-label {
    font-size: 14px;
  }

  .product-price {
    font-size: 30px;
  }

  .trust-badges {
    gap: 10px;
  }

  .trust-badge {
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.35;
  }

  .step-header {
    margin-bottom: 16px;
  }

  .step-title {
    font-size: 18px;
  }

  .step-body {
    margin-bottom: 20px !important;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-group input {
    padding: 13px 14px;
    font-size: 16px;
  }

  .payment-method {
    padding: 14px;
  }

  .payment-method-header {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 8px;
  }

  .payment-method-name {
    font-size: 15px;
  }

  .payment-method-tag {
    margin-left: 0;
  }

  .payment-method-body p {
    padding-left: 0;
    margin-top: 8px;
  }

  .order-bump {
    grid-template-columns: 24px 58px minmax(0, 1fr);
    align-items: start;
    row-gap: 10px;
    column-gap: 10px;
    padding: 16px 14px;
    margin-bottom: 16px;
  }

  .bump-image {
    width: 58px;
    height: 58px;
  }

  .bump-content {
    gap: 3px;
  }

  .bump-content strong {
    font-size: 14px;
  }

  .bump-content small {
    font-size: 11px;
    line-height: 1.3;
  }

  .bump-price {
    grid-column: 2 / 4;
    justify-self: start;
    margin-top: 2px;
  }

  .order-summary {
    padding: 16px 14px;
    margin: 22px 0 18px;
  }

  .summary-row {
    font-size: 13px;
    gap: 12px;
  }

  .summary-row span:last-child {
    text-align: right;
    font-weight: 700;
  }

  .summary-row.total {
    font-size: 17px;
  }

  .btn-checkout {
    padding: 18px 16px;
    font-size: 16px;
    border-radius: 14px;
  }

  .btn-icon {
    flex: 0 0 auto;
  }

  .checkout-microcopy {
    font-size: 11px;
  }

  .whatsapp-help-image {
    display: block;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
  }
}

/* Modal Overlay & Container */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.3s ease-out;
}

.modal-container {
  background: var(--white);
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
  border: 1px solid var(--line);
  animation: slideUp 0.3s ease-out;
}

.modal-header-badge {
  display: inline-block;
  background: #d97706;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 24px;
}

.modal-offer-box {
  background: var(--green-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.modal-offer-price-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
  padding-bottom: 12px;
}

.modal-offer-price-box .old-price {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.modal-offer-price-box .new-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--green);
}

.modal-offer-desc {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.modal-product-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-product-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.modal-product-list li .check-icon {
  color: #22c55e;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
}

.modal-product-list li strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.modal-product-list li span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  display: block;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-accept {
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
  width: 100%;
}

.btn-accept:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn-decline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-decline:hover {
  background: rgba(15, 23, 42, 0.04);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 480px) {
  .modal-container {
    padding: 24px 16px;
  }
  .modal-title {
    font-size: 19px;
  }
  .modal-offer-price-box .new-price {
    font-size: 24px;
  }
}
