.single-product div.product .woocommerce-product-gallery {
  position: relative;
  /* Show the server-rendered image while deferred scripts are still loading. */
  opacity: 1 !important;
}

/* Keep the raw WooCommerce markup stable until FlexSlider wraps the slides. */
.single-product div.product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) {
  display: none;
}

.single-product div.product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child {
  width: 100%;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 120px;
  grid-template-columns: none;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0 0 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: thin;
  list-style: none;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
  width: 120px !important;
  height: 120px;
  margin: 0;
  overflow: hidden;
  float: none;
  background: #fff;
  border: 2px solid transparent;
  scroll-snap-align: start;
}

.single-product div.product .woocommerce-product-gallery__trigger {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .68;
  cursor: pointer;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover,
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:focus-visible,
.single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
  opacity: 1;
}

.single-product div.product .woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active) {
  border-color: #111;
  box-shadow: inset 0 -4px 0 var(--ro-accent);
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav {
  height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav li {
  margin: 0;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav a {
  position: absolute;
  z-index: 8;
  top: min(310px, 31vw);
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0;
  padding: 0;
  place-items: center;
  overflow: hidden;
  opacity: 1;
  color: #fff;
  background: #111;
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .2);
  font-size: 0;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-50%);
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav a::before {
  color: #fff;
  font-family: inherit;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev {
  left: 16px !important;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev::before {
  content: "←";
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-next {
  right: 16px !important;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-next::before {
  content: "→";
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav a:hover,
.single-product div.product .woocommerce-product-gallery .flex-direction-nav a:focus-visible {
  color: #111;
  background: var(--ro-accent);
  border-color: #111;
  outline: 3px solid #fff;
  outline-offset: -6px;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav a:hover::before,
.single-product div.product .woocommerce-product-gallery .flex-direction-nav a:focus-visible::before {
  color: #111;
}

.single-product div.product .woocommerce-product-gallery .flex-direction-nav a.flex-disabled {
  display: grid !important;
  visibility: visible !important;
  opacity: .38 !important;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

@media (max-width: 760px) {
  .single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
    grid-auto-columns: 88px;
    gap: 10px;
  }

  .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 88px !important;
    height: 88px;
  }

  .single-product div.product .woocommerce-product-gallery .flex-direction-nav a {
    width: 48px;
    height: 48px;
  }

  .single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-prev {
    left: 10px !important;
  }

  .single-product div.product .woocommerce-product-gallery .flex-direction-nav .flex-next {
    right: 10px !important;
  }
}
