/*
 * BOSWear Product Gallery Pro 1.1.0
 * Clean single-image stage + image-type control + adaptive sticky gallery.
 */

:root {
  --bosg-accent: var(--bw-accent, #112fff);
  --bosg-bg: #fff;
  --bosg-line: #5f5f5f;
  --bosg-max-height: 820px;
  --bosg-sticky-top: 112px;
}

body.bosg-lightbox-open {
  overflow: hidden !important;
}

#product .bosg-host {
  position: relative !important;
  top: auto !important;
  align-self: start !important;
  min-width: 0 !important;
  overflow: visible !important;
}

@media (min-width: 992px) {
  #product .bosg-host.bosg-host-sticky {
    position: sticky !important;
    top: var(--bosg-sticky-top, 112px) !important;
    z-index: 3;
    align-self: start !important;
  }
}

#product .bosg-native-gallery-hidden {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#product .bosg-pro-gallery {
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  --bosg-thumb-size: 76px;
  --bosg-thumb-gap: 10px;
  --bosg-accent: #112fff;
}

#product .bosg-pro-gallery.bosg-sticky-enabled.bosg-sticky-active {
  position: relative;
  top: auto;
  z-index: auto;
}

#product .bosg-layout {
  display: grid;
  min-width: 0;
  gap: 12px;
}

#product .bosg-pro-gallery.bosg-thumbs-left .bosg-layout {
  grid-template-columns: var(--bosg-thumb-size) minmax(0, 1fr);
  grid-template-areas: "thumbs stage";
}

#product .bosg-pro-gallery.bosg-thumbs-bottom .bosg-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "stage"
    "thumbs";
}

#product .bosg-stage {
  grid-area: stage;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: min(var(--bosg-max-height), calc(100vh - var(--bosg-sticky-top) - 28px));
  min-height: 520px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bosg-line);
  touch-action: pan-y pinch-zoom;
}

/* The large stage contains exactly one normal image. */
#product .bosg-main-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  padding: clamp(8px, 1vw, 18px);
  margin: 0;
  object-fit: contain;
  object-position: center;
  background: #fff;
  border: 0;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
}

#product .bosg-zoom-pane {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 185%;
  transition: opacity .12s ease;
}

#product .bosg-stage.is-zooming .bosg-zoom-pane {
  opacity: 1;
}

#product .bosg-thumbs {
  grid-area: thumbs;
  display: flex;
  gap: var(--bosg-thumb-gap);
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: #777 transparent;
}

#product .bosg-thumbs-left .bosg-thumbs {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(var(--bosg-max-height), calc(100vh - var(--bosg-sticky-top) - 28px));
  padding-right: 2px;
}

#product .bosg-thumbs-bottom .bosg-thumbs {
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 5px;
}


@media (min-width: 992px) {
  #product .bosg-pro-gallery.bosg-thumbs-bottom .bosg-stage {
    height: min(
      var(--bosg-max-height),
      calc(100vh - var(--bosg-sticky-top) - var(--bosg-thumb-size) - 52px)
    );
    min-height: 420px;
  }
}

#product .bosg-thumb {
  position: relative;
  flex: 0 0 var(--bosg-thumb-size);
  width: var(--bosg-thumb-size);
  height: var(--bosg-thumb-size);
  padding: 4px;
  border: 2px solid #666;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease;
}

#product .bosg-thumb:hover {
  border-color: #aaa;
}

#product .bosg-thumb.is-active {
  border-color: var(--bosg-accent);
  box-shadow: inset 0 0 0 1px var(--bosg-accent);
}

#product .bosg-thumb:focus-visible,
#product .bosg-control:focus-visible,
.bosg-lightbox button:focus-visible {
  outline: 3px solid var(--bosg-accent);
  outline-offset: 2px;
}

#product .bosg-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  object-fit: contain;
  background: #fff !important;
  border: 0 !important;
}

#product .bosg-control {
  position: absolute;
  z-index: 8;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(12,12,12,.84);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .16s ease, transform .16s ease, border-color .16s ease;
}

#product .bosg-control:hover {
  background: #111;
  border-color: var(--bosg-accent);
}

#product .bosg-prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

#product .bosg-next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

#product .bosg-fullscreen {
  top: 14px;
  right: 14px;
  font-size: 22px;
  font-weight: 900;
}

#product .bosg-counter {
  position: absolute;
  z-index: 8;
  right: 14px;
  bottom: 14px;
  min-width: 58px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  background: rgba(12,12,12,.8);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .03em;
  backdrop-filter: blur(5px);
}

@media (max-width: 991.98px) {
  #product .bosg-host,
  #product .bosg-host.bosg-host-sticky {
    position: static !important;
    top: auto !important;
  }

  #product .bosg-pro-gallery {
    --bosg-thumb-size: 68px;
    --bosg-thumb-gap: 8px;
    margin-inline: -12px;
    width: calc(100% + 24px);
  }

  #product .bosg-pro-gallery.bosg-sticky-enabled.bosg-sticky-active {
    position: relative;
    top: auto;
  }

  #product .bosg-pro-gallery .bosg-layout,
  #product .bosg-pro-gallery.bosg-thumbs-left .bosg-layout,
  #product .bosg-pro-gallery.bosg-thumbs-bottom .bosg-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "stage"
      "thumbs";
    gap: 10px;
  }

  #product .bosg-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-left: 0;
    border-right: 0;
  }

  #product .bosg-main-image {
    padding: 10px;
  }

  #product .bosg-thumbs,
  #product .bosg-thumbs-left .bosg-thumbs,
  #product .bosg-thumbs-bottom .bosg-thumbs {
    width: 100%;
    max-width: 100%;
    max-height: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    padding: 0 12px 7px;
    -webkit-overflow-scrolling: touch;
  }

  #product .bosg-thumb {
    scroll-snap-align: start;
  }

  #product .bosg-control {
    width: 44px;
    height: 44px;
  }

  #product .bosg-prev {
    left: 10px;
  }

  #product .bosg-next {
    right: 10px;
  }

  #product .bosg-fullscreen {
    top: 10px;
    right: 10px;
  }

  #product .bosg-counter {
    right: 10px;
    bottom: 10px;
  }

  #product .bosg-zoom-pane {
    display: none;
  }
}

/* Fullscreen */
.bosg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(4,4,4,.97);
  color: #fff;
}

.bosg-lightbox.is-open {
  display: flex;
}

.bosg-lightbox__viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 78px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.bosg-lightbox__image {
  display: block;
  max-width: min(94vw, 1900px);
  max-height: calc(100dvh - 110px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  transition: transform .2s ease;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.bosg-lightbox__image.is-zoomed {
  transform: scale(1.8);
  cursor: zoom-out;
}

.bosg-lightbox__close,
.bosg-lightbox__prev,
.bosg-lightbox__next {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  background: rgba(15,15,15,.9);
  color: #fff;
  cursor: pointer;
  font-size: 32px;
}

.bosg-lightbox__close {
  top: 18px;
  right: 18px;
  font-size: 28px;
}

.bosg-lightbox__prev {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.bosg-lightbox__next {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.bosg-lightbox__count {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  min-width: 70px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(15,15,15,.88);
  border: 1px solid rgba(255,255,255,.3);
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 767.98px) {
  .bosg-lightbox__viewport {
    padding: 64px 12px 76px;
  }

  .bosg-lightbox__image {
    max-width: 100%;
    max-height: calc(100dvh - 150px);
  }

  .bosg-lightbox__prev,
  .bosg-lightbox__next {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .bosg-lightbox__prev {
    left: calc(50% - 64px);
  }

  .bosg-lightbox__next {
    right: calc(50% - 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #product .bosg-thumb,
  #product .bosg-control,
  .bosg-lightbox__image {
    transition: none !important;
  }
}


/* =========================================================
   BOSWear Product Gallery Pro 1.1.3
   Product-page spacing: reduce the empty band below breadcrumbs without
   affecting the gallery's internal spacing or sticky behavior.
   ========================================================= */
#product .columns-container {
  padding-top: clamp(14px, 1.4vw, 22px) !important;
}

#product .product__container {
  margin-top: 0 !important;
}

@media (max-width: 991.98px) {
  #product .columns-container {
    padding-top: 12px !important;
  }
}

@media (max-width: 575.98px) {
  #product .columns-container {
    padding-top: 10px !important;
  }
}


/* =========================================================
   BOSWear Product Gallery Pro 1.1.5 — Hummingbird native gallery lockout
   Product variant/customization updates can inject a fresh native gallery
   after this module has rendered. While Gallery Pro is active, keep every
   Hummingbird native image container hidden at CSS level as well.
   ========================================================= */
body.bosg-active#product .product__images.js-images-container,
body.bosg-active#product .js-images-container.product__images,
body.bosg-active#product .product__images > .product__carousel.js-product-carousel,
body.bosg-active #product .product__images.js-images-container,
body.bosg-active #product .js-images-container.product__images,
body.bosg-active #product .product__images > .product__carousel.js-product-carousel {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.bosg-active #product .bosg-pro-gallery,
body.bosg-active#product .bosg-pro-gallery {
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
