:root {
  --checkout-primary: #000000;
  --checkout-secondary: #000000;
  --checkout-bg: #f4f7f6;
  --checkout-card-bg: #ffffff;
  --checkout-text: #333333;
  --checkout-text-light: #666666;
  --checkout-border: #e0e0e0;
  --checkout-success: #000000;
  --checkout-error: #e74c3c;
}

body {
  background-color: var(--checkout-bg);
  color: var(--checkout-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

/* Header */
.checkout-header {
  background: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--checkout-border);
  /* Removido sticky header conforme solicitado */
}

.checkout-header img {
  height: 65px; /* Logo maior como solicitado */
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #138D36; /* Verde para passar confiança */
  background: #f0fff4;
  padding: 8px 15px;
  border-radius: 50px;
  border: 1px solid #c6f6d5;
}

.secure-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.secure-badge-text span:first-child {
  color: #2d3748;
  font-weight: 600;
}

.checkout-main-banner {
  margin-top: 0 !important;
}

/* Ocultar banners no desktop conforme solicitado */
@media screen and (min-width: 768px) {
  .checkout-main-banner,
  .checkout-banner {
    display: none !important;
  }
}

.checkout-main-banner img {
  width: 100%;
  border-radius: 0 !important; /* Sem bordas arredondadas */
  display: block;
}

/* --- Footer Moderno e Organizado --- */
.checkout-footer {
  background: #000000;
  color: #ffffff;
  padding: 50px 20px 30px;
  margin-top: 50px;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-column h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #cccccc;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-contact p {
  font-size: 14px;
  color: #cccccc;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.footer-payments svg, .footer-payments img {
  height: 25px;
  /* Removido background e padding para usar ícones brancos direto no fundo preto */
}

.footer-badges {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.footer-badges img {
  height: 40px;
  /* Removido filter invert para mostrar selos originais, se necessário adicione filter se forem escuros */
}

.footer-bottom {
  max-width: 1100px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #333;
  text-align: center;
  font-size: 12px;
  color: #666;
}

/* Banner */
.checkout-banner {
  background: #000000;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* Layout Container */
.checkout-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
}

@media (min-width: 901px) {
  .checkout-container {
    min-height: calc(100vh - 100px - 300px); /* Garante que o container tenha altura suficiente no desktop */
  }
}

.checkout-main {
  flex: 1;
  max-width: 650px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.order-summary-sidebar {
  width: 380px;
  flex-shrink: 0;
  position: relative;
}

@media (max-width: 1100px) {
  .checkout-container {
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .checkout-container {
    flex-direction: column;
    padding: 15px;
    align-items: center; /* Centraliza no mobile */
  }
  
  .checkout-main {
    width: 100%;
    max-width: 100%;
  }

  .order-summary-sidebar {
    width: 100%;
    max-width: 650px; /* Mantém a mesma largura do main no mobile */
    order: -1;
  }

  .order-summary-card {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .summary-items {
    max-height: none;
    overflow: visible;
  }
}

.checkout-step {
  background: var(--checkout-card-bg);
  padding: 30px; /* Aumentado de 25px */
  border-radius: 12px; /* Mais arredondado */
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Sombra mais suave e moderna */
  display: none;
  width: 100%;
  text-align: left; /* Garante alinhamento à esquerda do conteúdo */
}

.checkout-step.active {
  display: block;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.step-indicator {
  font-size: 14px;
  color: var(--checkout-text-light);
  font-weight: 600;
}

/* Form Styles */
.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #444;
}

.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--checkout-border);
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--checkout-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Order Summary */
.order-summary-card {
  background: var(--checkout-card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.summary-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
}

.summary-items {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  margin-bottom: 15px;
}

.summary-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-item-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.summary-item-info {
  flex: 1;
}

.summary-item-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.summary-item-price {
  font-size: 12px;
  color: var(--checkout-text-light);
}

.summary-totals {
  border-top: 1px solid var(--checkout-border);
  padding-top: 15px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.total-row.grand-total {
  font-size: 18px;
  font-weight: 800;
  margin-top: 10px;
  color: var(--checkout-secondary);
}

.discount-text {
  color: var(--checkout-success);
  font-weight: 600;
}

/* Buttons */
.btn-next, .btn-finish {
  width: 100%;
  padding: 15px;
  background-color: #000000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity 0.2s;
}

.btn-next:hover, .btn-finish:hover {
  opacity: 0.9;
}

.btn-back {
  background: none;
  border: none;
  color: var(--checkout-text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Payment Options */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-method {
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.payment-method.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f5f5f5;
  border-color: #ddd;
  pointer-events: none;
}

.payment-disabled-msg {
  font-size: 12px;
  color: var(--checkout-text-light);
  font-weight: 600;
  margin-top: 8px;
  padding-left: 30px;
}

.payment-method.selected {
  border-color: #000000;
  background-color: #f9f9f9;
}

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

.payment-method input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--checkout-primary);
}

.payment-method-icon {
  width: 24px;
}

.payment-method-label {
  font-weight: 700;
  font-size: 15px;
}

.payment-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.payment-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
  display: none;
}

.payment-method.selected .payment-details {
  display: block;
}

.pix-instructions {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.pix-value {
  font-weight: 700;
  font-size: 15px;
}

/* Order Bump / Offer */
.order-bump {
  border: 2px dashed #ff8c00;
  background: #fff9f0;
  padding: 18px;
  border-radius: 12px;
  margin-top: 25px;
  display: flex;
  gap: 15px;
  align-items: flex-start; /* Alinhado ao topo para acomodar o botão abaixo */
  transition: all 0.3s ease;
  width: 100%;
}

.order-bump:hover {
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.1);
}

.order-bump-img-container {
  width: 100px; /* Aumentado de 70px */
  height: 100px; /* Aumentado de 70px */
  flex-shrink: 0; /* Garante que o container não diminua */
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-bump-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply; 
}

.order-bump-info {
  flex: 1;
}

.order-bump-title {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #ff8c00;
  background: #fff0e0;
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  letter-spacing: 0.5px;
}

.order-bump-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 2px;
}

.order-bump-price {
  font-size: 13px;
  color: #4a5568;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap; /* Garante que o preço não quebre */
}

.old-price del {
  color: #a0aec0;
  white-space: nowrap;
}

.price-separator {
  color: #a0aec0;
  font-size: 11px;
}

.new-price {
  color: #2f855a;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.order-bump-action {
  display: flex;
  flex-direction: row; /* Alinhado horizontalmente */
  align-items: center;
  gap: 8px;
  margin-top: 10px; /* Espaço após o preço */
  background: #ff8c00; /* Fundo laranja para destaque */
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  width: fit-content; /* Ocupa apenas o necessário, mas "por extenso" */
  cursor: pointer;
}

.order-bump-action input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #fff;
}

.order-bump-action label {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  text-transform: uppercase;
}

/* Success Modal / Message */
#checkout-success-msg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  visibility: hidden;
  z-index: 99999;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#checkout-success-msg.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.modal-pix-container {
  position: relative;
  z-index: 2;
  background: #ffffff;
  width: 95%;
  max-width: 420px;
  max-height: 98vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  padding: 15px 20px;
  animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: #32BCAD #f1f1f1;
}

@keyframes modalAppear {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body.modal-open, html.modal-open {
  overflow: hidden !important;
  height: 100vh !important;
}

.success-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.success-timer {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

#pix-timer {
  font-weight: 700;
  color: #32BCAD;
}

.pix-illustration {
  margin-bottom: 6px;
  display: block !important;
}

.phone-icon {
  width: 45px;
  height: 70px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px solid #333;
  display: flex;
  align-items: center; 
  justify-content: center;
  position: relative;
  margin: 0 auto;
}

.phone-icon img {
  width: 22px;
}

.timer-overlay {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
}

.timer-overlay svg {
  width: 12px;
  height: 12px;
  color: #32BCAD;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff9e6;
  color: #856404;
  padding: 5px 12px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 10px;
  border: 1px solid #ffeeba;
  position: relative;
}

.payment-status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #ffc107;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 193, 7, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* Pix Elements Otimizados */
.pix-main-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.pix-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pix-qr-container {
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #eee;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#pix-qr-image, #pix-qr-canvas {
  width: 130px;
  height: 130px;
  display: block;
}

#pix-qr-canvas img {
  width: 100%;
  height: 100%;
}

.pix-details-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pix-code-container {
  border: 2px dashed #32BCAD;
  border-radius: 8px;
  padding: 8px;
  background: #f0fdfa;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

#pix-copy-paste {
  width: 100%;
  border: none;
  background: transparent;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #333;
  text-align: center;
  outline: none;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy-pix {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 8px;
  background: #32BCAD;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(50, 188, 173, 0.25);
}

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

.pix-final-value-display {
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

#pix-success-value {
  color: #32BCAD;
  font-weight: 800;
}

.pix-how-to-pay {
  text-align: left;
  border-top: 1px solid #eee;
  padding-top: 10px;
  width: 100%;
}

.pix-how-to-pay h3 {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #333;
}

.pix-steps {
  list-style: none;
  padding: 0;
}

.pix-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #555;
  line-height: 1.2;
}

.step-num {
  min-width: 16px;
  height: 16px;
  background: #32BCAD;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.btn-back-store {
  background: #f8f9fa;
  border: 1px solid #ddd;
  color: #666;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
}

.success-icon {
  font-size: 40px;
  color: #28a745;
  margin-bottom: 8px;
}

/* Success Icon Animation */
.success-icon-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.success-icon-ring {
  position: absolute;
  inset: 0;
  border: 4px solid #32BCAD;
  border-radius: 50%;
  animation: ringPulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes ringPulse {
  from { transform: scale(0.8); opacity: 1; }
  to { transform: scale(1.5); opacity: 0; }
}

.success-icon-check {
  position: relative;
  width: 100%;
  height: 100%;
  background: #32BCAD;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(50, 188, 173, 0.3);
}

.success-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 25px;
}

.btn-back-store-success {
  width: 100%;
  background: #32BCAD;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(50, 188, 173, 0.3);
}

.btn-back-store-success:hover {
  background: #2ba699;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(50, 188, 173, 0.4);
}

#checkout-paid-msg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  visibility: hidden;
  z-index: 100000;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#checkout-paid-msg.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
  align-items: center;
  justify-content: center;
}

/* Mobile Adjustments for Success Modal */
@media (max-width: 600px) {
  .success-desc {
    font-size: 14px;
  }

  .modal-pix-container {
    padding: 15px;
    max-height: 98vh;
    max-width: 95%;
  }

  .pix-main-content {
    gap: 10px;
  }

  .pix-qr-container {
    display: inline-block !important;
    padding: 10px;
  }

  .pix-qr-section {
    gap: 8px;
  }

  .pix-final-value-display {
    margin-bottom: 4px;
  }

  .pix-illustration {
    display: none !important;
  }

  .phone-icon {
    width: 40px;
    height: 65px;
  }

  .phone-icon img {
    width: 18px;
  }

  .success-title {
    font-size: 16px;
  }

  .pix-how-to-pay {
    padding-top: 8px;
  }
}

@media (max-height: 500px) {
  .modal-pix-container {
    padding: 8px;
  }
  .pix-illustration, .phone-icon, .payment-status-badge {
    display: none;
  }
  .success-title {
    font-size: 15px;
    margin-bottom: 1px;
  }
  .success-timer {
    margin-bottom: 4px;
  }
}
