#products {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  text-align: center;
}

#products h1 {
  font-size: 3rem;
  text-transform: uppercase;
  font-weight: 700;
  color: white;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#products canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  background: transparent;
}

.product-list {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  gap: 20px;
  justify-content: center;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.product {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 300px;
  height: 600px;
  background-color: rgba(7, 17, 46, 0.8);
  color: white;
  display: flex;
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease-in-out;
  overflow: hidden;
  flex-direction: column;
}

.product:hover {
  flex: 2;
  max-width: 100%;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
}

.product-header {
  font-size: 1rem;
  font-weight: bold;
  position: absolute;
  writing-mode: vertical-rl;
  rotate: 180deg;
  top: 50%;
  left: 50%;
  transform: translate(50%, 50%);
  transition: opacity 0.5s ease-in-out;
}

.product-content {
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  width: 100%;
  height: 100%;
}

.product:hover .product-content {
  opacity: 1;
  visibility: visible;
}

.product:hover .product-header {
  opacity: 0;
}

.product-content img {
  width: 50%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px 0 0 10px;
  padding: 10px;
}

.product-text {
  width: 50%;
  padding: 20px;
  text-align: left;
}

.product-text h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #ffffff;
  font-weight: 600;
}

.product-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.explore-mobile {
  background: #8FCB9B;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 15px;
  display: inline-block;
  white-space: nowrap;
  /* 👈 prevents text breaking into two lines */
  transition: all 0.3s ease;
}


.explore-mobile:hover {
  background: #7bb887;
}





@media (max-width: 768px) {
  .explore-mobile {
    font-size: 0.9rem;
  }

  #products {
    min-height: 80vh;
    padding: 30px 20px;
  }

  #products h1 {
    font-size: 2rem;
    margin-bottom: 80px;
  }

  .product-list {
    flex-direction: column;
    width: 100%;
    gap: 30px;
    height: auto;
  }

  .product {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 120px;
    max-width: 100%;
    height: auto;
    transition: all 0.5s ease-in-out;
    justify-content: center;
  }

  .product-header {
    writing-mode: horizontal-tb !important;
    rotate: 0deg !important;
    position: static !important;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    width: 100%;
    text-align: center;
    display: block;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    padding: 0;
    margin: 0;

    transition: opacity 0.3s ease-in-out;
  }

  .product-header h2 {
    font-size: 1.3rem;
    margin: 0;
  }

  .product-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: all 0.5s ease-in-out;
  }

  .product.expand {
    height: auto;
    min-height: 330px;
    padding-top: 0 !important;

  }

  .product.expand .product-header {
    opacity: 1;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  .product.expand .product-content {
    opacity: 1;
    height: auto;
    max-height: 1000px;
    visibility: visible;
    padding: 0px;
  }

  .product-content img {
    width: 100%;
    max-height: 180px;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
  }

  .product-text {
    width: 100%;
    padding: 0;
    text-align: center;
  }

  .product-text p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
  }

  .product:not(.expand) .product-content {
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
  }

  .product:not(.expand) .product-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .product:not(.expand) {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}