/* Lightbox de imagenes a pantalla completa con zoom (image-lightbox.js) */

body.ba-lightbox-open {
  overflow: hidden !important;
}

.ba-lightbox {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  background: rgba(8, 8, 10, 0.94);
  display: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  -webkit-user-select: none;
  user-select: none;
}

.ba-lightbox.is-open {
  display: block;
  opacity: 1;
}

/* Escenario -------------------------------------------------------- */

.ba-lightbox__stage {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  transition: transform 0.2s ease-out;
}

.ba-lightbox.is-dragging .ba-lightbox__stage {
  transition: none;
}

.ba-lightbox.is-zoomed .ba-lightbox__stage {
  cursor: grab;
}

.ba-lightbox.is-zoomed.is-dragging .ba-lightbox__stage {
  cursor: grabbing;
}

.ba-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  transform-origin: center center;
  transition: transform 0.16s ease-out;
  will-change: transform;
  -webkit-user-drag: none;
}

.ba-lightbox.is-dragging .ba-lightbox__img {
  transition: none;
}

.ba-lightbox.is-loading .ba-lightbox__img {
  opacity: 0;
}

.ba-lightbox.is-loading .ba-lightbox__stage::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ba-lightbox-spin 0.7s linear infinite;
}

@keyframes ba-lightbox-spin {
  to { transform: rotate(360deg); }
}

/* Barra superior --------------------------------------------------- */

.ba-lightbox__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.ba-lightbox__counter {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ba-lightbox__close {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ba-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Navegacion ------------------------------------------------------- */

.ba-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ba-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.ba-lightbox__prev { left: 18px; }
.ba-lightbox__next { right: 18px; }

/* Ayuda ------------------------------------------------------------ */

.ba-lightbox__hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ba-lightbox__hint.is-visible {
  opacity: 1;
}

.ba-lightbox.is-zoomed .ba-lightbox__hint {
  opacity: 0;
}

/* Disparadores ----------------------------------------------------- */

[data-lightbox-src] {
  cursor: zoom-in;
}

/* Indicador de "ampliar" sobre la imagen del slider de la publicacion */
.single_product_slider [data-lightbox-src] {
  position: relative;
}

.single_product_slider [data-lightbox-src]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.45);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16' y2='16'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 19px 19px;
  opacity: 0.85;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  pointer-events: none;
}

.single_product_slider [data-lightbox-src]:hover::after {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.68);
}

/* Mobile ----------------------------------------------------------- */

@media (max-width: 767px) {
  .ba-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
  }

  .ba-lightbox__prev { left: 8px; }
  .ba-lightbox__next { right: 8px; }

  .ba-lightbox__bar { padding: 10px 12px; }
  .ba-lightbox__hint { font-size: 12px; bottom: 16px; }
}
