/* ==========================================================
   ONEBIO v1.7 — reliable product gallery + fuller product cards
   Loaded last.
========================================================== */

/* Custom gallery stage: independent from Woo/FlexSlider translations. */
body.single-product .woocommerce-product-gallery.onebio-custom-gallery-active .flex-viewport,
body.single-product .woocommerce-product-gallery.onebio-custom-gallery-active > .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce-product-gallery.onebio-custom-gallery-active .flex-control-nav,
body.single-product .woocommerce-product-gallery.onebio-custom-gallery-active .flex-direction-nav {
  display: none !important;
}
body.single-product .onebio-gallery-stage {
  display: grid;
  width: 100%;
  min-height: 580px;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: linear-gradient(145deg,#ecefeb,#fafbf9);
  box-sizing: border-box;
}
body.single-product .onebio-gallery-stage img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 680px;
  max-height: 620px;
  margin: 0 !important;
  object-fit: contain;
}
body.single-product .onebio-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 9px;
  width: 100%;
  margin-top: 10px;
}
body.single-product .onebio-gallery-thumb {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
body.single-product .onebio-gallery-thumb:hover,
body.single-product .onebio-gallery-thumb:focus-visible,
body.single-product .onebio-gallery-thumb.is-active {
  border-color: var(--color-green-deep);
  box-shadow: inset 0 0 0 1px var(--color-green-deep);
  outline: 0;
}
body.single-product .onebio-gallery-thumb img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}

/* Product card imagery should use the available card area, without cropping. */
.product-card__image {
  padding: 10px !important;
  box-sizing: border-box;
}
.product-card__image img,
.woocommerce .product-card__image img {
  width: 94% !important;
  height: 94% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.product-card__image::after { bottom: 5%; }

@media (max-width: 980px) {
  body.single-product .onebio-gallery-stage { min-height: clamp(420px,75vw,620px); }
  body.single-product .onebio-gallery-thumbs { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 700px) {
  body.single-product .onebio-gallery-stage {
    min-height: 0;
    aspect-ratio: 1 / 1.04;
    padding: 16px 10px;
  }
  body.single-product .onebio-gallery-stage img {
    width: 96% !important;
    height: 96% !important;
    max-height: 440px;
  }
  body.single-product .onebio-gallery-thumbs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .product-card__image img,
  .woocommerce .product-card__image img { width: 96% !important; height: 96% !important; }
}
