/* WooCommerce single product gallery customization. */

.single-product .woocommerce-product-gallery {
  --me-gallery-thumb-size: clamp(54px, 5.2vw, 76px);
  --me-gallery-thumb-gap: 10px;
  --me-gallery-focus: var(--me-grey, #706F6F);
}

.single-product .woocommerce-product-gallery.me-product-gallery,
.single-product .woocommerce-product-gallery.me-product-gallery--ready,
.single-product .woocommerce div.product div.images .woocommerce-product-gallery.me-product-gallery {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.single-product .woocommerce-product-gallery.me-product-gallery--settling {
  opacity: 0 !important;
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-viewport,
.single-product .woocommerce-product-gallery.me-product-gallery > .woocommerce-product-gallery__wrapper {
  box-sizing: border-box;
  order: 2;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  position: relative;
}

@media (min-width: 769px) {
  .single-product .woocommerce-product-gallery.me-product-gallery .flex-viewport::after {
    content: "";
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    pointer-events: none;
  }
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs {
  box-sizing: border-box;
  order: 1;
  flex: 0 0 var(--me-gallery-thumb-size);
  display: flex;
  flex-direction: column;
  gap: var(--me-gallery-thumb-gap);
  width: var(--me-gallery-thumb-size);
  max-width: var(--me-gallery-thumb-size);
  max-height: min(640px, 72vw);
  height: auto;
  margin: 0;
  padding: 0;
  float: none;
  clear: none;
  position: static;
  inset: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  text-align: left;
  z-index: 2;
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs li {
  box-sizing: border-box;
  float: none;
  display: block;
  flex: 0 0 auto;
  width: var(--me-gallery-thumb-size);
  height: var(--me-gallery-thumb-size);
  margin: 0;
  padding: 0;
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 0;
  background: #fff;
  object-fit: cover;
  opacity: 0.72;
  cursor: pointer;
  transition: opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img:hover,
.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img.flex-active,
.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img:focus-visible {
  border-color: var(--me-gallery-focus);
  opacity: 1;
  box-shadow: 0 0 0 1px var(--me-gallery-focus);
}

.single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img:focus-visible {
  outline: 2px solid var(--me-auction-blue, #38519b);
  outline-offset: 2px;
}

.single-product .me-lot-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 0;
}

.single-product .me-lot-size {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.single-product .me-lot-size-tag {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--me-ink, #000);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: inherit;
  text-transform: none;
}

.single-product .me-lot-size-value {
  margin: 0;
  color: var(--me-ink, #000);
  font-size: 14px;
}

.single-product .woocommerce-product-gallery.me-product-gallery .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery.me-product-gallery .woocommerce-product-gallery__image a {
  cursor: default;
}

.single-product .woocommerce-product-gallery.me-product-gallery .zoomImg {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .single-product .woocommerce-product-gallery.me-product-gallery .woocommerce-product-gallery__image,
  .single-product .woocommerce-product-gallery.me-product-gallery .woocommerce-product-gallery__image a {
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  .single-product .woocommerce-product-gallery {
    --me-gallery-thumb-size: 64px;
    --me-gallery-thumb-gap: 8px;
  }

  .single-product .woocommerce-product-gallery.me-product-gallery,
  .single-product .woocommerce-product-gallery.me-product-gallery--ready,
  .single-product .woocommerce div.product div.images .woocommerce-product-gallery.me-product-gallery {
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
  }

  .single-product .woocommerce-product-gallery.me-product-gallery .flex-viewport,
  .single-product .woocommerce-product-gallery.me-product-gallery > .woocommerce-product-gallery__wrapper {
    order: 1;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }

  .single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs {
    order: 2;
    flex: 0 0 auto;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding-bottom: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs li {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .single-product .woocommerce-product-gallery.me-product-gallery .flex-control-thumbs img {
    transition: none;
  }
}
