.main-container {
  width: 100%;
  height: max-content;
  justify-content: center;
  display: flex;
  flex-direction: column;
  padding-top: 50px;
  margin-bottom: 50px;
}

.topic-container p {
  font-size: xxx-large;
  color: black;
  font-weight: bold;
  text-align: right;
  margin: 50px;
}

.grid-container {
  display: grid;

  justify-items: center;
  /* grid-template-columns: repeat(4,1fr); */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-row-gap: 70px;
  padding-inline: 110px;
  /* Does nothing on its own for layout, but we keep it */
  transition: padding 0.3s ease, gap 0.3s ease;
  /* make items in each row have the same height */
  grid-auto-rows: 1fr;
  height: min-content;
}
/* The trick: animate the children */
.grid-container > * {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.grid-item-container {
  background-color: var(--lightGray-color);
  height: max-content;
  width: min-content;
  border-radius: 15px;
  direction: rtl;
  max-width: 270px;
  cursor: pointer;
  justify-content: center;
  flex-direction: column;
  padding: 10px;
  padding-inline: 20px;
  padding-top: 20px;
  align-items: end;
}
.grid-item-container img {
  margin: 20px;
  justify-content: center;
}
.item-image {
  position: relative;
  display: block;
  width: 220px;
  aspect-ratio: 1/1;
  justify-content: center;
  object-fit: fill;
  scale: 1/1;
}
.item-image img {
  width: 220px;
  aspect-ratio: 1/1;
  justify-content: center;
  object-fit: fill;
  scale: 1/1;
  border-radius: 15px;
}

.item-name {
  color: black;
  width: 100%;
  text-align: right;
  font-family: "Koodak";
  font-weight: bold;
  word-break: normal;
  max-width: 250px;
  white-space: normal;
  overflow: visible;
  display: block;
  margin-right: 0;
}
.item-price-container {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: min-content;
}
.item-price {
  color: black;
  font-weight: bold;
  font-family: "Koodak";
  font-size: larger;
  text-align: right;
  margin-right: 0;
  width: 100%;
}
.item-discount {
  color: var(--gray-color);
  text-decoration: line-through;
  font-size: large;
  text-align: right;
  margin-right: 0;
}
.category-container p {
  cursor: pointer;
  color: var(--primary-color);
  font-size: medium;
  margin-inline: 5px;
}

/* Badge */
.discount-badge {
  top: 5px;
  left: 5px;
  background: linear-gradient(135deg, #ff0000, #ffdd03);
  color: white;
  width: max-content;
  padding: 6px 10px;
  font-size: medium;
  font-weight: 700;
  align-items: center;
  text-align: center;
  display: flex;
  position: absolute;
  user-select: none;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(255, 60, 60, 0.45);

  animation: pulse 1.6s infinite ease-in-out;
}

/* Pulse animation */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 14px rgba(255, 60, 60, 0.45);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 10px 22px rgba(255, 60, 60, 0.65);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 14px rgba(255, 60, 60, 0.45);
  }
}

.item-buy {
  background-color: var(--onPrimary-color);
  border: none;
  aspect-ratio: 2/1;
  height: 35px;
  color: white;
  font-family: "Koodak";
  font-size: large;
  border-radius: 10px;
  text-align: center;
}

.item-buy button {
  background-color: var(--onPrimary-color);
  border: none;
  aspect-ratio: 2/1;
  height: 50px;
  color: white;
  font-family: "Koodak";
  font-size: larger;
  border-radius: 15px;
  text-align: center;
}
.button-container {
  display: flex;
  justify-content: center;
  margin-top: 50px;
}
.page-button {
  background-color: var(--onPrimary-color);
  color: white;
  font-size: large;
  padding: 10px;
  padding-inline: 50px;
  border: none;
  border-radius: 10px;
  margin-inline: 50px;
  cursor: pointer;
}

@media only screen and (max-width: 768px) {
  .main-container {
    width: 100%;
    height: max-content;
    justify-content: center;
    display: flex;
    flex-direction: column;
    padding-top: 50px;
    margin-bottom: 50px;
  }

  .topic-container p {
    font-size: x-large;
    color: black;
    font-weight: bold;
    text-align: right;
    margin: 50px;
    margin-top: 0px;
  }

  .grid-container {
    display: grid;

    justify-items: center;
    /* grid-template-columns: repeat(4,1fr); */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-row-gap: 70px;
    padding-inline: 0px;
    /* Does nothing on its own for layout, but we keep it */
    transition: padding 0.3s ease, gap 0.3s ease;
    /* make items in each row have the same height */
    grid-auto-rows: 1fr;
    height: min-content;
    width: 100%;
  }
  /* The trick: animate the children */
  .grid-container > * {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .grid-item-container {
    background-color: var(--lightGray-color);
    height: max-content;
    width: min-content;
    border-radius: 15px;
    direction: rtl;
    max-width: 270px;
    cursor: pointer;
    justify-content: center;
    flex-direction: column;
    padding: 10px;
    padding-inline: 20px;
    padding-top: 20px;
    align-items: end;
  }
  .grid-item-container img {
    margin: 20px;
    justify-content: center;
  }
  .item-image {
    position: relative;
    display: block;
    width: 220px;
    aspect-ratio: 1/1;
    justify-content: center;
    object-fit: fill;
    scale: 1/1;
  }
  .item-image img {
    width: 220px;
    aspect-ratio: 1/1;
    justify-content: center;
    object-fit: fill;
    scale: 1/1;
    border-radius: 15px;
  }

  .item-name {
    color: black;
    width: 100%;
    text-align: right;
    font-family: "Koodak";
    font-weight: bold;
    word-break: normal;
    max-width: 250px;
    white-space: normal;
    overflow: visible;
    display: block;
    margin-right: 0;
  }
  .item-price-container {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: min-content;
  }
  .item-price {
    color: black;
    font-weight: bold;
    font-family: "Koodak";
    font-size: larger;
    text-align: right;
    margin-right: 0;
    width: 100%;
  }
  .item-discount {
    color: var(--gray-color);
    text-decoration: line-through;
    font-size: large;
    text-align: right;
    margin-right: 0;
  }
  .category-container p {
    cursor: pointer;
    color: var(--primary-color);
    font-size: medium;
    margin-inline: 5px;
  }

  .item-buy {
    background-color: var(--onPrimary-color);
    border: none;
    aspect-ratio: 2/1;
    height: 35px;
    color: white;
    font-family: "Koodak";
    font-size: large;
    border-radius: 10px;
    text-align: center;
  }

  .item-buy button {
    background-color: var(--onPrimary-color);
    border: none;
    aspect-ratio: 2/1;
    height: 50px;
    color: white;
    font-family: "Koodak";
    font-size: larger;
    border-radius: 15px;
    text-align: center;
  }
  .button-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
  }
  .page-button {
    background-color: var(--onPrimary-color);
    color: white;
    font-size: large;
    padding: 10px;
    padding-inline: 50px;
    border: none;
    border-radius: 10px;
    margin-inline: 50px;
    cursor: pointer;
  }
}
