:root {
  --red: hsl(14, 86%, 42%);
  --green: hsl(159, 69%, 38%);
  --rose-50: hsl(20, 50%, 98%);
  --rose-100: hsl(13, 31%, 94%);
  --rose-300: hsl(14, 25%, 72%);
  --rose-400: hsl(7, 20%, 60%);
  --rose-500: hsl(12, 20%, 44%);
  --rose-900: hsl(14, 65%, 9%);
}

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

body {
  font-family: 'Red Hat Text', sans-serif;
  background-color: var(--rose-50);
  color: var(--rose-900);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  font-size: 30px;
}

h1, h2 {
  margin-bottom: 1.5rem;
  font-weight: 700;
}

/* Products section */
.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-category {
  color: var(--rose-400);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.product-price {
  font-weight: 700;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.btn-primary {
  background-color: var(--red);
  color: white;
}

.btn-primary:hover {
  background-color: hsl(14, 86%, 37%);
}

.btn-primary:disabled {
  background-color: var(--rose-300);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--rose-100);
  color: var(--rose-900);
}

.btn-secondary:hover {
  background-color: var(--rose-300);
}

.btn-secondary:disabled {
  color: var(--rose-400);
  cursor: not-allowed;
}

/* Cart section */
.cart {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.cart-items {
  margin-bottom: 1.5rem;
  min-height: 100px;
}

#empty-cart-message {
  color: var(--rose-400);
  text-align: center;
  padding: 2rem 0;
}

.cart-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rose-100);
}

.cart-item-info {
  flex-grow: 1;
  margin-right: 1rem;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--rose-500);
  font-size: 0.9rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
}

.quantity-btn {
  width: 24px;
  height: 24px;
  border: none;
  background-color: var(--rose-100);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background-color: var(--rose-300);
}

.quantity-value {
  margin: 0 0.5rem;
  min-width: 20px;
  text-align: center;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-actions button {
  width: 100%;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-content h2 {
  color: var(--green);
  margin-bottom: 1rem;
}

.modal-content button {
  margin-top: 1.5rem;
}

/* Attribution */
.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
  
  .cart {
    position: static;
    max-height: none;
  }
}
