@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&display=swap');

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

html {
  scrollbar-gutter: stable;
  font-family: var(--font-family);
}

:root {
  /* Colors */
  --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%);
  /* Typography */
  --product-name-font-size: 16px;
  --font-family: 'Red Hat Text', sans-serif;
  --fw-bold: 700;
  --fw-normal: 600;
  --fw-light: 400;
}

body {
  background-color: var(--rose-50);
  padding: 5rem;
}

.main-layout {
  display: flex;
  gap: 2rem;
  max-width: 1440px;
  margin: 0 auto;
  align-items: flex-start;
}

button:focus-visible,
.remove-item-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Product Section Styles */
.products-section {
  flex: 1;
}

.products-section .desserts {
  font-size: 2.5rem;
  font-weight: var(--fw-bold);
  color: var(--rose-900);
  margin-bottom: 2rem;
}

.products-section .products-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.product-container .imageWrapper {
  position: relative;
  margin-bottom: 2.5rem;
}

.product-container .imageWrapper > img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.product-container .button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 1000px;
  border: 1px solid var(--rose-400);
  font-weight: var(--fw-bold);
  cursor: pointer;
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background-color: white;
  min-width: 160px;
  transition: background-color 0.2s, color 0.2s;
}

.product-container .button:hover:not(.in-cart) {
  border-color: var(--red);
  color: var(--red);
}

.product-container .button .add-to-cart-initial {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.imageWrapper.selected > img {
  border-color: var(--red);
}

.button.in-cart {
  background-color: var(--red);
  color: white;
  border-color: var(--red);
}

.quantity-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.quantity-control button {
  background: none;
  border: 1px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.quantity-control button:hover {
  background-color: var(--rose-50);
}

.quantity-control button img {
  width: 10px;
  height: 10px;
}

.product-info .category {
  color: var(--rose-400);
}

.product-info .name {
  font-weight: var(--fw-bold);
  color: var(--rose-900);
}

.product-info .price {
  color: var(--red);
  font-weight: var(--fw-bold);
}

/* Cart Section Styles */
.your-cart-container {
  width: 380px;
  flex-shrink: 0;
  background-color: white;
  padding: 1.5rem;
  border-radius: 10px;
}

.your-cart-container .your-cart {
  color: var(--red);
  font-weight: var(--fw-bold);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

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

.item-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-name {
  font-weight: var(--fw-bold);
  color: var(--rose-900);
}

.item-info {
  display: flex;
  gap: 1rem;
  color: var(--rose-400);
  font-weight: var(--fw-normal);
}

.item-quantity {
  color: var(--red);
  font-weight: var(--fw-bold);
}

.item-line-total {
  font-weight: var(--fw-bold);
  color: var(--rose-500);
}

.remove-item-btn {
  background: transparent;
  cursor: pointer;
  border: 1px solid var(--rose-300);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item-btn:hover {
  border-color: var(--red);
}

.remove-item-btn img {
  width: 10px;
  height: 10px;
}

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

.order-total p:first-child {
  margin-right: auto;
}

#total-price {
  font-size: 1.75rem;
  font-weight: var(--fw-bold);
  color: var(--rose-900);
}

.carbon-neutral {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--rose-50);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}

.confirm-order-button {
  background-color: var(--red);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 1rem;
  width: 100%;
  font-weight: var(--fw-bold);
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background-color 0.2s;
}

.confirm-order-button:hover {
  background-color: hsl(14, 86%, 35%);
}

/* Confirmation Modal Styles */
.hidden {
  display: none !important;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}
.confirmation-modal {
  background-color: white;
  padding: 2.5rem;
  border-radius: 15px;
  width: 90%;
  max-width: 550px;
}
.confirmation-modal h2 {
  font-size: 2.5rem;
  color: var(--rose-900);
  margin-top: 1rem;
}
.confirmation-modal > p {
  color: var(--rose-400);
  margin-top: 0.5rem;
}
.modal-summary {
  background-color: var(--rose-50);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.modal-summary .cart-item {
  align-items: flex-start;
}

.modal-summary .cart-item:last-child {
  border-bottom: none;
}

.modal-summary img.summary-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  margin-right: 1rem;
}

.modal-summary .item-details {
  flex-grow: 1;
  gap: 0.25rem;
}

.modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--rose-50);
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-radius: 0 0 8px 8px;
  margin-top: -1px;
}

#modal-total-price {
  font-weight: var(--fw-bold);
  font-size: 1.75rem;
}

.start-new-order-button {
  background-color: var(--red);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 1rem;
  width: 100%;
  font-weight: var(--fw-bold);
  font-size: 1rem;
  cursor: pointer;
  margin-top: 2rem;
  transition: background-color 0.2s;
}
.start-new-order-button:hover {
  background-color: hsl(14, 86%, 35%);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .products-section .products-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  body {
    padding: 2rem;
  }
  .main-layout {
    flex-direction: column;
  }
  .your-cart-container {
    width: 100%;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }
  .products-section .products-container {
    grid-template-columns: 1fr;
  }
  .products-section .desserts {
    font-size: 2rem;
  }
}
