/* Product gallery: fixed main frame, no hover-zoom, thumb slider, lightbox */
.single-product .woocommerce-product-gallery .zoomImg {
  display: none !important;
}

/* Fixed main image frame — slides must not resize the container */
.single-product .woocommerce-product-gallery .flex-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto !important;
  max-height: none !important;
  overflow: hidden;
  background: #fff;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
  height: 100%;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image {
  position: relative;
  width: 100%;
  height: 100% !important;
  margin: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  cursor: zoom-in;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
}

.single-product .akvagard-thumbs-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  width: 100%;
}

.single-product .akvagard-thumbs-viewport {
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.single-product .woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.single-product .woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs::-webkit-scrollbar {
  display: none;
}

.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
  flex: 0 0 100px !important;
  width: 100px !important;
  max-width: 100px !important;
  height: 100px !important;
  float: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
  width: 100px !important;
  height: 100px !important;
  max-width: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block;
}

.single-product .akvagard-thumbs-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 5px;
  background: #ffffff;
  color: #141414;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  padding: 0;
  line-height: 0;
}

.single-product .akvagard-thumbs-wrap.is-overflow .akvagard-thumbs-btn {
  display: inline-flex;
}

.single-product .akvagard-thumbs-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.single-product .akvagard-thumbs-btn svg,
.akvagard-lightbox__close svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: none !important;
  flex-shrink: 0 !important;
  display: block !important;
  overflow: visible !important;
  pointer-events: none;
}

.akvagard-lightbox__close svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
}

.single-product .akvagard-thumbs-btn svg path,
.akvagard-lightbox__close svg path {
  fill: currentColor;
}

.akvagard-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

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

.akvagard-lightbox__img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.akvagard-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 5px;
  background: #ffffff;
  color: #141414;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  line-height: 0;
}

.akvagard-lightbox__close:hover {
  background: #000;
  color: #fff;
}

@media (max-width: 767px) {
  .single-product .akvagard-thumbs-wrap {
    margin-top: 24px;
  }

  .single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
    flex-basis: 90px !important;
    width: 90px !important;
    max-width: 90px !important;
    height: 90px !important;
  }

  .single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
    width: 90px !important;
    height: 90px !important;
  }

  .akvagard-lightbox {
    padding: 16px;
  }

  .akvagard-lightbox__close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}
