/* 1.0.51.10 — prev/next arrows on the WooCommerce product main image.
   Chevrons are inline SVGs (injected by v10518-gallery.js). Do not use CSS
   data-URI backgrounds; Chrome drops unescaped svg+xml url() values.
   Lightbox (click-to-enlarge) is unchanged. Thumbnails stay in sync via FlexSlider.
   Hide any leftover FlexSlider nav that is a direct child of the gallery
   (1.0.51.9 left a second pair of empty circles below the working chevrons). */

/* Show every thumbnail the theme already allows (featured + up to 5 extras). */
.woocommerce-product-gallery .flex-control-thumbs {
  grid-template-columns: repeat(auto-fit, minmax(4.25rem, 1fr));
}
.woocommerce-product-gallery .flex-control-thumbs li:nth-child(n+6) {
  display: block;
}
.woocommerce-product-gallery .flex-control-thumbs li:nth-child(n+7) {
  display: none;
}

.woocommerce-product-gallery,
.woocommerce-product-gallery .flex-viewport {
  position: relative;
}

/* No arrows when there is only one image. */
.woocommerce-product-gallery:not(:has(.woocommerce-product-gallery__image:nth-child(2))) .flex-direction-nav {
  display: none;
}

.woocommerce-product-gallery .flex-direction-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
/* Leftover FlexSlider nav sits on the gallery (taller than the viewport), so its
   buttons landed just below the real ones. Hide it; JS also removes it. */
.woocommerce-product-gallery > .flex-direction-nav {
  display: none !important;
}
.woocommerce-product-gallery .flex-direction-nav li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.woocommerce-product-gallery .flex-direction-nav a,
.woocommerce-product-gallery .flex-direction-nav button {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border-radius: 50%;
  background: rgba(11, 11, 11, .82);
  border: 1px solid rgba(255, 184, 28, .6);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  color: var(--tt-gold, #ffb81c);
  font-size: 0;
  line-height: 0;
  text-indent: 0;
  text-decoration: none;
  cursor: pointer;
  z-index: 7;
  display: grid;
  place-items: center;
  appearance: none;
  -webkit-appearance: none;
  transition: opacity .2s ease, background .15s ease, border-color .15s ease;
}
.woocommerce-product-gallery .flex-direction-nav a:hover,
.woocommerce-product-gallery .flex-direction-nav a:focus-visible,
.woocommerce-product-gallery .flex-direction-nav button:hover,
.woocommerce-product-gallery .flex-direction-nav button:focus-visible {
  background: #0b0b0b;
  border-color: var(--tt-gold, #ffb81c);
  outline: none;
}
.woocommerce-product-gallery .flex-direction-nav a:focus-visible,
.woocommerce-product-gallery .flex-direction-nav button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 184, 28, .55);
}
.woocommerce-product-gallery .flex-prev { left: 12px; }
.woocommerce-product-gallery .flex-next { right: 12px; }

/* Kill leftover ::before/::after (FlexSlider icon font or the 1.0.51.8 data-URI). */
.woocommerce-product-gallery .flex-direction-nav a::before,
.woocommerce-product-gallery .flex-direction-nav a::after,
.woocommerce-product-gallery .flex-direction-nav button::before,
.woocommerce-product-gallery .flex-direction-nav button::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

.woocommerce-product-gallery .flex-direction-nav svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--tt-gold, #ffb81c);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Desktop: arrows appear on hover / keyboard focus of the gallery. */
@media (hover: hover) and (pointer: fine) {
  .woocommerce-product-gallery .flex-direction-nav a,
  .woocommerce-product-gallery .flex-direction-nav button {
    opacity: 0;
  }
  .woocommerce-product-gallery:hover .flex-direction-nav a,
  .woocommerce-product-gallery:hover .flex-direction-nav button,
  .woocommerce-product-gallery:focus-within .flex-direction-nav a,
  .woocommerce-product-gallery:focus-within .flex-direction-nav button,
  .woocommerce-product-gallery .flex-direction-nav a:focus-visible,
  .woocommerce-product-gallery .flex-direction-nav button:focus-visible {
    opacity: 1;
  }
}

/* Touch / coarse pointers: always show the arrows. */
@media (hover: none), (pointer: coarse) {
  .woocommerce-product-gallery .flex-direction-nav a,
  .woocommerce-product-gallery .flex-direction-nav button {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .woocommerce-product-gallery .flex-prev { left: 8px; }
  .woocommerce-product-gallery .flex-next { right: 8px; }
}
