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

html {
  background-color: hsl(216, 20%, 95%);
  padding: 0;
}

.page-wrapper {
  background-color: hsl(20, 50%, 98%);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 4rem auto;
  max-width: 1440px;
  padding: 4rem 6rem;
}

.container {
  align-items: flex-start;
  display: flex;
  flex-direction: row;
  font-family: "Red Hat Text", sans-serif;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.product-list {
  flex: 3;
  min-width: 0;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
}

.cart-container {
  flex: 1.2;
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
}

.product-grid {
  display: grid;
  grid-auto-rows: min-content;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem 1.5rem;
  margin-top: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-card:last-child {
  margin-bottom: 0;
}

h3 {
  font-size: 1rem;
}

.image-container {
  position: relative;
  width: 100%;
  margin-bottom: 2.5rem;
}

.product-image {
  width: 100%;
  border-radius: 0.5rem;
  display: block;
}

.button-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 10rem;
  z-index: 10;
}

.add-to-cart-btn {
  background-color: white;
  border: 1px solid hsl(14, 65%, 9%);
  border-radius: 1.5rem;
  padding: 0.75rem 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  border: 1px solid hsl(14, 86%, 42%);
}

.product-info {
  margin-top: 0.5rem;
}

.category {
  color: hsl(7, 20%, 60%);
  font-size: 0.875rem;
}

.name {
  font-weight: 600;
  margin: 0.25rem 0;
}

.price {
  color: hsl(14, 86%, 42%);
  font-weight: 600;
}

.quantity-selector {
  background-color: hsl(14, 86%, 42%);
  color: hsl(20, 50%, 98%);
  border-radius: 1.5rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.quantity-selector button {
  background: transparent;
  border: 1px solid hsl(20, 50%, 98%);
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.4s ease;
}

.quantity-selector button:hover {
  background-color: white;
}

.quantity-selector button:hover img {
  filter: invert(36%) sepia(85%) saturate(3088%) hue-rotate(345deg)
    brightness(91%) contrast(92%);
}

.quantity {
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75em 0;
}

.cart-empty img {
  width: 8rem;
  margin-bottom: 1rem;
}

.cart-empty p {
  color: hsl(7, 20%, 60%);
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-content h2 {
  color: hsl(14, 86%, 42%);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cart-item {
  align-items: center;
  display: flex;
  border-bottom: 1px solid hsl(13, 31%, 94%);
  font-size: 0.75rem;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.cart-item:last-of-type {
  border-bottom: none;
}

.cart-item-name {
  color: hsl(14, 65%, 9%);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cart-item-details {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.item-qty {
  color: hsl(14, 86%, 42%);
  font-weight: 700;
}

.item-price {
  color: hsl(12, 20%, 44%);
  font-weight: 400;
}

.item-total {
  color: hsl(12, 20%, 44%);
  font-weight: 600;
}

.remove-item {
  background: transparent;
  border: 1px solid hsl(7, 20%, 60%);
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-item:hover {
  border: 1px solid hsl(14, 65%, 9%);
}

.remove-item:hover img {
  filter: brightness(0);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.cart-total span:first-child {
  color: hsl(14, 65%, 9%);
  font-size: 0.75rem;
}

.total-price {
  color: hsl(14, 65%, 9%);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
}

.carbon-neutral {
  align-items: center;
  background-color: hsl(20, 50%, 98%);
  border-radius: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.carbon-neutral P {
  font-size: 0.75rem;
}

.confirm-btn {
  background-color: hsl(14, 86%, 42%);
  color: hsl(20, 50%, 98%);
  border: none;
  border-radius: 2rem;
  padding: 1rem;
  width: 100%;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.confirm-btn:hover {
  background-color: hsl(14, 65%, 29%);
}

.modal-overlay {
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  font-family: "Red Hat Text", sans-serif;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: 1rem;
  margin: 2rem auto;
  max-height: 90vh;
  max-width: 550px;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  width: 90%;
}

.modal-content h2 {
  color: hsl(14, 65%, 9%);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.confirmation-icon {
  margin-bottom: 1.5rem;
}

.modal-subtitle {
  color: hsl(7, 20%, 60%);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.order-summary {
  background-color: hsl(13, 31%, 94%);
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem 0.5rem 1.5rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid hsl(14, 72%, 72%, 0.2);
}

.summary-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.summary-item-left img {
  width: 3rem;
  border-radius: 0.25rem;
}

.summary-name {
  color: hsl(14, 65%, 9%);
  font-size: 0.875rem;
  font-weight: 600;
  max-width: 150px;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.summary-details {
  font-size: 0.875rem;
}

.summary-details .item-price {
  color: hsl(14, 65%, 9%);
  font-weight: 400;
  padding: 1rem;
}

.summary-total {
  color: hsl(14, 65%, 9%);
  font-weight: 700;
}

.order-summary .cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0;
  padding-bottom: 1rem;
  padding-top: 1rem;
}

.order-summary .total-price {
  font-size: 1.5rem;
  margin-top: 0.25;
}

@media (max-width: 1024px) {
  html,
  body {
    padding: 0;
    margin: 0;
  }

  .page-wrapper {
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    max-width: none;
    min-height: 100vh;
    padding: 1.5rem 2.5rem;
    width: 100%;
  }

  .container {
    flex-direction: column;
    align-items: center;
  }

  .product-list,
  .cart-container {
    width: 100%;
    flex: none;
  }

  h1 {
    text-align: left;
    max-width: 300px;
    margin: 0 auto 1.5rem auto;
  }

  .product-grid {
    grid-template-columns:
      repeat auto-fit,
      minmax(min (100%, 250px), 1fr);
    justify-content: center;
  }

  .product-image {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
  }

  .product-card {
    max-width: 300px;
    width: 100%;
  }

  .cart-container {
    position: static;
    margin-top: 2rem;
    background-color: white;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 2.5rem 1.5rem;
    max-height: 95vh;
  }
}
