.magicmirror-content-gallery {
  display: grid;
  grid-template-columns: repeat(var(--mm-gallery-columns, 2), minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 3px;
  width: 100%;
}

.magicmirror-content-gallery__item {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #1D1D1B;
}

.magicmirror-content-gallery__image,
.magicmirror-content-gallery__item video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
}

.magicmirror-content-gallery__item--image {
  cursor: zoom-in;
}

.magicmirror-content-gallery__item--image:focus-visible {
  outline: 2px solid #D9D2CB;
  outline-offset: -4px;
}

.magicmirror-content-gallery__item--image .magicmirror-content-gallery__image {
  transform: scale(1.12);
  transition: transform 650ms cubic-bezier(.22, 1, .36, 1);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .magicmirror-content-gallery__item--image:is(:hover, :focus-visible) .magicmirror-content-gallery__image {
    transform: perspective(1100px)
      translate3d(var(--mm-gallery-x, 0px), var(--mm-gallery-y, 0px), 0)
      rotateX(var(--mm-gallery-rx, 0deg)) rotateY(var(--mm-gallery-ry, 0deg))
      scale(1.045);
    transition-duration: 300ms;
  }
}

@media (max-width: 767px) {
  .magicmirror-content-gallery {
    grid-template-columns: repeat(var(--mm-gallery-tablet-columns, 2), minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .magicmirror-content-gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .magicmirror-content-gallery__item--image .magicmirror-content-gallery__image {
    transform: none;
    transition: none;
  }
}

/* Match the product gallery's caption-free Elementor slideshow. */
.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-slideshow__footer {
  display: none !important;
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-swiper-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lightbox-ui-color, #fff);
  cursor: pointer;
  z-index: 3;
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-swiper-button-prev {
  left: clamp(8px, 2vw, 24px);
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-swiper-button-next {
  right: clamp(8px, 2vw, 24px);
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-swiper-button :is(svg, i) {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  fill: currentColor;
  font-size: 24px;
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .swiper:not(.elementor-slideshow--zoom-mode) > .elementor-swiper-button {
  opacity: 1;
}

.elementor-lightbox[id^="elementor-lightbox-slideshow-mm-content-gallery-"] .elementor-swiper-button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
