/* ==========================================================================
   Shopify-Style High-Performance Inline Autoplay Video System
   Features:
   - Zero-lag inline autoplay (muted, loop, playsinline, preload="metadata")
   - Responsive aspect-ratios (16:9, 4:5 vertical reels, 1:1)
   - Sleek glassmorphic Sound Toggle Pill (Mute / Unmute)
   - Play/Pause toggle on tap with micro-animations
   - 60 FPS buttery smooth scrolling with IntersectionObserver CPU saving
   ========================================================================== */

.shopify-video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.shopify-video-wrap.aspect-16-9 {
  aspect-ratio: 16 / 9;
}

.shopify-video-wrap.aspect-4-5 {
  aspect-ratio: 4 / 5;
}

.shopify-video-wrap.aspect-reel {
  aspect-ratio: 9 / 16;
}

.shopify-video-elem {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.shopify-video-wrap:hover .shopify-video-elem {
  transform: scale(1.025);
}

/* Subtle Gradient Shadow Overlay at Bottom */
.shopify-video-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 35%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 2;
  transition: opacity 0.3s ease;
}

/* Floating Live Reel Badge */
.shopify-video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.shopify-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: shopifyPulse 1.8s infinite;
}

.shopify-live-dot.pink {
  background: #FF2A85;
  box-shadow: 0 0 8px #FF2A85;
}

@keyframes shopifyPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Floating Audio / Sound Toggle Pill */
.shopify-audio-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  padding: 0;
}

.shopify-audio-btn:hover {
  background: #FF2A85;
  border-color: #FF2A85;
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(255, 42, 133, 0.45);
}

.shopify-audio-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.shopify-audio-btn .icon-unmuted {
  display: none;
}

.shopify-audio-btn.is-unmuted {
  background: #10B981;
  border-color: #10B981;
}

.shopify-audio-btn.is-unmuted .icon-muted {
  display: none;
}

.shopify-audio-btn.is-unmuted .icon-unmuted {
  display: block;
}

/* Pause Flash Indicator (Taps) */
.shopify-play-indicator {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.shopify-video-wrap.is-paused .shopify-play-indicator {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox Trigger Icon (Optional top-right) */
.shopify-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

.shopify-video-wrap:hover .shopify-expand-btn {
  opacity: 1;
}

.shopify-expand-btn:hover {
  background: #2563EB;
  border-color: #2563EB;
  transform: scale(1.1);
}

/* Reduce Motion Media Query for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .shopify-video-elem {
    transition: none !important;
    transform: none !important;
  }
  .shopify-live-dot {
    animation: none !important;
  }
}
