/**
 * Estilos específicos para Checkout (Step 7)
 */

/* Container do Checkout */
#step7-pagamento {
  max-width: 800px;
  margin: 0 auto;
}

/* Resumo do Orçamento */
.orcamento-resumo {
  margin-bottom: 2rem;
}

.orcamento-resumo .card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid var(--cappes-blue);
  border-radius: 12px;
  overflow: hidden;
}

.orcamento-resumo .card-header {
  background: var(--cappes-blue);
  color: white;
  padding: 1rem 1.5rem;
  margin: 0;
}

.orcamento-resumo .card-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.orcamento-resumo .card-body {
  padding: 1.5rem;
}

.item-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.item-line:last-child {
  border-bottom: none;
}

.item-line.total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--cappes-blue);
  border-bottom: none;
}

.item-line .price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cappes-blue);
}

.item-line.total .price {
  font-size: 1.4rem;
  color: var(--cappes-green);
}

/* Estados de Loading e Erro */
.loading-state {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 2rem 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e9ecef;
  border-top: 4px solid var(--cappes-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-state {
  margin: 2rem 0;
}

.alert {
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.alert-error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.alert p {
  margin: 0.5rem 0;
}

/* Container do Payment Brick */
#payment-brick-container .card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin: 2rem 0;
}

#payment-brick-container .card-header {
  background: linear-gradient(135deg, var(--cappes-blue) 0%, #0056b3 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#payment-brick-container .card-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.security-badge .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

#payment-brick-container .card-body {
  padding: 2rem 1.5rem;
}

/* Customizações do Payment Brick */
#paymentBrick_container {
  min-height: 200px;
}

/* Sobrescrever estilos do MP se necessário */
.mp-checkout-pro-input {
  border-radius: 6px !important;
  border: 1px solid #ced4da !important;
  padding: 0.75rem !important;
  font-size: 1rem !important;
}

.mp-checkout-pro-input:focus {
  border-color: var(--cappes-blue) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Informações Importantes */
.info-box {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border: 1px solid var(--cappes-green);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.info-box h4 {
  color: var(--cappes-green);
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.info-box ul {
  margin: 0;
  padding-left: 1.2rem;
}

.info-box li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.info-box li:last-child {
  margin-bottom: 0;
}

.info-box strong {
  color: var(--cappes-green);
  font-weight: 600;
}

/* Botões de Ação */
.step-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}

.step-actions .btn {
  flex: 1;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: 150px;
}

.step-actions .btn:disabled,
.step-actions .btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.step-actions .btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cappes-green) 0%, #198754 100%);
  border: none;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  border: none;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

/* Responsividade */
@media (max-width: 768px) {
  #step7-pagamento {
    padding: 1rem;
  }

  .orcamento-resumo .card-body,
  #payment-brick-container .card-body {
    padding: 1rem;
  }

  .step-actions {
    flex-direction: column;
  }

  .step-actions .btn {
    min-width: auto;
  }

  .item-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .item-line .price {
    align-self: flex-end;
  }

  #payment-brick-container .card-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* Modo escuro (se implementado) */
@media (prefers-color-scheme: dark) {
  .loading-state {
    background: #343a40;
    color: #f8f9fa;
  }

  .info-box {
    background: linear-gradient(135deg, #1e3a1e 0%, #2d4a2d 100%);
    border-color: var(--cappes-green);
    color: #f8f9fa;
  }

  #payment-brick-container .card {
    background: #495057;
    border-color: #6c757d;
  }

  .orcamento-resumo .card {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: #f8f9fa;
  }
}