* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #3a3a3a;
  background-color: #f4f6f8;
  padding: 20px;
  transition: background-color 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  max-width: 900px;
  margin: 20px auto;
  background-color: #ffffff;
  padding: 25px 35px;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.8s ease-out forwards; /* Apply fade-in animation */
}

header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e9ecef;
}
header h1 {
  color: #1a2533;
  margin-bottom: 8px;
  font-weight: 600;
}
header p {
  color: #6c757d;
  font-size: 1em;
}

#products-section h2,
#order-summary-container h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
  font-weight: 500;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  margin-bottom: 35px;
}

.product-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
  overflow: hidden;
  opacity: 0; /* Initial state for animation */
  animation: fadeInUp 0.6s ease-out forwards; /* Apply fadeInUp animation */
}
.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
/* Staggering product card animations */
.products-grid .product-card:nth-child(1) {
  animation-delay: 0.2s;
}
.products-grid .product-card:nth-child(2) {
  animation-delay: 0.4s;
}
.products-grid .product-card:nth-child(3) {
  animation-delay: 0.6s;
}
.products-grid .product-card:nth-child(4) { /* Add more if you have more cards initially visible */
  animation-delay: 0.8s;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
  transition: transform 0.3s ease;
}
/* Optional: Slight zoom on image when card is hovered */
/* .product-card:hover .product-image { transform: scale(1.05); } */
.product-name {
  font-size: 1.15em;
  color: #333;
  margin-bottom: 8px;
  min-height: 2.4em;
  font-weight: 500;
}
.product-price {
  font-weight: 600;
  color: #16a085;
  margin-bottom: 18px;
  font-size: 1.1em;
}

#order-summary-container {
  padding: 25px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}
#order-summary-container h3 {
  margin-top: 25px;
  margin-bottom: 20px;
  color: #343a40;
  text-align: center;
  font-weight: 500;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #495057;
  font-size: 0.95em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: #1abc9c;
  box-shadow: 0 0 0 0.2rem rgba(26, 188, 156, 0.25);
  outline: none;
}
.form-group textarea {
  resize: vertical;
  min-height: 90px;
}
.total-amount-section {
  font-size: 1.25em;
  font-weight: 600;
  text-align: right;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px dashed #ced4da;
}
.total-amount-section span {
  color: #16a085;
}

#order-items-list {
  margin-bottom: 25px;
}
.order-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5px;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}
/* Optional: Zebra striping, can be too much with other effects */
/* .order-item:nth-child(even) { background-color: #fdfdfd; } */
.order-item:hover {
  background-color: #f1f3f5;
}
.order-item:last-child {
  border-bottom: none;
}
.order-item .item-info {
  flex-grow: 1;
  margin-right: 15px;
}
.order-item .item-name {
  font-weight: 500;
  display: block;
  color: #212529;
}
.order-item .item-price-each {
  font-size: 0.9em;
  color: #6c757d;
}
.order-item .item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.order-item .item-quantity {
  width: 65px;
  padding: 8px;
  text-align: center;
  border: 1px solid #ced4da;
  border-radius: 5px;
  font-size: 0.95em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.order-item .item-quantity:focus {
  border-color: #1abc9c;
  box-shadow: 0 0 0 0.15rem rgba(26, 188, 156, 0.2);
  outline: none;
}
.order-item .item-subtotal {
  min-width: 100px;
  text-align: right;
  font-weight: 500;
  font-size: 1em;
  color: #343a40;
}
.order-item .remove-item-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.3em;
  line-height: 28px;
  cursor: pointer;
  padding: 0;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.order-item .remove-item-btn:hover {
  background-color: #c0392b;
  transform: scale(1.1);
}
.order-item .remove-item-btn:active {
  transform: scale(0.95);
}

.empty-cart-message {
  text-align: center;
  color: #6c757d;
  padding: 25px 0;
  font-style: italic;
}
hr.summary-divider {
  margin: 30px 0;
  border: 0;
  border-top: 1px dashed #ced4da;
}

.action-button,
.secondary-button,
.order-btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.15s ease,
    box-shadow 0.2s ease;
  width: 100%;
  letter-spacing: 0.5px;
}
.order-btn {
  /* Product card button */
  width: auto;
  padding: 10px 22px;
  background-color: #3498db;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.order-btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-button {
  /* Proceed to Payment button */
  background-color: #1abc9c; /* Changed this from #3498db to the teal color for primary action */
  color: white;
  padding: 14px 28px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.action-button:hover {
  background-color: #16a085; /* Darker teal for hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.action-button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.secondary-button {
  /* Clear Order button */
  background-color: #e9ecef;
  color: #495057;
  margin-top: 12px;
  border: 1px solid #ced4da;
}
.secondary-button:hover {
  background-color: #dee2e6;
  border-color: #bdc3c7;
  transform: translateY(-1px);
}

.status-message {
  margin-top: 25px;
  padding: 15px 20px;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
}
.status-message.success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}
.status-message.error {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}
.status-message.info {
  background-color: #cff4fc;
  color: #055160;
  border: 1px solid #b6effb;
}

footer {
  text-align: center;
  margin-top: 45px;
  padding-top: 25px;
  border-top: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.9em;
}
footer .support-info {
    margin-top: 10px;
    font-size: 0.9em;
    color: #7f8c8d;
}
footer .support-info a {
    color: #3498db;
    text-decoration: none;
}
footer .support-info a:hover {
    text-decoration: underline;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Accessibility: Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce) {
  .container, .product-card {
    animation: none !important;
    opacity: 1 !important; /* Ensure they are visible */
  }
  /* You might want to disable other transitions too if they are problematic */
  .product-card:hover,
  .order-btn:hover,
  .action-button:hover,
  .secondary-button:hover,
  .order-item .remove-item-btn:hover {
    transform: none;
  }
}


@media (max-width: 768px) {
  .container {
    padding: 20px 25px;
  }
  .order-item .item-controls {
    gap: 10px;
  }
  .order-item .item-quantity {
    width: 55px;
    padding: 7px;
  }
}
@media (max-width: 600px) {
  .container {
    padding: 20px 15px;
  }
  .products-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  header h1 {
    font-size: 1.8em;
  }
  .action-button,
  .secondary-button,
  .order-btn {
    font-size: 0.95em;
    padding: 12px 20px;
  }
  .order-btn {
    padding: 9px 18px;
  }
  .order-item .item-controls {
    width: 100%;
    margin-top: 10px;
    justify-content: space-between;
  }
  .order-item .item-info {
    margin-right: 0;
    margin-bottom: 8px;
  }
}