/* ==========================================================================
   Deposit product gallery — prev/next arrows, 4-wide thumb strip, counter.
   Loaded only on the Light Bee 2 deposit products.
   ========================================================================== */

/* main viewport: room for the arrows */
.rm-depgal .woocommerce-product-gallery { position: relative; }

/* flexslider direction nav as volt circles */
.rm-depgal .flex-direction-nav {
  margin: 0; padding: 0; list-style: none;
}
.rm-depgal .flex-direction-nav a {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.72);
  border: 1px solid #32cd32;
  text-indent: -9999px;
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rm-depgal .flex-direction-nav a::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0.7rem; height: 0.7rem;
  border-right: 2px solid #32cd32;
  border-top: 2px solid #32cd32;
  text-indent: 0;
}
.rm-depgal .flex-direction-nav .flex-prev { left: 0.75rem; }
.rm-depgal .flex-direction-nav .flex-next { right: 0.75rem; }
.rm-depgal .flex-direction-nav .flex-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.rm-depgal .flex-direction-nav .flex-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.rm-depgal .flex-direction-nav a:hover { background: rgba(50, 205, 50, 0.25); }
.rm-depgal .flex-direction-nav .flex-disabled { opacity: 0.3; pointer-events: none; }

/* thumbnails: one row, four visible, swipe/scroll for the rest */
.rm-depgal .flex-control-thumbs {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  list-style: none;
}
.rm-depgal .flex-control-thumbs::-webkit-scrollbar { display: none; }
.rm-depgal .flex-control-thumbs li {
  flex: 0 0 calc(25% - 4.5px);
  width: auto !important;
  margin: 0 !important;
  padding: 0;
  float: none !important;
  scroll-snap-align: start;
}
.rm-depgal .flex-control-thumbs li img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.rm-depgal .flex-control-thumbs li img:hover { opacity: 1; }
.rm-depgal .flex-control-thumbs li img.flex-active {
  opacity: 1;
  border-color: #32cd32;
}

/* image counter, bottom right of the viewport */
.rm-depgal .rm-depgal__count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 20;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #f2f0eb;
  background: rgba(10, 10, 11, 0.72);
  border: 1px solid rgba(242, 240, 235, 0.25);
  padding: 0.25rem 0.55rem 0.2rem;
  pointer-events: none;
}

/* main image: cap the flexslider viewport (JS sets an inline height to the
   natural image height) with max-height, which overrides inline height; then
   contain + centre the image inside. Lightbox still opens the full photo. */
.rm-depgal .flex-viewport,
.rm-depgal .woocommerce-product-gallery__wrapper {
  max-height: min(70vh, 620px);
  background: #f7f7f7;
}
.rm-depgal .woocommerce-product-gallery__image,
.rm-depgal .flex-slides > .woocommerce-product-gallery__image {
  height: min(70vh, 620px);
  overflow: hidden;
}
/* fill the stage and crop the overflow, centred: no letterbox bars. Only
   images taller/wider than the stage lose anything, and the zoom still
   opens the untouched full-size photo. */
/* These are portrait showroom photos (subject sits low in frame), so a true
   50% centre crop lands on the wall/sign and cuts the bike. Bias the crop
   downward so the bike stays in frame. Height is enforced because LiteSpeed
   bundles this file and a Woo/theme `height:auto` otherwise wins. */
.woocommerce div.product div.images .rm-depgal .woocommerce-product-gallery__image img,
.rm-depgal .woocommerce-product-gallery__image img {
  width: 100% !important;
  height: min(70vh, 620px) !important;
  max-height: none !important;
  display: block;
  object-fit: cover !important;
  object-position: 50% 62% !important;
  margin: 0;
}

/* The gallery is position:relative with z-index:auto, so it creates NO stacking
   context and the zoom trigger's z-index:99 competes in the root context,
   punching through the fixed header's dropdowns. Isolate the gallery so the
   trigger (and our arrows/counter) stack only within it. */
.woocommerce-product-gallery,
.rm-depgal {
  isolation: isolate;
}
.woocommerce-product-gallery__trigger { z-index: 2; }

/* ==========================================================================
   Product page: reclaim the fold.
   The template stacks `.site-main.mt-24` (96px margin) on top of a section
   with 32px padding, leaving ~128px of dead air under the fixed header.
   Trim both on single product pages only; other templates keep their spacing.
   ========================================================================== */
body.single-product .site-main.mt-24 { margin-top: 2rem; }
body.single-product .site-main.mt-24 section.max-w-7xl { padding-top: 1rem; }

@media (max-width: 47.99em) {
  body.single-product .site-main.mt-24 { margin-top: 1.25rem; }
  body.single-product .site-main.mt-24 section.max-w-7xl { padding-top: 0.75rem; }
  /* shorter stage on phones so price + options reach the fold */
  .rm-depgal .flex-viewport,
  .rm-depgal .woocommerce-product-gallery__wrapper,
  .rm-depgal .woocommerce-product-gallery__image,
  .rm-depgal .flex-slides > .woocommerce-product-gallery__image {
    max-height: 48vh;
    height: 48vh;
  }
  .rm-depgal .woocommerce-product-gallery__image img { height: 48vh !important; }
}
