/**
 * Audioengine – Gallery additions for WVG Pro
 * APPEND these rules to your existing: yourtheme/assets/css/single-product.css
 *
 * (Or paste at the bottom of the file — all selectors are scoped to .ae-product-gallery)
 */

/* ─────────────────────────────────────────────────────────────────────────
   VIDEO SLIDES
───────────────────────────────────────────────────────────────────────── */

.ae-video-slide-wrap {
  position: relative;
  width: 100%;
  /* 1:1 ratio by default (matches WVG's video_ratio: "1 / 1") */
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

/* Self-hosted <video> */
.ae-video-slide__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* YouTube / iframe embed */
.ae-video-slide__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Hide zoom button when a video slide is active */
.ae-gallery-slide.is-video-slide ~ .ae-gallery__zoom-trigger,
.ae-product-gallery:has(.ae-gallery-slide.is-active.is-video-slide) .ae-gallery__zoom-trigger {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   VIDEO THUMBNAILS
───────────────────────────────────────────────────────────────────────── */

.ae-gallery-thumb.is-video-thumb {
  position: relative;
}

.ae-gallery-thumb__video-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

/* Dark overlay on video thumbnails */
.ae-gallery-thumb__video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  pointer-events: none;
}

/* Play icon centred over thumbnail */
.ae-gallery-thumb__play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}

/* ─────────────────────────────────────────────────────────────────────────
   GALLERY TRANSITIONS (smooth slide fade)
───────────────────────────────────────────────────────────────────────── */

.ae-gallery-slide {
  opacity: 0;
  transition: opacity 0.25s ease;
  position: absolute;
  inset: 0;
  /* Override display:none from original CSS – use opacity + pointer-events */
  display: block !important;
  pointer-events: none;
}

.ae-gallery-slide.is-active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

/* Ensure the slider wrapper has correct height from the active slide */
.ae-product-gallery__main-slider {
  position: relative;
  /* Let the active slide dictate height */
  min-height: 300px;
}

/* ─────────────────────────────────────────────────────────────────────────
   THUMBNAIL STRIP — scrollbar styling
───────────────────────────────────────────────────────────────────────── */

.ae-product-gallery__thumbnails {
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.ae-product-gallery__thumbnails::-webkit-scrollbar {
  height: 4px;
}

.ae-product-gallery__thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.ae-product-gallery__thumbnails::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   GALLERY ARROWS — updated SVG version
───────────────────────────────────────────────────────────────────────── */

.ae-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s, box-shadow 0.2s;
  padding: 0;
  color: #333;
}

.ae-gallery__arrow:hover {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.ae-gallery__arrow[hidden] {
  display: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .ae-video-slide-wrap {
    aspect-ratio: 16 / 9; /* More natural on mobile */
  }

  .ae-gallery__arrow {
    width: 34px;
    height: 34px;
  }
}
