/* styles.css */
:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --accent-color: #ffd166;
  --dark-color: #2b2d42;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --success-color: #06d6a0;
  --border-radius: 12px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

#cart-btn {
  background: var(--accent-color);
  color: var(--dark-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#cart-container {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  display: none;
}

#clear-cart-btn {
  background: var(--primary-color);
  margin-bottom: 1rem;
}

#products-container {
  margin-bottom: 1.5rem;
}

.product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--light-color);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.product:hover {
  transform: translateX(5px);
}

#cart-container p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

#cart-container span {
  font-weight: 600;
  color: var(--primary-color);
}

#dessert-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dessert-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  text-align: center;
}

.dessert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.dessert-card h2 {
  color: var(--dark-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.dessert-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.product-category {
  color: var(--gray-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.add-to-cart-btn {
  background: var(--success-color);
  width: 100%;
  margin-top: 1rem;
}

/* Tablet Styles */
@media (max-width: 1024px) {
  .title {
    font-size: 2rem;
  }

  #dessert-card-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  .dessert-card {
    padding: 1.2rem;
  }

  .dessert-card h2 {
    font-size: 1.2rem;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }

  .title {
    font-size: 1.8rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  #cart-container {
    padding: 1rem;
  }

  #dessert-card-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dessert-card {
    padding: 1rem;
  }

  .dessert-card h2 {
    font-size: 1.1rem;
  }

  .dessert-price {
    font-size: 1.3rem;
  }

  #cart-container p {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  #cart-btn {
    width: 100%;
    justify-content: center;
  }

  .product {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .dessert-card {
    padding: 0.8rem;
  }

  .dessert-card h2 {
    font-size: 1rem;
  }

  .dessert-price {
    font-size: 1.2rem;
  }
}

/* Animation for cart items */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.product {
  animation: slideIn 0.3s ease;
}

/* Loading state for buttons */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Focus states for accessibility */
.btn:focus,
.dessert-card:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000;
    --secondary-color: #333;
    --accent-color: #666;
    --light-color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none;
    animation: none;
  }

  .btn:hover,
  .dessert-card:hover,
  .product:hover {
    transform: none;
  }
}
