/* Root Variables */
:root {
  --primary-color: #4e54c8;
  --secondary-color: #8f94fb;
  --text-color: #333;
  --bg-color: #fefcf9;
  --error-color: #e63946;
  --success-color: #2a9d8f;
  --border-radius: 8px;
}

/* Reset & Base */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 3rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

h1, h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Table Styling */
.cart-summary table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.cart-summary th, .cart-summary td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #ddd;
}

.cart-summary .total-row td {
  font-weight: bold;
  background-color: #f9f9f9;
}

/* Form Styling */
.checkout-form .form-field {
  margin-bottom: 1.2rem;
}

.checkout-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Submit Button */
#placeOrderBtn {
  background: var(--primary-color);
  color: white;
  padding: 0.9rem 2rem;
  border: none;
  font-size: 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.3s ease;
}

#placeOrderBtn:hover {
  background: var(--secondary-color);
}

#placeOrderBtn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  z-index: 9999;
  font-size: 0.95rem;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  #placeOrderBtn {
    width: 100%;
  }
}
