@font-face {
  font-family: "RedHat Bold";
  src: url("assets/fonts/static/RedHatText-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "RedHat Regular";
  src: url("assets/fonts/static/RedHatText-Regular.ttf") format("truetype");
}

: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: "RedHat Regular", sans-serif;
  background-color: var(--rose-100);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  min-height: 100dvh;
}

.attribution {
  padding: 10px;
  margin-bottom: 10px;
}

.product-list-with-cart {
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 60px;
}

.product-list-title {
  margin-block: 20px;
  font-family: "RedHat Bold", "Franklin Gothic Medium", Arial, sans-serif;
  font-weight: 700;
  color: var(--rose-900);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex: 1;
  gap: 10px;
}

.product-card {
  padding: 6px;
  margin-bottom: 10px;
  font-weight: 500;
  header {
    display: block;
    margin-top: 30px;
  }

  header > span {
    color: var(--rose-500);
    font-size: 0.9rem;
    font-weight: 500;
  }

  header > h3 {
    color: var(--rose-900);
    font-size: 1rem;
    font-weight: 700;
  }

  button > span > img {
    width: 20px;
  }
}

.product-card-price {
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
}

.product-card-img-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  position: relative;
}

.product-card-img {
  border-radius: 10px;
  width: 240px;
}

.product-card-add-to-cart {
  padding: 8px 20px;

  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  border-radius: 40px;
  border: 1.5px solid var(--rose-400);
  background-color: var(--rose-50);

  position: absolute;
  bottom: -20px;

  cursor: pointer;
}

.product-card-added {
  background-color: var(--red);
  padding: 8px 20px;
  border-radius: 40px;
  width: 150px;
  gap: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;

  position: absolute;
  bottom: -20px;
  color: var(--rose-50);

  button {
    padding: 3px;
    border-radius: 100%;
    border: 1px solid var(--rose-50);
    background: transparent;
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;

    img {
      width: 100%;
      height: 100%;
    }
  }
}

.cart {
  background-color: var(--rose-50);
  padding: 25px;
  border-radius: 10px;
  width: 380px;

  header {
    color: var(--red);
    font-family: "RedHat Bold", "Franklin Gothic Medium", Arial, sans-serif;
  }
}

.cart-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--rose-500);
  font-weight: 700;
  font-size: 0.8rem;

  img {
    width: 150px;
    padding: 20px;
    margin-top: 20px;
  }

  p {
    margin-bottom: 15px;
  }
}

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

    .item-info {
      font-family: "RedHat Regular", sans-serif;
      font-weight: 700;
      font-size: 0.9rem;

      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;

      .item-name {
        margin-block-end: 0.6rem;
        width: 100%;
      }

      div {
        display: flex;
        justify-content: space-around;
        gap: 0.6rem;

        .quantity {
          color: var(--red);
        }

        .unit-price {
          color: var(--rose-500);
          font-weight: 500;
        }

        .subtotal {
          color: var(--rose-500);
        }
      }
    }

    .remove-item {
      border: 1px solid var(--rose-400);
      border-radius: 100%;
      padding: 1px 3px;
      cursor: pointer;
    }
  }
}

.cart-total-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0px;

  .cart-total-title {
    font-family: "RedHat Regular", sans-serif;
    color: var(--rose-500);
  }

  .cart-total {
    font-family: "RedHat Bold", "Franklin Gothic Medium", Arial, sans-serif;
    font-size: 28px;
  }
}

.cart-enviromental-msg {
  background-color: var(--rose-100);
  padding: 10px;
  font-size: 1rem;
  color: var(--rose-900);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px;

  span {
    font-weight: 600;
  }
}

.cart-list-confirm {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cart-confirm-order {
  margin: auto;
  width: 90%;
  background-color: var(--red);
  color: var(--rose-50);
  border: 0px;
  border-radius: 40px;
  padding: 15px;
  font-family: "RedHat Regular", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}

.cart-modal {
  font-family: "RedHat Bold", "Franklin Gothic Medium", Arial, sans-serif;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35%;
  border: 0px;
  border-radius: 10px;
  padding: 32px;
  margin: 10px;

  img {
    width: 50px;
  }

  .cart-order-list {
    padding: 24px;
    border-radius: 6px 6px 0 0;
    background-color: var(--rose-100);
    display: flex;
    flex-direction: column;
  }

  .cart-total-container {
    background-color: var(--rose-100);
    padding: 10px 24px;
    border-radius: 0 0 6px 6px;
    margin-bottom: 24px;
  }
}

.cart-order-message {
  font-family: "RedHat Regular", sans-serif;
  color: var(--rose-500);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.cart-order-item {
  font-family: "RedHat Regular", sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid hsla(14, 25%, 72%, 0.5);

  .subtotal {
    font-weight: 900;
    color: var(--rose-900);
  }

  .item-image {
    display: flex;
    justify-content: start;
    gap: 12px;
    padding: 10px;

    img {
      border-radius: 6px;
    }

    .item-info {
      font-size: 0.9rem;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;

      .item-name {
        color: var(--rose-900);
        font-weight: 900;
        margin-block-end: 0.6rem;
        width: 100%;
      }

      div {
        display: flex;
        justify-content: space-around;
        gap: 0.6rem;

        .quantity {
          color: var(--red);
        }

        .unit-price {
          color: var(--rose-500);
          font-weight: 500;
        }
      }
    }
  }
}

.order-item-info {
  display: flex;
  flex-direction: column;
}

.order-start-new {
  margin: auto;
  width: 100%;
  background-color: var(--red);
  color: var(--rose-50);
  border: 0px;
  border-radius: 40px;
  padding: 15px;
  font-family: "RedHat Regular", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
}

@media (width >= 768px) and (width <= 1200px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-card-img {
    width: 175px;
  }

  .cart {
    padding: 15px;
    width: 250px;

    .cart-empty {
      margin-bottom: 15px;

      img {
        width: 100px;
        padding: 10px;
        margin-top: 10px;
      }
    }
  }

  .cart-modal {
    width: 80%;
    margin: 0;
  }
}

@media (width <= 767px) {
  .product-grid {
    display: flex;
    flex-direction: column;
  }

  .product-card-img {
    width: 375px;
  }

  .product-list-with-cart {
    flex-direction: column;
    align-items: center;
  }

  .cart-modal {
    width: 100%;
    margin: 0;
  }
}

.hidden {
  display: none;
}

.selected {
  border: 2px solid var(--red);
  border-radius: 10px;
}
