/* Modern & Luxury Bunny Stream Gallery v0.1.2 - compact, clickable video control */
.woocommerce-product-gallery .ml-bunny-stage {
  position: relative !important;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: #f6f6f6;
  overflow: hidden;
}
.woocommerce-product-gallery .ml-bunny-stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) .ml-bunny-play {
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  inset: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  width: max-content !important;
  max-width: calc(100% - 32px) !important;
  height: auto !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 10px 18px !important;
  border: 1px solid rgba(207,174,109,.75) !important;
  border-radius: 999px !important;
  background: rgba(27,25,23,.93) !important;
  color: #fff !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.22) !important;
  font: 700 12px/1.25 inherit !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  transition: background .2s ease, box-shadow .2s ease !important;
}
.woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) .ml-bunny-play:hover,
.woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) .ml-bunny-play:focus-visible {
  background: #a17b37 !important;
  color: #fff !important;
  box-shadow: 0 7px 22px rgba(0,0,0,.27) !important;
}
.woocommerce-product-gallery .ml-bunny-play:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 3px !important;
}
.woocommerce-product-gallery .ml-bunny-play > span:first-child {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 27px !important;
  height: 27px !important;
  flex: 0 0 27px !important;
  border-radius: 50% !important;
  background: #d3b271 !important;
  color: #211b13 !important;
  font-size: 12px !important;
  line-height: 1 !important;
}
.woocommerce-product-gallery .ml-bunny-play > span:last-child {
  display: inline !important;
  color: inherit !important;
  font: inherit !important;
}
.woocommerce-product-gallery .ml-bunny-stage iframe {
  width: 100%; height: 100%; border: 0;
  position: absolute; inset: 0; z-index: 2;
}
.woocommerce-product-gallery .ml-bunny-thumb { position: relative; }
.woocommerce-product-gallery .ml-bunny-thumb::after {
  content: "\25B6";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(28,26,24,.90); color: #fff;
  border: 1px solid rgba(207,174,109,.75);
  border-radius: 50%; width: 34px; height: 34px;
  display: grid; place-items: center; font-size: 12px;
  pointer-events: none;
}
.woocommerce-product-gallery .ml-bunny-stage.ml-bunny-playing > img,
.woocommerce-product-gallery .ml-bunny-stage.ml-bunny-playing > .ml-bunny-play {
  display: none !important;
}
@media (max-width: 480px) {
  .woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) .ml-bunny-play {
    min-height: 42px !important;
    padding: 8px 13px !important;
    font-size: 11px !important;
  }
}

/* v0.1.3: centred red play control, with reliable pointer hit-testing. */
.single-product .woocommerce-product-gallery .ml-bunny-stage {
  position: relative !important;
  width: 100% !important;
  isolation: isolate;
}
.single-product .woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) > .ml-bunny-play {
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  z-index: 999 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: auto !important;
  min-width: 180px !important;
  min-height: 58px !important;
  padding: 12px 22px !important;
  background: #e62117 !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 5px 20px rgba(0,0,0,.25) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: .3px !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) > .ml-bunny-play:hover,
.single-product .woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) > .ml-bunny-play:focus-visible {
  background: #cc181e !important;
  color: #fff !important;
  box-shadow: 0 7px 24px rgba(0,0,0,.32) !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-play > span:first-child {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 22px !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-stage.ml-bunny-playing > img,
.single-product .woocommerce-product-gallery .ml-bunny-stage.ml-bunny-playing > .ml-bunny-play {
  display: none !important;
}
/* Hide the Woodmart expand control only while the ACTIVE video slide is playing. */
.single-product .woocommerce-product-gallery:has(.wd-carousel-item.wd-active .ml-bunny-stage.ml-bunny-playing) .product-additional-galleries {
  display: none !important;
}
@media (max-width: 767px) {
  .single-product .woocommerce-product-gallery .ml-bunny-stage:not(.ml-bunny-playing) > .ml-bunny-play {
    min-width: 155px !important;
    min-height: 50px !important;
    padding: 10px 16px !important;
    font-size: 12px !important;
    gap: 8px !important;
  }
}


/* v0.1.5: permanently pinned video preview; no second video-marked gallery thumbnail. */
.single-product .woocommerce-product-gallery .wd-gallery-thumb.ml-bunny-has-pinned {position:relative!important;padding-left:clamp(66px,17%,100px)!important;min-height:64px}
.single-product .woocommerce-product-gallery .ml-bunny-pinned {position:absolute!important;left:0!important;top:0!important;z-index:15!important;width:clamp(58px,15%,88px)!important;aspect-ratio:1;border:2px solid #e62117!important;border-radius:7px!important;background:#fff!important;padding:0!important;overflow:hidden!important;cursor:pointer!important;display:block!important}
.single-product .woocommerce-product-gallery .ml-bunny-pinned img {width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
.single-product .woocommerce-product-gallery .ml-bunny-pinned-icon {position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:46px!important;height:46px!important;border-radius:50%!important;background:#e62117!important;color:#fff!important;display:grid!important;place-items:center!important;font-size:19px!important;box-shadow:0 2px 9px #0005!important;pointer-events:none!important}
.single-product .woocommerce-product-gallery .ml-bunny-pinned:focus-visible {outline:3px solid #111!important;outline-offset:2px!important}
@media(max-width:767px){.single-product .woocommerce-product-gallery .wd-gallery-thumb.ml-bunny-has-pinned{padding-left:66px!important}.single-product .woocommerce-product-gallery .ml-bunny-pinned{width:58px!important}.single-product .woocommerce-product-gallery .ml-bunny-pinned-icon{width:34px!important;height:34px!important;font-size:14px!important}}

/* v0.1.7 - pinned video tile matches the regular Woodmart thumbnail height. */
.single-product .woocommerce-product-gallery .wd-gallery-thumb.ml-bunny-has-pinned {
  --ml-bunny-tile: clamp(76px, 18%, 110px);
  padding-left: calc(var(--ml-bunny-tile) + 12px) !important;
  min-height: var(--ml-bunny-tile) !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-pinned {
  width: var(--ml-bunny-tile) !important;
  height: var(--ml-bunny-tile) !important;
  top: 0 !important;
  aspect-ratio: 1 / 1 !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-pinned-icon {
  width: 48px !important;
  height: 48px !important;
}
@media (max-width:767px) {
  .single-product .woocommerce-product-gallery .wd-gallery-thumb.ml-bunny-has-pinned {
    --ml-bunny-tile: 70px;
  }
  .single-product .woocommerce-product-gallery .ml-bunny-pinned-icon {
    width: 38px !important;
    height: 38px !important;
  }
}

/* v0.1.8: match the real Woodmart thumbnail image box, not an arbitrary clamp. */
.single-product .woocommerce-product-gallery .wd-gallery-thumb.ml-bunny-has-pinned {
  padding-left: var(--ml-bunny-rail-offset, 122px) !important;
  min-height: var(--ml-bunny-tile-height, 110px) !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-pinned {
  box-sizing: border-box !important;
  width: var(--ml-bunny-tile-width, 110px) !important;
  height: var(--ml-bunny-tile-height, 110px) !important;
  aspect-ratio: 1 / 1 !important;
  top: 0 !important;
  left: 0 !important;
}
.single-product .woocommerce-product-gallery .ml-bunny-pinned > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* v0.1.9: One player in a fixed modal OUTSIDE the Swiper cloneable track. */
body.ml-bunny-modal-open { overflow: hidden !important; }
.ml-bunny-player-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  background: rgba(0,0,0,.96) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 12px !important;
}
.ml-bunny-player-panel {
  position: relative !important;
  width: min(100%, 1100px) !important;
  height: min(85vh, 620px) !important;
  max-height: calc(100dvh - 60px) !important;
  background: #000 !important;
}
.ml-bunny-player-panel iframe {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
}
@media (max-width: 767px) {
  .ml-bunny-player-overlay { padding: 4px !important; }
  .ml-bunny-player-panel { width: 100% !important; height: min(72vh, 70vw) !important; }
}

/* v0.2.0: full-viewport video, including native fullscreen when allowed. */
.ml-bunny-player-overlay { padding: 0 !important; }
.ml-bunny-player-panel {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.ml-bunny-player-panel iframe { width: 100% !important; height: 100% !important; }
@media (max-width: 767px) {
  .ml-bunny-player-overlay { padding: 0 !important; }
  .ml-bunny-player-panel { width: 100% !important; height: 100% !important; }
}

/* v0.2.1: no custom Close Video control; Bunny retains its own native UI. */

/* v0.2.3: responsive mobile/tablet exit control; desktop remains unchanged. */
.ml-bunny-player-overlay .ml-bunny-mobile-close {
  display: none !important;
}
@media (max-width: 1024px), (pointer: coarse) {
  .ml-bunny-player-overlay .ml-bunny-mobile-close {
    display: grid !important;
    place-items: center !important;
    position: absolute !important;
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 12px) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.72) !important;
    color: white !important;
    font: 400 30px/1 Arial,sans-serif !important;
    cursor: pointer !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    padding: 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.3) !important;
  }
  .ml-bunny-player-overlay .ml-bunny-mobile-close:focus-visible {
    outline: 2px solid #fff !important; outline-offset: 3px !important;
  }
}

/* v0.2.4: The X is a fallback only; native fullscreen controls take precedence.
   iOS native video UI is outside the page and naturally covers this overlay.
   WebKit events are best-effort for a cross-origin embedded player. */
.ml-bunny-player-overlay.ml-bunny-native-controls .ml-bunny-mobile-close {
  display: none !important;
}
@media (max-width: 1024px), (pointer: coarse) {
  .ml-bunny-player-overlay:not(.ml-bunny-native-controls) .ml-bunny-mobile-close {
    touch-action: manipulation !important;
  }
}
