@import url("https://fonts.googleapis.com/css2?family=Lexend+Giga:wght@100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", serif;
}

body {
  background-color: #f1f3f4;
}

main {
  margin-top: 100px;
}

.background-banner {
  width: 100%;
  height: 500px;
  /* Adjust height as needed */
  position: relative;
  overflow: hidden;
}

/* Layer for background transition effect */
.background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: opacity 1.5s ease-in-out;
}

/* Hide old image while fading in new one */
.fade-out {
  opacity: 0;
}

/* display data */
#product-section {
  margin: 40px auto;
}

#single-product-div {
  width: calc(250px);
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
  background-color: #f9fbfc;
  height: fit-content;
  border-radius: 5px;
  cursor: pointer;
}

#product-image-div > img {
  width: 250px;
  background-color: #e2e8ed;
}

#product-brand {
  font-size: 13px;
  color: #bfbfc1;
  font-weight: bold;
  padding: 5px 0px 5px 10px;
}

#product-brand + h3 {
  font-weight: bold;
  padding: 0 10px 10px;
}

#item-price-rate {
  display: flex;
  justify-content: space-between;
  padding: 0px 10px 10px;
}

/* category */
#category-section {
  width: fit-content;
  position: absolute;
  top: 500px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 10px 20px 20px;
  background-color: rgb(255, 255, 255);
  border-radius: 20px;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

.category-header > p {
  color: #2a977b;
  font-weight: bold;
}

.category-list-div {
  display: flex;
  justify-content: space-around;
  margin: auto;
  gap: 50px;
}

.category-list-div div {
  padding: 0.5rem;
  border: 1px solid rgb(213, 211, 211);
  justify-items: center;
  border-radius: 10px;
  cursor: pointer;
}

.category-list-div div > img {
  padding: 10px 0px 0px 0px;
  width: 80px;
  object-fit: cover;
}

.category-list-div div > p {
  text-align: center;
  font-size: 14px;
  padding: auto 20px;
}

/* product-section */

#product-section {
  width: 90%;
  margin: 50px auto;
  padding: 10px 20px 40px;
  background-color: white;
  border-radius: 20px;
  height: fit-content;
  box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 0px;
  margin-bottom: 1rem;
}

.product-header > p {
  color: #2a977b;
  font-weight: bold;
}

.product-list-div {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  justify-items: center;
}

.product-list-div > div {
  width: 240px;
  justify-items: center;
  border: 1px solid rgb(213, 211, 211);
  cursor: pointer;
  border-radius: 10px;
}

.product-list-div div > img {
  width: 240px;
  border-radius: 10px;
  background-color: #e9eff4;
}

#item-category {
  font-size: 14px;
  color: #bfbfc1;
  font-weight: bold;
}

#item-category + h3 {
  font-weight: bold;
  font-size: 16px;
  padding: 0px 10px;
}

#price-rating {
  display: flex;
  gap: 100px;
  padding: 10px 0px;
}

#price {
  color: #2a977b;
  font-weight: bold;
}

#rate {
  color: #bfbec1;
  font-size: 16px;
}

#rate > i {
  color: #eda042;
}

/* category within sections */
#categories-section {
  margin: 2rem 0;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 10px;
}

.categories-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5vw;
}

.category-box {
  width: 120px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: 10px;
  color: #f8f7f7;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-box:hover {
  transform: scale(1.01);
  background-color: #d0d0d0;
}

@media (max-width: 1500px) {
  .product-list-div {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 1260px) {
  main {
    margin-top: 2rem;
  }

  #category-section {
    top: 375px;
    margin: 1rem auto;
    width: calc(100% - 3rem);
  }
  .category-list-div {
    gap: 2rem;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  #product-section {
    padding: 1rem;
    margin: 1rem auto;
  }
}
