/* --- GERAL, FONTES E CORES BASE --- */
#redpay-checkout-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #333;
  /* Cor de texto principal */
  background-color: #fff;
  display: flex;
  flex-wrap: wrap;
  border-radius: 10px;
  gap: 40px;
  max-width: 980px;
  margin: 40px auto;
  padding: 20px;
}

#redpay-checkout-app label {
  font-weight: 600;
}

#redpay-checkout-app input::placeholder {
  color: #888;
}




/* --- ESTRUTURA PRINCIPAL (LAYOUT DE 2 COLUNAS) --- */
.redpay-main-column {
  flex: 2;
  min-width: 350px;
}

.redpay-summary-column {
  flex: 1;
  min-width: 320px;
}

/* --- BARRA DE PROGRESSO (ETAPAS) --- */
.redpay-progress-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
}

.redpay-progress-bar .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #adb5bd;
  font-weight: 500;
  flex-basis: 0;
  flex-grow: 1;
}

.redpay-progress-bar .step .step-circle {
  width: 24px;
  height: 24px;
  border: 2px solid #adb5bd;
  border-radius: 50%;
  margin-bottom: 8px;
}

.redpay-progress-bar .step.active {
  color: #333;
  font-weight: bold;
}

.redpay-progress-bar .step.active .step-circle {
  background-color: #28a745;
  border-color: #28a745;
}

.redpay-progress-bar .step-line {
  flex-grow: 1;
  height: 2px;
  background-color: #e9ecef;
  margin: 0 10px;
  transform: translateY(12px);
}

/* CORREÇÃO: Pinta a linha após um passo ativo */
.redpay-progress-bar .step.active+.step-line {
  background-color: #28a745;
}

/* --- FORMULÁRIO E TÍTULOS DE ETAPA --- */
.step-title {
  margin-bottom: 20px;
  text-align: center;
}

#redpay-checkout-form input {
  width: 100%;
  padding: 14px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  box-sizing: border-box;
  margin-bottom: 15px;
}

#redpay-checkout-form input.has-error {
  border-color: #e74c3c;
}

.error-message {
  color: #e74c3c;
  font-size: 13px;
  margin-top: -10px;
  display: block;
  margin-bottom: 10px;
}

/* --- RESUMO DO PEDIDO --- */
.redpay-trust-header {
  background-color: #28a745;
  padding: 12px;
  font-weight: bold;
  color: #ffffff;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.redpay-trust-header svg {
  margin-right: 8px;
}

.product-summary {
  padding: 20px;
  border: 1px solid #e9ecef;
  border-radius: 0 0 8px 8px;
}

.product-summary .product-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.product-summary .product-info img {
  width: 80px;
  height: 80px;
  background-size: cover;
  background-position: center;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 2px solid #dee2e6;
}

.product-summary .product-text h3 {

  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 2. Deixa o link de ajuda azul e em negrito */
.product-summary .help-link {
  color: #4090e6;       /* Cor azul */
  font-weight: bold;   /* Negrito */
  text-decoration: none; /* Remove o sublinhado padrão de links */
  font-size: 14px;
}

/* Opcional: Adiciona o sublinhado de volta quando o mouse passa por cima */
.product-summary .help-link:hover {
  text-decoration: underline;
}

.price-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
}

.price-label {
  font-weight: 600;
}

.price-values {
  text-align: right;
}

.price-values .old-price {
  text-decoration: line-through;
  font-size: 14px;
  color: #6c757d;
}

.cash-price-amount {
  color: #28a745;
  font-weight: bold;
  font-size: 21px;
}

.cash-price-label {
  margin-left: 0.2em;
  color: #6c757d;
}

/* --- BOTÕES --- */
.redpay-button-primary,
.button-secondary,
.button-link {
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
  margin-top: 10px;
  box-sizing: border-box;
}

.redpay-button-primary {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.redpay-button-primary.big {
  padding: 14px;
  font-size: 1rem;
  margin: 14px 0;
}

.redpay-button-primary:hover {
  background-color: #218838;
}

.button-secondary {
  background-color: #e9f7ec;
  color: #28a745;
  border-color: #28a745;
}

.button-secondary:hover {
  background-color: #d4edda;
}

.button-link.full {
  width: 100%;
  max-width: 100%;
  background: none;
  border: none;
  color: #666;
  font-weight: normal;
  margin-top: 6px;
  text-decoration: none;
}

.button-link.full:hover {
  text-decoration: underline;
}

/* --- ETAPA 2: PAGAMENTO PIX --- */
.payment-method-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.payment-method {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background-color: #f8f9fa;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
}

.payment-method.active {
  border-color: #28a745;
  background-color: #e9f7ec;
  color: #28a745;
}

#redpay-pix-area {
  text-align: center;
}

.pix-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #ecf9f0;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 26px;
}

.pix-box-icon svg {
  width: 42px;
  height: 42px;
  display: block;
}

.pix-box-text {
  flex: 1;
  text-align: left;
}

.pix-box-text h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #006634;
}

.pix-box-text p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.pix-box-timer {
  text-align: right;
  font-size: .9rem;
  line-height: 1.2;
  background-color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.pix-box-timer strong {
  display: block;
  font-size: 1.45rem;
  color: #d63031;
  font-weight: 700;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f5f6f7;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 10px 0;
  text-align: left;
}
/* --- AJUSTE DE ALINHAMENTO PARA AS INSTRUÇÕES --- */

.instruction-item .instruction-text {
  text-align: center;
}

.instruction-item .instruction-icon {
  flex-shrink: 0;
}

.instruction-item strong {
  display: block;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
}

.instruction-item p {
  margin: 0;
  align-items: center;
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}

.pix-qrcode {
  margin: 30px auto;
  max-width: 200px;
}

.status-message {
  text-align: center;
  margin: 18px 0;
  color: #666;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: redpay-spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes redpay-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- POP-UP DE CARREGAMENTO --- */
#redpay-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.loading-box {
  background-color: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.loading-box p {
  margin: 5px 0 0 0;
  font-size: 16px;
  color: #6c757d;
}

.loading-box p strong {
  font-size: 20px;
}

/* --- BARRA DE PROGRESSO DO POP-UP (RESTAURADA) --- */
.loading-box .progress-bar {
  width: 100px;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin: 12px auto 20px;
}

.loading-box .progress-fill {
  width: 0%;
  height: 100%;
  background: #28a745;
  animation: redpay-loading 1.5s infinite;
}

@keyframes redpay-loading {
  0% {
    width: 0%;
  }

  10% {
    width: 10%;
  }

  20% {
    width: 20%;
  }

  30% {
    width: 30%;
  }

  40% {
    width: 40%;
  }

  50% {
    width: 50%;
  }

  60% {
    width: 60%;
  }

  70% {
    width: 70%;
  }

  80% {
    width: 80%;
  }

  90% {
    width: 90%;
  }

  100% {
    width: 100%;
  }
}


/* --- NOTIFICAÇÃO GLOBAL DE ERRO --- */
#redpay-global-notifier {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -150%);
  background-color: #e00202;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transition: transform 0.4s ease-in-out;
  font-weight: bold;
}

#redpay-global-notifier.visible {
  transform: translate(-50%, 0);
}

/* --- RESPONSIVO --- */
@media(max-width:768px) {
  #redpay-checkout-app {
    flex-direction: column-reverse;
  }

  .redpay-summary-column {
    order: -1;
  }
}

@media(max-width:480px) {
  .pix-box {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .pix-box-text {
    text-align: center;
  }

  .pix-box-timer {
    text-align: center;
  }
}

/* --- AJUSTES PARA RESPONSIVO AVANÇADO --- */

/* 1. Torna a caixa PIX mais "elástica" em telas médias */
.pix-box {
  flex-wrap: wrap; /* Permite que o timer quebre a linha se não houver espaço */
}

.pix-box-text {
  min-width: 200px; /* Garante um espaço mínimo para o texto não ficar espremido */
}

/* 2. Novo breakpoint para tablets em modo retrato e celulares dobráveis (como o Z Fold 5 aberto) */
@media (max-width: 767px) {
  /* Força a caixa de sucesso do PIX a ficar vertical, melhorando a leitura */
  .pix-box {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  .pix-box-text {
    text-align: center;
  }
  .pix-box-timer {
    text-align: center;
  }
}

/* --- AJUSTES FINOS PARA TELAS ESTREITAS (GALAXY FOLD, ETC.) --- */

@media (max-width: 480px) {
  /* Remove a largura mínima das colunas para que elas possam encolher */
  .redpay-main-column,
  .redpay-summary-column {
    min-width: auto;
  }

  /* Reduz o espaçamento lateral do container principal */
  #redpay-checkout-app {
    padding: 20px 15px;
    gap: 20px;
  }
  
  /* Garante que o texto dentro das caixas de instrução quebre a linha */
  .instruction-item p, .instruction-item strong {
    word-break: break-word;
  }

  /* Ajusta o tamanho da fonte no box de sucesso para não ficar muito grande */
  .pix-box-text h3 {
    font-size: 1.1rem; 
  }
  
  .pix-box-text p { 
    font-size: 0.9rem;
  }
}