/* Image Zoom Viewer - Professional Image Magnifier */

.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  touch-action: none; /* Desactivar zoom nativo del navegador */
  -webkit-user-select: none;
  user-select: none;
}

.zoom-modal.active {
  display: flex;
  opacity: 1;
}

.zoom-container {
  position: relative;
  width: 90vw;
  height: 90vh;
  overflow: hidden;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* Desactivar zoom nativo y otros gestos */
}

.zoom-container.zoomed {
  cursor: grab;
}

.zoom-container.zoomed.panning {
  cursor: grabbing !important;
}

.zoom-container.panning {
  cursor: grabbing !important;
}

.zoom-image {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: none;
  user-select: none;
  touch-action: none; /* Desactivar zoom nativo en la imagen */
  pointer-events: auto;
  -webkit-user-select: none;
  pointer-events: none;
  will-change: transform;
}

/* Close button */
.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.zoom-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.zoom-close::before,
.zoom-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: white;
}

.zoom-close::before {
  transform: rotate(45deg);
}

.zoom-close::after {
  transform: rotate(-45deg);
}

/* Zoom controls */
.zoom-controls {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: white;
  font-size: 20px;
  font-weight: bold;
  user-select: none;
}

.zoom-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.zoom-btn.disabled:hover {
  transform: none;
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Zoom level indicator */
.zoom-level {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Navigation buttons */
.zoom-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
}

.zoom-nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.zoom-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.zoom-nav-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.zoom-nav-prev {
  left: 20px;
}

.zoom-nav-next {
  right: 20px;
}

/* Image counter */
.zoom-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
}

/* Instructions overlay */
.zoom-instructions {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 24px;
  padding-right: 40px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
}

.instructions-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.instructions-close:hover {
  opacity: 1;
}

.zoom-modal.active .zoom-instructions {
  opacity: 1;
  animation: fadeInOut 4s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  10%, 90% { opacity: 1; }
}

/* Carousel image hover effect */
.carousel-slide img {
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.carousel-slide:hover img {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .zoom-container {
    width: 95vw;
    height: 95vh;
  }
  
  .zoom-controls {
    bottom: 40px;
    gap: 8px;
    padding: 8px;
  }
  
  .zoom-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .zoom-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
  }
  
  .zoom-instructions {
    font-size: 12px;
    padding: 10px 40px 10px 20px;
    max-width: 90%;
    white-space: normal;
    text-align: center;
    top: 60px;
  }
  
  .instructions-close {
    width: 20px;
    height: 20px;
    font-size: 20px;
    right: 6px;
  }
  
  .zoom-nav-btn {
    width: 40px;
    height: 40px;
  }
  
  .zoom-nav-prev {
    left: 10px;
  }
  
  .zoom-nav-next {
    right: 10px;
  }
  
  .zoom-counter {
    top: 15px;
    left: 15px;
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Loading spinner */
.zoom-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
