/* ============================================================================
   SuperBio Labs · Product Image Gallery
   Companion CSS for /assets/js/product-gallery.js
   ============================================================================ */

.pg-container {
  position: relative;
  width: 100%;
}

/* Override .product-img.with-real-photo dark gradient when it wraps a gallery */
.product-img.with-real-photo:has(> .pg-container),
.product-img:has(> .pg-container) {
  background: white;
  border: 1px solid var(--line, #DDE2EA);
  border-radius: 6px;
  padding: 0;          /* removed — let gallery fill edge to edge */
  min-height: auto;
  /* display block + overflow visible: el contenedor CRECE para mostrar la imagen
     completa Y la tira de miniaturas (antes overflow:hidden + centrado flex las
     recortaba en móvil). El recorte por borde redondeado lo hace el .pg-stage. */
  display: block;
  overflow: visible;
  height: auto;
}

/* ── Single image (fallback or 1 image) ──────────────────────────────────── */
.pg-single {
  display: block;
  width: 100%;
  height: 440px;          /* contenedor fijo — imagen se ajusta adentro */
  overflow: hidden;
  border-radius: 6px;
  background: white;
  cursor: zoom-in;
}
.pg-single img {
  width: 100%;
  height: 100%;
  object-fit: contain;    /* si imagen es alta → fit por alto · si ancha → fit por ancho */
  display: block;
}

/* ── Stage (viewport for the slides) ─────────────────────────────────────── */
.pg-stage {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  outline: none;
  background: white;
  width: 100%;
  height: 440px;          /* contenedor fijo */
}
.pg-stage:focus-visible {
  box-shadow: 0 0 0 3px rgba(40, 100, 160, 0.35);
}

.pg-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.pg-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}
.pg-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Arrows ──────────────────────────────────────────────────────────────── */
.pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 20, 80, 0.10);
  background: rgba(255, 255, 255, 0.85);
  color: #001450;
  font-size: 28px;
  line-height: 1;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 5;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 20, 80, 0.08);
}
.pg-arrow:hover {
  background: white;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 20, 80, 0.16);
}
.pg-arrow:active {
  transform: translateY(-50%) scale(0.95);
}
.pg-arrow:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(40, 100, 160, 0.35);
}
.pg-arrow-prev { left: 14px; }
.pg-arrow-next { right: 14px; }
.pg-arrow span {
  display: block;
  margin-top: -2px;
}

/* ── Counter pill ────────────────────────────────────────────────────────── */
.pg-counter {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 20, 80, 0.78);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 1.3px;
  padding: 5px 12px;
  border-radius: 100px;
  z-index: 5;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Thumbnail strip ─────────────────────────────────────────────────────── */
.pg-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.pg-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  border: 2px solid var(--line, #DDE2EA);
  background: white;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.pg-thumb:hover {
  border-color: rgba(0, 20, 80, 0.20);
  transform: translateY(-1px);
}
.pg-thumb.active {
  border-color: #00d9b2;
}

/* ── Mobile tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .pg-single, .pg-stage { height: 360px; }
  .pg-arrow {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
  .pg-arrow-prev { left: 8px; }
  .pg-arrow-next { right: 8px; }
  .pg-thumb { width: 48px; height: 48px; }
}

/* Móvil/tablet (hero apilado): ocultamos la tira de miniaturas — navegas con las
   flechas + contador "1/2". Evita que las miniaturas se monten sobre el título. */
@media (max-width: 880px) {
  .pg-thumbs { display: none !important; }
}

/* ────────────────────────────────────────────────────────────────────────
   LIGHTBOX — full-size image overlay
   ──────────────────────────────────────────────────────────────────────── */
.pg-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 80, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 40px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.pg-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.pg-lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}
.pg-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
  z-index: 2;
}
.pg-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.pg-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
  z-index: 2;
}
.pg-lightbox-arrow:hover { background: rgba(255, 255, 255, 0.22); }
.pg-lightbox-arrow-prev { left: 24px; }
.pg-lightbox-arrow-next { right: 24px; }
.pg-lightbox-arrow span { display: block; margin-top: -3px; }
.pg-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border-radius: 100px;
}
@media (max-width: 540px) {
  .pg-lightbox { padding: 16px; }
  .pg-lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 22px; }
  .pg-lightbox-arrow { width: 42px; height: 42px; font-size: 26px; }
  .pg-lightbox-arrow-prev { left: 8px; }
  .pg-lightbox-arrow-next { right: 8px; }
}
body.pg-lightbox-open { overflow: hidden; }
