/* Estilos para o checkout em etapas */

/* Indicador de progresso */
.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
}

.progress-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30%;
  padding: 8px 15px;
  border-radius: 20px;
  background-color: #f2f2f2;
  color: #666;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  transition: all 0.3s ease;
}

.progress-line {
  height: 3px;
  background-color: #e0e0e0;
  flex: 1;
  transition: all 0.3s ease;
}

.progress-step.active {
  background-color: var(--primary-color);
  color: white;
}

.progress-step.completed {
  background-color: var(--success-color);
  color: white;
}

.progress-line.completed {
  background-color: var(--success-color);
}

/* Etapas de checkout */
.checkout-step {
  padding: 15px 0;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.checkout-step:not([style*="display: none"]) {
  opacity: 1;
  transform: translateY(0);
}

.step-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}

/* Resumo do endereço */
.address-summary {
  margin: 15px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
  border-left: 4px solid var(--primary-color);
}

.address-summary h4 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 16px;
  margin-bottom: 10px;
}

#selectedAddressDisplay {
  line-height: 1.5;
}

/* Detalhes de envio */
.shipping-details {
  margin: 15px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
  border-left: 4px solid var(--secondary-color);
}

.shipping-details h4 {
  margin-top: 0;
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 10px;
}

#shippingMethodDisplay {
  line-height: 1.5;
}

/* Endereços de usuário */
.address-card {
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background-color: #fff;
}

.address-card:hover {
  border-color: var(--primary-color-light);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.address-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(var(--primary-color-rgb), 0.2);
}

.address-card.selected::before {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.address-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.address-card-content {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
}

.address-tag {
  background-color: var(--primary-color);
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.address-empty-message {
  padding: 15px;
  background-color: #f8f8f8;
  border: 1px dashed #ddd;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 15px;
  color: #666;
}

/* Feedback de cálculo de frete */
#shippingFeedback {
  margin-top: 10px;
  min-height: 20px;
}

#shippingFeedback .loading {
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

#shippingFeedback .loading:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#shippingFeedback .success {
  color: var(--success-color);
  font-weight: 500;
}

#shippingFeedback .error {
  color: var(--error-color);
  font-weight: 500;
}

/* Ordem de resumo */
.order-summary {
  margin-top: 15px;
}

.order-summary h3 {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.summary-row.main-total {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 15px;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .progress-step {
    font-size: 12px;
    padding: 8px;
  }
  
  .step-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .step-actions button {
    width: 100%;
  }
}

/* Mobile responsiveness improvements */
@media (max-width: 576px) {
  .progress-step {
    font-size: 11px;
    padding: 6px;
  }
  
  .progress-indicator {
    margin: 10px 0;
  }
  
  .address-card-title {
    font-size: 14px;
  }
  
  .address-card-content {
    font-size: 13px;
  }
}

/* Ajuste para o formulário de novos endereços */
#newAddressForm {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

#newAddressForm input {
  margin-bottom: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#newAddressForm button {
  margin-top: 10px;
}

#cepError {
  margin-top: 5px;
  font-size: 13px;
  color: var(--error-color);
}
