.beon-carousel-container {
  width: 100vw;
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  justify-content: center;
  padding: 10px 0;
  margin-top: 0;
  margin-bottom: 90px;
  overflow: visible;
  perspective: 2000px;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.5s ease-in;
}

.beon-carousel-container.beon-loading {
  opacity: 0;
}

.beon-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--block-width, 100%);
  height: var(--block-height, 300px);
  /* Exact card height */
  position: relative;
  transform-style: preserve-3d;
  margin: 0 auto;
  transition: transform 1s ease-out;
}

.beon-carousel .gallery {
  width: var(--card-width, 200px);
  height: var(--card-height, 300px);
  position: relative;
  transform-style: preserve-3d;
  animation: spin var(--carousel-speed, 30s) linear infinite;
}

.beon-carousel .gallery:hover {
  animation-play-state: paused;
}

@keyframes spin {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}

.beon-carousel .gallery .card {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  border-radius: var(--border-radius, 12px);
}

/* Cross-browser Reflection */
.beon-carousel .gallery .card .reflection {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 50%;
  /* Shortened reflection */
  /* No transform on container to avoid stacking issues */
  opacity: var(--reflection-opacity, 0.3);
  pointer-events: none;
  /* Fade out gradient mask */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.beon-carousel .gallery .card .reflection img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius, 12px);
  border: none;
  box-shadow: none;
  object-position: bottom;
  transform: scaleY(-1);
  /* Flip the image for reflection */
}

.beon-carousel .gallery .card>img.beon-slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius, 12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: pointer;
  border: 2px solid white;
  backface-visibility: hidden;
}

.beon-carousel .gallery .card:hover {
  transform: scale(1.1) translateZ(20px);
  z-index: 10;
}

/* Overlay styles (hidden by default) */
.beon-slide-overlay {
  display: none;
}

/* Lightbox Styles */
.beon-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.beon-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.beon-lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  /* box-shadow removed from here to avoid muddy reflection */
  border-radius: 8px;
  overflow: visible;
}

.beon-lightbox img.beon-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  /* Shadow moved to image */
}

.beon-lightbox-reflection {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 15%;
  margin-top: 15px;
  pointer-events: none;
  opacity: var(--reflection-opacity, 0.3);
  z-index: 1;
  /* Fade out earlier (80%) to avoid hard edge at bottom */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
}

.beon-lightbox-reflection img.beon-lightbox-reflection-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
  transform: scaleY(-1);
  border-radius: 8px;
  display: block;
  box-shadow: none;
  /* Ensure no shadow on reflection */
}

.beon-lightbox-close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: white;
  font-size: 30px;
  background: #23237a;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.3s;
}

.beon-lightbox-button:hover {
  background: #1a1a5c;
  color: #fff;
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  .beon-carousel .gallery {
    width: 140px;
    height: 210px;
  }
}