/* KWM Product Gallery 1.4.2 — fast, touch-first WooCommerce gallery */
.kwm-product-gallery {
  --kwm-pg-accent-color: #111827;
  --kwm-pg-thumbnail-radius: 14px;
  --kwm-pg-zoom-scale: 2.2;
  --kwm-pg-mobile-thumb-size: 72px;
  --kwm-pg-zoom-x: 50%;
  --kwm-pg-zoom-y: 50%;
  --kwm-pg-drag-x: 0px;
  --kwm-pg-border: #e5e7eb;
  --kwm-pg-surface: #ffffff;
  --kwm-pg-soft: #f8fafc;
  --kwm-pg-text: #111827;
  width: 100%;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.kwm-product-gallery,
.kwm-product-gallery *,
.kwm-product-gallery *::before,
.kwm-product-gallery *::after,
.kwm-gallery-lightbox,
.kwm-gallery-lightbox *,
.kwm-gallery-lightbox *::before,
.kwm-gallery-lightbox *::after {
  box-sizing: border-box;
}

.kwm-product-gallery__stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--kwm-pg-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255,255,255,.96), rgba(248,250,252,.76) 62%, rgba(241,245,249,.92)),
    var(--kwm-pg-soft);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .07);
  touch-action: pan-y;
  cursor: grab;
}

.kwm-product-gallery__stage:active { cursor: grabbing; }

/* Keep long-press reserved for KWM zoom and block native image menus/callouts. */
.kwm-product-gallery img,
.kwm-gallery-lightbox img {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
}

.kwm-product-gallery__main-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: transparent;
  text-decoration: none;
  cursor: zoom-in;
}

.kwm-product-gallery__main-link--empty { cursor: default; }

.kwm-product-gallery__main-image,
.kwm-product-gallery__main-link > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translate3d(var(--kwm-pg-drag-x), 0, 0) scale(1);
  transform-origin: var(--kwm-pg-zoom-x) var(--kwm-pg-zoom-y);
  transition: transform .16s cubic-bezier(.2,.8,.2,1), opacity .14s ease;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.kwm-product-gallery.is-dragging .kwm-product-gallery__main-image,
.kwm-product-gallery.is-dragging .kwm-product-gallery__main-link > img {
  transition: none;
}

.kwm-product-gallery.is-snapping .kwm-product-gallery__main-image,
.kwm-product-gallery.is-snapping .kwm-product-gallery__main-link > img {
  transition: transform .15s cubic-bezier(.2,.9,.2,1);
}

.kwm-product-gallery.is-zooming:not(.kwm-product-gallery--no-hover-zoom) .kwm-product-gallery__main-image {
  transform: translate3d(0, 0, 0) scale(var(--kwm-pg-zoom-scale));
  cursor: zoom-out;
}

.kwm-product-gallery.is-touch-zooming .kwm-product-gallery__main-image {
  transform: translate3d(0, 0, 0) scale(var(--kwm-pg-zoom-scale));
  cursor: zoom-out;
}

.kwm-product-gallery.is-touch-zooming .kwm-product-gallery__stage { touch-action: none; }
.kwm-product-gallery.is-touch-zooming .kwm-product-gallery__main-link { cursor: zoom-out; }
.kwm-product-gallery.is-holding .kwm-product-gallery__stage { cursor: zoom-in; }
.kwm-product-gallery--no-lightbox .kwm-product-gallery__main-link { cursor: default; }
.kwm-product-gallery--video-active .kwm-product-gallery__main-image { transform: scale(1) !important; }
.kwm-product-gallery--transition-none .kwm-product-gallery__main-image { transition: none; animation: none !important; }

.kwm-product-gallery--transition-fade.is-switching .kwm-product-gallery__main-image {
  animation: kwmPgImageFade .15s ease both;
}

.kwm-product-gallery--transition-slide.is-switching .kwm-product-gallery__main-image {
  animation: kwmPgImageNext .18s cubic-bezier(.2,.85,.2,1) both;
}

.kwm-product-gallery--transition-slide[data-switch-direction="prev"].is-switching .kwm-product-gallery__main-image {
  animation-name: kwmPgImagePrev;
}

@keyframes kwmPgImageFade {
  from { opacity: .42; transform: translate3d(0, 0, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes kwmPgImageNext {
  from { opacity: .5; transform: translate3d(28px, 0, 0) scale(.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes kwmPgImagePrev {
  from { opacity: .5; transform: translate3d(-28px, 0, 0) scale(.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.kwm-product-gallery__nav,
.kwm-product-gallery__lightbox-trigger,
.kwm-product-gallery__video-close,
.kwm-gallery-lightbox__nav,
.kwm-gallery-lightbox__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--kwm-pg-text);
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kwm-product-gallery__nav svg,
.kwm-product-gallery__lightbox-trigger svg,
.kwm-product-gallery__video-close svg,
.kwm-gallery-lightbox__nav svg,
.kwm-gallery-lightbox__close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.kwm-product-gallery__nav,
.kwm-product-gallery__lightbox-trigger {
  position: absolute;
  z-index: 35;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  opacity: 0;
  visibility: hidden;
  transform: scale(.92);
  transition: opacity .14s ease, visibility .14s ease, transform .14s ease, background .14s ease, color .14s ease;
}

.kwm-product-gallery__stage:hover .kwm-product-gallery__nav,
.kwm-product-gallery__stage:hover .kwm-product-gallery__lightbox-trigger,
.kwm-product-gallery--arrows-always .kwm-product-gallery__nav,
.kwm-product-gallery--arrows-always .kwm-product-gallery__lightbox-trigger {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.kwm-product-gallery__nav:hover,
.kwm-product-gallery__lightbox-trigger:hover,
.kwm-product-gallery__video-close:hover,
.kwm-gallery-lightbox__nav:hover,
.kwm-gallery-lightbox__close:hover {
  background: var(--kwm-pg-accent-color);
  color: #fff;
}

.kwm-product-gallery__nav:active { transform: translateY(-50%) scale(.94); }
.kwm-product-gallery__lightbox-trigger:active,
.kwm-gallery-lightbox__close:active { transform: scale(.94); }

.kwm-product-gallery__nav { top: 50%; transform: translateY(-50%) scale(.92); }
.kwm-product-gallery__stage:hover .kwm-product-gallery__nav,
.kwm-product-gallery--arrows-always .kwm-product-gallery__nav { transform: translateY(-50%) scale(1); }
.kwm-product-gallery__nav--prev { left: 14px; }
.kwm-product-gallery__nav--next { right: 14px; }
.kwm-product-gallery__lightbox-trigger { top: 14px; right: 14px; }

.kwm-product-gallery--arrow-square .kwm-product-gallery__nav,
.kwm-product-gallery--arrow-square .kwm-product-gallery__lightbox-trigger { border-radius: 12px; }

.kwm-product-gallery--arrow-minimal .kwm-product-gallery__nav,
.kwm-product-gallery--arrow-minimal .kwm-product-gallery__lightbox-trigger {
  background: rgba(255,255,255,.72);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.kwm-product-gallery__counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: var(--kwm-pg-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(15,23,42,.10);
  backdrop-filter: blur(12px);
}

.kwm-product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  scrollbar-width: none;
}

.kwm-product-gallery__thumbs::-webkit-scrollbar,
.kwm-gallery-lightbox__thumbs::-webkit-scrollbar { display: none; }

.kwm-product-gallery__thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--kwm-pg-border);
  border-radius: var(--kwm-pg-thumbnail-radius);
  background: #fff;
  cursor: pointer;
  opacity: .72;
  scroll-snap-align: center;
  transition: border-color .14s ease, opacity .14s ease, transform .14s ease, box-shadow .14s ease;
}

.kwm-product-gallery__thumb img,
.kwm-product-gallery__thumb-video-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.kwm-product-gallery__thumb:hover { opacity: 1; transform: translateY(-2px); }

.kwm-product-gallery__thumb.is-active {
  border-color: var(--kwm-pg-accent-color);
  opacity: 1;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kwm-pg-accent-color) 22%, transparent), 0 10px 22px rgba(15,23,42,.08);
}

.kwm-product-gallery__thumb--video { color: #fff; background: #020617; }
.kwm-product-gallery__thumb-video-preview { position: absolute; inset: 0; display: block; }
.kwm-product-gallery__thumb-video-preview::after { content: ""; position: absolute; inset: 0; background: rgba(2,6,23,.28); }
.kwm-product-gallery__thumb-video-fallback { display: block; width: 100%; height: 100%; background: radial-gradient(circle, color-mix(in srgb, var(--kwm-pg-accent-color) 55%, transparent), transparent 58%), #020617; }

.kwm-product-gallery__thumb-play {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--kwm-pg-accent-color);
  color: #fff;
  box-shadow: 0 10px 28px rgba(2,6,23,.28);
}

.kwm-product-gallery__thumb-play svg { width: 20px; height: 20px; }

.kwm-product-gallery--thumbs-left,
.kwm-product-gallery--thumbs-right {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.kwm-product-gallery--thumbs-right { grid-template-columns: minmax(0, 1fr) 92px; }
.kwm-product-gallery--thumbs-left .kwm-product-gallery__stage { grid-column: 2; grid-row: 1; }
.kwm-product-gallery--thumbs-left .kwm-product-gallery__thumbs { grid-column: 1; grid-row: 1; margin-top: 0; }
.kwm-product-gallery--thumbs-right .kwm-product-gallery__stage { grid-column: 1; grid-row: 1; }
.kwm-product-gallery--thumbs-right .kwm-product-gallery__thumbs { grid-column: 2; grid-row: 1; margin-top: 0; }

.kwm-product-gallery--thumbs-left .kwm-product-gallery__thumbs,
.kwm-product-gallery--thumbs-right .kwm-product-gallery__thumbs {
  grid-template-columns: 1fr;
  max-height: 610px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.kwm-product-gallery--layout-showcase .kwm-product-gallery__stage {
  border-radius: 28px;
  box-shadow: 0 24px 65px rgba(15,23,42,.12);
}

.kwm-product-gallery--layout-showcase.kwm-product-gallery--thumbs-bottom .kwm-product-gallery__thumbs {
  position: relative;
  z-index: 40;
  width: calc(100% - 40px);
  margin: -82px auto 18px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: calc(var(--kwm-pg-thumbnail-radius) + 8px);
  background: rgba(255,255,255,.8);
  box-shadow: 0 18px 45px rgba(15,23,42,.16);
  backdrop-filter: blur(18px);
}

.kwm-product-gallery--layout-minimal .kwm-product-gallery__stage {
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.kwm-product-gallery--layout-minimal .kwm-product-gallery__thumb { background: transparent; }
.kwm-product-gallery--no-shadow .kwm-product-gallery__stage { box-shadow: none; }

.kwm-product-gallery--ratio-1-1 .kwm-product-gallery__main-link { aspect-ratio: 1 / 1; }
.kwm-product-gallery--ratio-4-3 .kwm-product-gallery__main-link { aspect-ratio: 4 / 3; }
.kwm-product-gallery--ratio-3-4 .kwm-product-gallery__main-link { aspect-ratio: 3 / 4; }
.kwm-product-gallery--ratio-16-9 .kwm-product-gallery__main-link { aspect-ratio: 16 / 9; }
.kwm-product-gallery--ratio-auto .kwm-product-gallery__main-link { aspect-ratio: auto; }
.kwm-product-gallery--ratio-auto .kwm-product-gallery__main-image { width: 100%; height: auto; }

.kwm-product-gallery__video-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #020617;
  animation: kwmPgVideoIn .2s ease both;
}

.kwm-product-gallery__video-layer.is-leaving { animation: kwmPgVideoOut .14s ease both; }

.kwm-product-gallery__video,
.kwm-product-gallery__video-embed {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 18px;
  background: #000;
  overflow: hidden;
}

.kwm-product-gallery__video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.kwm-product-gallery__video-close { position: absolute; top: 14px; right: 14px; z-index: 55; width: 40px; height: 40px; border-radius: 999px; }
.kwm-product-gallery--video-active .kwm-product-gallery__lightbox-trigger { opacity: 0; visibility: hidden; }

@keyframes kwmPgVideoIn { from { opacity: 0; transform: scale(.975); } to { opacity: 1; transform: scale(1); } }
@keyframes kwmPgVideoOut { to { opacity: 0; transform: scale(.98); } }

.kwm-gallery-lightbox {
  --kwm-lb-zoom-scale: 2.2;
  --kwm-lb-zoom-x: 50%;
  --kwm-lb-zoom-y: 50%;
  --kwm-lb-drag-x: 0px;
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  padding: 72px 76px 76px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
  -webkit-tap-highlight-color: transparent;
}

.kwm-gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.kwm-gallery-lightbox.is-closing { visibility: visible; pointer-events: none; }

.kwm-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(30,41,59,.52), rgba(2,6,23,.94) 66%),
    rgba(2,6,23,.92);
  opacity: 0;
  backdrop-filter: blur(16px) saturate(.9);
  transition: opacity .22s ease;
}

.kwm-gallery-lightbox.is-open .kwm-gallery-lightbox__backdrop { opacity: 1; }

.kwm-gallery-lightbox__content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1240px, calc(100vw - 152px));
  height: min(82vh, calc(100dvh - 150px));
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(.88);
  transition: opacity .2s ease, transform .32s cubic-bezier(.16,.86,.22,1.08);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.kwm-gallery-lightbox.has-thumbnails .kwm-gallery-lightbox__content {
  height: min(76vh, calc(100dvh - 178px));
}

.kwm-gallery-lightbox.is-open .kwm-gallery-lightbox__content {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.kwm-gallery-lightbox.is-closing .kwm-gallery-lightbox__content {
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(.94);
  transition-duration: .2s;
}

.kwm-gallery-lightbox__content img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 36px 110px rgba(0,0,0,.44);
  transform: translate3d(var(--kwm-lb-drag-x), 0, 0) scale(1);
  transform-origin: var(--kwm-lb-zoom-x) var(--kwm-lb-zoom-y);
  transition: transform .16s cubic-bezier(.2,.85,.2,1), opacity .15s ease, filter .15s ease;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.kwm-gallery-lightbox.is-dragging .kwm-gallery-lightbox__content,
.kwm-gallery-lightbox.is-dragging .kwm-gallery-lightbox__content img { cursor: grabbing; }

.kwm-gallery-lightbox.is-dragging .kwm-gallery-lightbox__content img { transition: none; }

.kwm-gallery-lightbox.is-snapping .kwm-gallery-lightbox__content img {
  transition: transform .15s cubic-bezier(.2,.9,.2,1);
}

.kwm-gallery-lightbox.is-zoomed .kwm-gallery-lightbox__content {
  cursor: zoom-out;
}

.kwm-gallery-lightbox.is-zoomed .kwm-gallery-lightbox__content img {
  transform: translate3d(0, 0, 0) scale(var(--kwm-lb-zoom-scale));
}

.kwm-gallery-lightbox.is-holding .kwm-gallery-lightbox__content img {
  filter: brightness(.97);
}

.kwm-gallery-lightbox.is-image-switching[data-switch-direction="next"] .kwm-gallery-lightbox__content img {
  animation: kwmLbImageNext .18s cubic-bezier(.2,.85,.2,1) both;
}

.kwm-gallery-lightbox.is-image-switching[data-switch-direction="prev"] .kwm-gallery-lightbox__content img {
  animation: kwmLbImagePrev .18s cubic-bezier(.2,.85,.2,1) both;
}

@keyframes kwmLbImageNext {
  from { opacity: .35; transform: translate3d(42px, 0, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes kwmLbImagePrev {
  from { opacity: .35; transform: translate3d(-42px, 0, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.kwm-gallery-lightbox__nav,
.kwm-gallery-lightbox__close {
  position: fixed;
  z-index: 5;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  transition: background .14s ease, color .14s ease, transform .14s ease, opacity .14s ease;
}

.kwm-gallery-lightbox__nav[hidden],
.kwm-gallery-lightbox__thumbs[hidden] { display: none !important; }

.kwm-gallery-lightbox__nav {
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
}

.kwm-gallery-lightbox__nav:hover { transform: translateY(-50%) scale(1.04); }
.kwm-gallery-lightbox__nav:active { transform: translateY(-50%) scale(.94); }
.kwm-gallery-lightbox__nav--prev { left: 22px; }
.kwm-gallery-lightbox__nav--next { right: 22px; }

.kwm-gallery-lightbox__close {
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
}

.kwm-gallery-lightbox__counter {
  position: fixed;
  top: max(22px, env(safe-area-inset-top));
  left: max(22px, env(safe-area-inset-left));
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(15,23,42,.66);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}

.kwm-gallery-lightbox__thumbs {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(760px, calc(100vw - 112px));
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(15,23,42,.66);
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  direction: ltr;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.kwm-gallery-lightbox__thumb {
  appearance: none;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  opacity: .6;
  cursor: pointer;
  scroll-snap-align: center;
  transition: opacity .14s ease, border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}

.kwm-gallery-lightbox__thumb:hover { opacity: .9; transform: translateY(-1px); }

.kwm-gallery-lightbox__thumb.is-active {
  border-color: var(--kwm-pg-accent-color);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,.86);
}

.kwm-gallery-lightbox__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
  transform: none !important;
  animation: none !important;
  filter: none !important;
}

.kwm-gallery-lightbox-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.kwm-product-gallery__thumb:focus-visible,
.kwm-product-gallery__nav:focus-visible,
.kwm-product-gallery__lightbox-trigger:focus-visible,
.kwm-product-gallery__video-close:focus-visible,
.kwm-gallery-lightbox__nav:focus-visible,
.kwm-gallery-lightbox__close:focus-visible,
.kwm-gallery-lightbox__thumb:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kwm-pg-accent-color) 36%, transparent);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .kwm-product-gallery--thumbs-left,
  .kwm-product-gallery--thumbs-right { display: block; }

  .kwm-product-gallery__stage {
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15,23,42,.08);
  }

  .kwm-product-gallery__nav,
  .kwm-product-gallery__lightbox-trigger {
    width: 40px;
    height: 40px;
    min-height: 40px;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .kwm-product-gallery__nav { transform: translateY(-50%); }
  .kwm-product-gallery__nav--prev { left: 8px; }
  .kwm-product-gallery__nav--next { right: 8px; }
  .kwm-product-gallery__lightbox-trigger { top: 10px; right: 10px; }
  .kwm-product-gallery__counter { right: 10px; bottom: 10px; }

  .kwm-product-gallery--thumbs-left .kwm-product-gallery__thumbs,
  .kwm-product-gallery--thumbs-right .kwm-product-gallery__thumbs,
  .kwm-product-gallery__thumbs {
    display: flex;
    gap: 9px;
    max-height: none;
    margin-top: 11px;
    padding: 2px 1px 7px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .kwm-product-gallery__thumb {
    flex: 0 0 var(--kwm-pg-mobile-thumb-size);
    width: var(--kwm-pg-mobile-thumb-size);
  }

  .kwm-product-gallery--layout-showcase.kwm-product-gallery--thumbs-bottom .kwm-product-gallery__thumbs {
    width: auto;
    margin: 10px 0 0;
    padding: 2px 1px 7px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .kwm-product-gallery__video-layer { padding: 12px; }

  .kwm-gallery-lightbox {
    padding: 64px 10px 76px;
  }

  .kwm-gallery-lightbox__content,
  .kwm-gallery-lightbox.has-thumbnails .kwm-gallery-lightbox__content {
    width: calc(100vw - 20px);
    height: calc(100dvh - 150px);
  }

  .kwm-gallery-lightbox.has-thumbnails .kwm-gallery-lightbox__content {
    height: calc(100dvh - 176px);
  }

  .kwm-gallery-lightbox__content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
    box-shadow: 0 26px 74px rgba(0,0,0,.42);
  }

  .kwm-gallery-lightbox__nav {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.94);
  }

  .kwm-gallery-lightbox__nav--prev { left: 7px; }
  .kwm-gallery-lightbox__nav--next { right: 7px; }

  .kwm-gallery-lightbox__close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
  }

  .kwm-gallery-lightbox__counter {
    top: max(16px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    min-height: 30px;
    padding: 6px 11px;
    font-size: 12px;
  }

  .kwm-gallery-lightbox__thumbs {
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 7px;
    max-width: calc(100vw - 20px);
    padding: 7px;
    border-radius: 16px;
  }

  .kwm-gallery-lightbox__thumb {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
    border-radius: 11px;
  }
}

@media (max-width: 420px) {
  .kwm-gallery-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .kwm-gallery-lightbox__nav--prev { left: 4px; }
  .kwm-gallery-lightbox__nav--next { right: 4px; }
  .kwm-gallery-lightbox__thumb { flex-basis: 50px; width: 50px; height: 50px; }
}

@media (hover: none) {
  .kwm-product-gallery:not(.is-touch-zooming) .kwm-product-gallery__main-image {
    transform: translate3d(var(--kwm-pg-drag-x), 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kwm-product-gallery *,
  .kwm-gallery-lightbox * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* KWM Product Gallery 1.4.2: lazy video poster prevents iframe focus/scroll on load. */
.kwm-product-gallery__video-player {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.kwm-product-gallery__video-player > .kwm-product-gallery__video,
.kwm-product-gallery__video-player > .kwm-product-gallery__video-embed {
  width: 100%;
  height: 100%;
}

.kwm-product-gallery__video-layer--poster {
  padding: 0;
  overflow: hidden;
  background: #020617;
}

.kwm-product-gallery__video-poster {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border: 0;
  background: #020617;
  cursor: pointer;
}

.kwm-product-gallery__video-poster img,
.kwm-product-gallery__video-poster-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.kwm-product-gallery__video-poster::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.04), rgba(2, 6, 23, 0.26));
  pointer-events: none;
}

.kwm-product-gallery__video-play-icon {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  width: clamp(62px, 8vw, 82px);
  height: clamp(62px, 8vw, 82px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s ease, background 0.2s ease;
}

.kwm-product-gallery__video-play-icon svg {
  width: 30px;
  height: 30px;
  margin-inline-start: 3px;
  fill: currentColor;
  stroke: none;
}

.kwm-product-gallery__video-poster:hover .kwm-product-gallery__video-play-icon,
.kwm-product-gallery__video-poster:focus-visible .kwm-product-gallery__video-play-icon {
  transform: scale(1.06);
  background: #ffffff;
}

.kwm-product-gallery__video-poster:focus-visible {
  outline: 3px solid var(--kwm-pg-accent-color, #2563eb);
  outline-offset: -5px;
}
