/* ========================================================
   Divi 3D Carousel Plugin Styles
   Author: Youfy Rizqy Fawzy
   Description: Base, layout, and effect-specific styles
   ======================================================== */

.et_pb_3d_carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  --aspect-width: 16;
  --aspect-height: 9;
  --bullet-color: #ccc;
  --bullet-active-color: #333;
  --bullet-size: 10px;
  --arrow-color: #fff;
  --arrow-bg-color: rgba(0, 0, 0, 0.5);
  --arrow-size: 40px;
}

.et_pb_3d_carousel .swiper {
  position: relative;
  width: 100%;
}

.et_pb_3d_carousel .swiper-wrapper {
  display: flex;
}

.et_pb_3d_carousel .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.et_pb_3d_carousel .swiper-slide::before {
  content: '';
  display: block;
  padding-top: calc(100% / (var(--aspect-width) / var(--aspect-height)));
  flex-shrink: 0;
}

.et_pb_3d_carousel .swiper-slide img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: transform 0.3s ease;
}

.et_pb_3d_carousel .swiper-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.et_pb_3d_carousel .swiper-pagination {
  position: absolute;
  bottom: 15px;
  width: 100%;
  text-align: center;
  z-index: 20;
}

.swiper-pagination-bullet {
  width: var(--bullet-size);
  height: var(--bullet-size);
  background: var(--bullet-color);
  border-radius: 50%;
  display: inline-block;
  margin: 0 5px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background: var(--bullet-active-color);
  opacity: 1;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--arrow-color);
  background: var(--arrow-bg-color);
  width: var(--arrow-size);
  height: var(--arrow-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 30;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.8);
}

.swiper-button-next {
  right: 10px;
}

.swiper-button-prev {
  left: 10px;
}

.et_pb_3d_carousel.preview {
  padding: 20px;
  background: #f9f9f9;
  text-align: center;
  border: 1px dashed #ccc;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .swiper-button-next,
  .swiper-button-prev {
    width: 30px;
    height: 30px;
  }

  .swiper-pagination {
    bottom: 10px;
  }
}

/* === Flip & Cube Swiper Effects — Scoped Fix === */
.et_pb_3d_carousel .swiper.flip,
.et_pb_3d_carousel .swiper.cube {
  perspective: 1200px;
  overflow: visible;
}

.et_pb_3d_carousel .swiper.flip .swiper-slide,
.et_pb_3d_carousel .swiper.cube .swiper-slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  overflow: visible;
  padding-top: 0 !important;
  height: auto;
}

.et_pb_3d_carousel .swiper.flip .swiper-slide::before,
.et_pb_3d_carousel .swiper.cube .swiper-slide::before {
  display: none;
}

.et_pb_3d_carousel .swiper.flip .swiper-slide img,
.et_pb_3d_carousel .swiper.cube .swiper-slide img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: var(--aspect-width) / var(--aspect-height);
  object-fit: cover;
  border-radius: 0.5rem;
  backface-visibility: hidden;
}
