/* Main Container */
.mg-3d-carousel-container {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: hidden;
  touch-action: none;
  margin: 0 auto;
  perspective: 1200px;
  min-height: 500px;
  
}

/* Reflection Effect */
.mg-3d-reflection {
  position: absolute;
  bottom: -15%;
  left: 50%;
  width: 120%;
  height: 150px;
  transform: translateX(-50%) perspective(1000px) rotateX(80deg) scaleY(0.6);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 30%,
    transparent 100%
  );
  backdrop-filter: blur(12px);
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.6) 30%,
    rgba(0, 0, 0, 0) 100%
  );
  border-radius: 50%;
  z-index: 2;
  opacity: 0.8;
  animation: reflection-glow 4s ease-in-out infinite;
  box-shadow: 0 4px 10px #ffffff00;
  pointer-events: none;
}

@keyframes reflection-glow {
  0%, 100% {
    opacity: 0.4;
    transform: translateX(-50%) perspective(1000px) rotateX(80deg) scaleY(0.6) scaleX(1);
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) perspective(1000px) rotateX(80deg) scaleY(0.6) scaleX(1.05);
  }

}

/* Carousel Elements */
.mg-drag-container,
.mg-spin-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(5deg);
  width: 90%;
  height: 90%;
}

.mg-3d-item {
  position: absolute;
  width: 100%;
  height: 100%;
  min-width: 25px;
  min-height: 25px;
  max-width: 250px;
  max-height: 250px;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center center;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.mg-3d-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  transition: transform 0.3s ease, filter 0.3s ease;
  position: absolute;
  transform-origin: center;
  transform-style: preserve-3d;
  -webkit-box-reflect: below 0px linear-gradient(to bottom ,transparent 65%, rgba(0, 0, 0, 0.4));
}

.mg-3d-item:hover img {
  transform: scale(1.4);
  -webkit-box-reflect: below 0px linear-gradient(to bottom ,transparent 65%, rgba(0, 0, 0, 0.705));}

/* Responsive Design */
@media (max-width: 768px) {
  .mg-3d-carousel-container {
    height: 50vh;
    perspective: 1700px;
    min-height: 400px;
    transform: scale(0.9);
  }

  .mg-3d-item {
    max-width: 150px;
    max-height: 180px;
    transform: scale(0.9);

  }

  .mg-3d-reflection {
    bottom: -12%;
    height: 120px;
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 480px) {
  .mg-3d-carousel-container {
    height: 57vh;
    min-height: 300px;
  }

  .mg-3d-item {
    max-width: 100px;
    max-height: 100px;
  }

  .mg-3d-reflection {
    bottom: -10%;
    height: 100px;
  }
}


/* =========================
   Lightbox
========================= */
.mg-3d-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.mg-3d-lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* =========================
   Lightbox Controls
========================= */
.mg-3d-lightbox-prev,
.mg-3d-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 0;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  line-height: 1;
}

.mg-3d-lightbox-prev:hover,
.mg-3d-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mg-3d-lightbox-prev {
  left: 20px;
}

.mg-3d-lightbox-next {
  right: 20px;
}

.mg-3d-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  line-height: 1;
}

.mg-3d-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive Lightbox */
@media (max-width: 768px) {
  .mg-3d-lightbox-prev,
  .mg-3d-lightbox-next,
  .mg-3d-lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .mg-3d-lightbox-prev {
    left: 10px;
  }

  .mg-3d-lightbox-next {
    right: 10px;
  }

  .mg-3d-lightbox-close {
    top: 10px;
    right: 10px;
  }

  .mg-3d-lightbox-image {
    max-width: 95%;
    max-height: 85vh;
  }
}
