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

:root {
  --purple-light: #c9a6e8;
  --purple: #a87bd4;
  --purple-dark: #7c52a5;
  --green: #3a6b4c;
  --green-dark: #2d5340;
  --green-light: #e8f0eb;
  --white: #ffffff;
  --gray-50: #f9f8fb;
  --gray-100: #f0edf4;
  --gray-200: #e0dae8;
  --gray-600: #5c5470;
  --gray-800: #2d2a33;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.container {
  max-width: 520px;
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--gray-600);
  font-size: 1rem;
}

.products {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}

.product-card:hover {
  border-color: var(--purple-light);
}

.product-card.addon {
  border-style: dashed;
}

.product-info {
  flex: 1;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple-dark);
  background: var(--gray-100);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.product-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.description {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--gray-800);
}

.qty-btn:hover {
  border-color: var(--purple);
  background: var(--gray-100);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: center;
}

.cart-summary {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}

#cart-total {
  color: var(--green);
  font-size: 1.3rem;
}

.checkout-btn {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--green);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: var(--green-dark);
}

.checkout-btn:active {
  transform: scale(0.99);
}

.checkout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 480px) {
  .product-card {
    flex-direction: column;
    align-items: stretch;
  }

  .quantity-control {
    justify-content: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
  }
}
