/**
 * Estilos para la galería de reseñas
 */

/* Contenedor principal */
.wrs-gallery-container {
  --gallery-spacing: 10px;
  --gallery-item-radius: var(--border-radius, 4px);
  --gallery-overlay-bg: rgba(0, 0, 0, 0.3);
  --gallery-overlay-text: #ffffff;
  --gallery-more-overlay-bg: rgba(0, 0, 0, 0.5);
  --gallery-columns: 6; /* Valor por defecto */
  --star-color: #ffd700; /* Color dorado para las estrellas */

  width: 100%;
  margin: 0 auto;
  padding: 10px 0;
}

/* Cabecera de la galería */
.wrs-gallery-header {
  margin-bottom: 20px;
}

.wrs-gallery-title {
  color: var(--color-name, #e66b19);
  font-size: 32px;
  margin: 0 0 32px 0;
  font-weight: 500;
}

.wrs-gallery-count {
  color: var(--color-text-light, #666666);
  font-size: 14px;
  margin: 0 0 5px 0;
}

.wrs-gallery-product {
  margin: 0 0 15px 0;
}

.wrs-gallery-product a {
  color: var(--color-primary, #e66b19);
  text-decoration: none;
}

.wrs-gallery-product a:hover {
  text-decoration: underline;
}

.wrs-gallery-filters {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.wrs-gallery-sort {
  margin-left: 10px;
  padding: 5px 10px;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--gallery-item-radius);
  background-color: var(--color-white, #ffffff);
  color: var(--color-text, #333333);
}

/* Cuadrícula de imágenes */
.wrs-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), 1fr);
  gap: var(--gallery-spacing);
  margin-bottom: 15px;
}

/* Elementos de la galería */
.wrs-gallery-item {
  position: relative;
  border-radius: var(--gallery-item-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
}

.wrs-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.wrs-gallery-item-inner {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Relación de aspecto cuadrada */
  background-color: var(--color-light-bg, #f9f9f9);
}

.wrs-gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.wrs-gallery-item:hover img {
  transform: scale(1.05);
}

/* Overlay de información */
.wrs-gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--gallery-overlay-bg);
  color: var(--gallery-overlay-text);
  padding: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

/* Overlay para Ver más */
.wrs-gallery-item-more-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gallery-more-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.wrs-gallery-item-more-count {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.wrs-gallery-item:hover .wrs-gallery-item-overlay {
  opacity: 1;
}

/* Cursor para indicar que es clickeable */
.wrs-gallery-item {
  cursor: pointer;
}

/* Estrellas de valoración */
.wrs-gallery-rating {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  padding: 2px 8px;
  pointer-events: none; /* Para que no interfiera con los clics */
}

.wrs-gallery-rating-star {
  color: var(--star-color);
  margin-right: 4px;
}

.wrs-gallery-rating-value {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.wrs-gallery-item-author {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.wrs-gallery-item-product {
  font-size: 12px;
  opacity: 0.9;
}

/* Botón de cargar más */
.wrs-gallery-load-more-container {
  text-align: center;
  margin-top: 20px;
}

.wrs-gallery-load-more {
  background-color: var(--color-primary, #e66b19);
  color: var(--color-white, #ffffff);
  border: none;
  padding: 10px 20px;
  border-radius: var(--gallery-item-radius);
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.wrs-gallery-load-more:hover {
  background-color: var(--color-primary, #e66b19);
  opacity: 0.9;
}

.wrs-gallery-loading {
  display: inline-block;
  margin-top: 10px;
  color: var(--color-text-light, #666666);
}

/* Mensaje de galería vacía */
.wrs-gallery-empty {
  text-align: center;
  padding: 30px;
  background-color: var(--color-light-bg, #f9f9f9);
  border-radius: var(--gallery-item-radius);
  color: var(--color-text-light, #666666);
}

/* Lightbox */
.wrs-gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrs-gallery-lightbox-inner {
  position: relative;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.wrs-gallery-lightbox-content {
  display: flex;
  flex-direction: column;
  background-color: var(--color-white, #ffffff);
  border-radius: var(--gallery-item-radius);
  overflow: hidden;
}

.wrs-gallery-lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.wrs-gallery-lightbox-info {
  padding: 15px;
  background-color: var(--color-white, #ffffff);
}

.wrs-gallery-lightbox-author {
  font-weight: 600;
  font-size: 16px;
  color: var(--color-name, #161616);
  margin-bottom: 5px;
}

.wrs-gallery-lightbox-date {
  font-size: 14px;
  color: var(--color-text-light, #666666);
  margin-bottom: 5px;
}

.wrs-gallery-lightbox-product {
  font-size: 14px;
}

.wrs-gallery-lightbox-product a {
  color: var(--color-primary, #e66b19);
  text-decoration: none;
}

.wrs-gallery-lightbox-product a:hover {
  text-decoration: underline;
}

/* Botones del lightbox */
.wrs-gallery-lightbox-close,
.wrs-gallery-lightbox-prev,
.wrs-gallery-lightbox-next {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.wrs-gallery-lightbox-close:hover,
.wrs-gallery-lightbox-prev:hover,
.wrs-gallery-lightbox-next:hover {
  background-color: var(--color-primary, #e66b19);
}

.wrs-gallery-lightbox-close {
  top: -50px;
  right: 0;
}

.wrs-gallery-lightbox-prev {
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
}

.wrs-gallery-lightbox-next {
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive */
@media (max-width: 1024px) {
  .wrs-gallery-container {
    --gallery-columns: 6;
  }

  .wrs-gallery-lightbox-prev {
    left: 10px;
  }

  .wrs-gallery-lightbox-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .wrs-gallery-container {
    --gallery-columns: 3;
  }
}

@media (max-width: 480px) {
  .wrs-gallery-container {
    --gallery-columns: 2;
  }

  .wrs-gallery-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .wrs-gallery-sort {
    margin-left: 0;
    margin-top: 5px;
    width: 100%;
  }
}
