/* Modal de Checkout */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  padding: 20px 0;
  box-sizing: border-box;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 30px;
  border: 1px solid #888;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s ease-out;
  box-sizing: border-box;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover,
.close:focus {
  color: #000;
}

.modal h2 {
  color: #333;
  margin-bottom: 25px;
  text-align: center;
  font-size: 24px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #f0b429;
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.1);
}

.form-group input.error {
  border-color: #dc3545;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: none;
}

.product-summary {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 25px 0;
}

.product-summary h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 18px;
}

.product-summary p {
  margin: 5px 0;
  color: #666;
}

#price-summary-text {
  font-weight: bold;
  color: #f0b429;
  font-size: 18px;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.cancel-btn, .confirm-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.cancel-btn {
  background-color: #e2e8f0;
  color: #64748b;
}

.cancel-btn:hover {
  background-color: #cbd5e1;
}

.confirm-btn {
  background-color: #f0b429;
  color: white;
}

.confirm-btn:hover {
  background-color: #d99e1f;
  transform: translateY(-2px);
}

.confirm-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Responsivo para Modal */
@media (max-width: 768px) {
  .modal {
    padding: 10px 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  
  .modal-content {
    margin: 2% auto;
    width: 95%;
    padding: 20px;
    max-height: calc(100vh - 20px);
    margin-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  
  .modal h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .product-summary {
    margin: 15px 0;
    padding: 12px;
  }
  
  .form-actions {
    flex-direction: column;
    margin-top: 20px;
    gap: 10px;
  }
  
  .cancel-btn, .confirm-btn {
    width: 100%;
    padding: 14px 20px;
  }
}