/* Estilos para el widget de galería de productos */

/* Contenedor principal */
.product-gallery-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Contenedor de la imagen principal */
.product-gallery-container {
  position: relative;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: zoom-in;
  overflow: hidden;
}

/* Overlay para el zoom */
.product-gallery-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Contenedor de miniaturas - Versión Desktop (vertical) */
.product-gallery-thumbnails {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  box-sizing: border-box;
  z-index: 2;
}

/* Estilo para ocultar la barra de desplazamiento pero mantener la funcionalidad */
.product-gallery-thumbnails::-webkit-scrollbar {
  width: 5px;
}

.product-gallery-thumbnails::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.product-gallery-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.product-gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Miniatura individual */
.product-gallery-thumbnail {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  /* overflow: hidden; */
  transition: all 0.3s ease;
  z-index: 0;
}

.product-gallery-thumbnail.active {
  /* border-color: #000; */
  z-index: 5;
}
.product-gallery-thumbnail.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: 100%;
  width: 100%;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='56' height='56' viewBox='0 0 56 56' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 44C8 46.2091 9.79086 48 12 48H20V56H12C5.37258 56 4.18545e-07 50.6274 0 44V36H8V44ZM56 44C56 50.5239 50.7939 55.8319 44.3096 55.9961L44 56H36V48H44L44.2061 47.9951C46.3194 47.8879 48 46.14 48 44V36H56V44ZM20 8H12C9.85996 8 8.11212 9.68056 8.00488 11.7939L8 12V20H0V12L0.00390625 11.6904C0.168106 5.20609 5.47608 4.12009e-07 12 0H20V8ZM44 0C50.6274 1.45415e-06 56 5.37258 56 12V20H48V12C48 9.79086 46.2091 8 44 8H36V0H44Z' fill='white'/%3E%3C/svg%3E%0A");
  background-size: 100%;
  background-repeat: no-repeat;
  transform: scale(1.25);
}

.product-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: inherit;
  position: relative;
}

/* Efecto hover en las miniaturas */
.product-gallery-thumbnail:hover img {
  /* transform: scale(1.05); */
}

/* Icono de lupa */
.product-gallery-magnifier {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}
.product-gallery-magnifier img {
  width: 28px;
  height: auto;
}

.product-gallery-thumbnail:hover .product-gallery-magnifier {
  opacity: 1;
}

/* Placeholder para el editor */
.product-gallery-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
}

.product-gallery-preview-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #666;
  font-size: 14px;
  padding: 20px;
}

/* Mensaje de error */
.product-gallery-error {
  padding: 20px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Estilos para el lightbox */
.product-gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.product-gallery-lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.product-gallery-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

/* Media queries para responsive */
@media (max-width: 768px) {
  /* Contenedor de miniaturas - Versión Mobile (horizontal) */
  .product-gallery-thumbnails {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    margin-top: 10px;
  }

  .product-gallery-thumbnails::-webkit-scrollbar {
    height: 5px;
    width: auto;
  }

  .product-gallery-thumbnail {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 0;
  }

  /* Ajustar el contenedor principal para móviles */
  .product-gallery-container {
    height: 300px !important; /* Sobreescribir la altura definida en Elementor para móviles */
  }
}
