body {
  margin: 0;
  background-color: #f8f9fa;
}

.collection-section {
  padding: 70px 160px;
  text-align: center;
  background-color: #fff;
}

.collection-heading {
  font-size: 2rem;
  margin-bottom: 40px;
  color: #f47400;
  text-transform: uppercase;
}

/* Grid Styling */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  padding: 0 20px;
}

/* Cube Container */
.collection-cube {
  perspective: 1200px;
  height: 320px;
}

.cube-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.collection-cube:hover .cube-inner {
  transform: rotateY(180deg);
}

/* Front & Back */
.cube-front,
.cube-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cube-front img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
}

.cube-front p {
  font-weight: 600;
  font-size: 1rem;
  color: #222;
}

.cube-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #f47400, #ffb366);
  color: white;
}

.cube-back p {
  margin-bottom: 20px;
  font-size: 1rem;
  text-align: center;
}

.view-btn {
  background: #fff;
  color: #f47400;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s ease;
}

.view-btn:hover {
  background: #333;
  color: #fff;
}




/* ==========RESPONSIVE==================== */
@media (max-width:350px) {
  .cube-front {
    perspective: 1200px;
    height: 300px;
  }

}

@media (max-width:740px) {

  .collection-section {
    padding: 40px 40px;
    text-align: center;
    background-color: #fff;
  }

  .collection-heading {
    font-size: 1rem;
    text-transform: uppercase;
  }

  .collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 6fr));
    gap: 40px;
    padding: 0 0px;
    justify-content: center;
  }

  .collection-cube {
    perspective: 1200px;
    height: 400px!important;
  }
  .cube-inner {
    position: relative;
    width: 100%;
    height: 80%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
}

@media (max-width:1024px) {
  .collection-section {
    padding: 70px 70px;
    text-align: center;
    background-color: #fff;
  }

  .cube-front p {
    font-size: 1.5rem;
  }
   .cube-back {
    height:80%;
  }

  .collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 6fr));
    gap: 40px!important;
    padding: 0 0px;
  }

  .collection-cube {
    perspective: 1200px;
    height: 450px;
  }
}

@media (max-width:1050px) {
 .cube-front {
    perspective: 1200px;
    height: 350px;
  }
   .cube-back {
    height: 100%;;
  }
}
@media only screen 
  and (min-device-width: 912px) 
  and (max-device-width: 1368px) 
  and (orientation: portrait) {
   .cube-front {
    perspective: 1200px;
    height: 385px;
  }
}

/* 📱 Fix for devices like 540px–720px (e.g., some tablets/phones in portrait) */
@media only screen 
  and (min-device-width: 540px) 
  and (max-device-width: 720px) 
  and (orientation: portrait) {
    
    .cube-front {
    perspective: 1200px;
    height: 415px;
  }
  .collection-section {
    padding: 30px 20px;
  }

  .collection-heading {
    font-size: 1.2rem;
    margin-bottom: 25px;
  }

  .collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 🔥 Always 2 cards per row */
    gap: 20px;
    padding: 0 10px;
    justify-content: center;
  }

  .collection-cube {
    height: 360px; /* balanced card height */
  }

  .cube-front p {
    font-size: 1rem;
  }

  .cube-back p {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
}
  



@media (max-width:1368px) {
  .collection-section {
    padding: 70px 120px;
    text-align: center;
    background-color: #fff;
  }

  .cube-front p {
    font-size: 1.5rem;
  }
   .cube-back {
    height:100%;
  }

  .collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
    padding: 0 0px;
  }

  .collection-cube {
    perspective: 1200px;
    height: 450px;
  }
}

@media (max-width:885px) {

  .collection-section {
    padding: 40px 40px;
    text-align: center;
    background-color: #fff;
  }

  .collection-heading {
    font-size: 1.5rem;
    text-transform: uppercase;
  }

  .cube-front p {
    font-size: 1.3rem;
  }
}

@media (max-width:1280px) {
  .collection-section {
    padding: 70px 70px;
    text-align: center;
    background-color: #fff;
  }

  .cube-front p {
    font-size: 1rem;
  }

  
}

