/* ═══════════════════════════════════════════════════════════════
   ZARA ZOOM LIGHTBOX v3.0 - SCROLL VERTICAL STYLE
   ═══════════════════════════════════════════════════════════════ */

/* Modal base */
.zzw-modal[aria-hidden="true"] {
  display: none;
}

.zzw-modal {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  isolation: isolate;
}

/* Animaciones */
.zzw-modal.zzw-opening .zzw-backdrop {
  animation: zzw-fade-in 0.25s ease-out;
}

.zzw-modal.zzw-opening .zzw-panel {
  animation: zzw-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.zzw-modal.zzw-closing .zzw-backdrop {
  animation: zzw-fade-out 0.2s ease-in;
}

.zzw-modal.zzw-closing .zzw-panel {
  animation: zzw-scale-out 0.2s ease-in;
}

@keyframes zzw-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zzw-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes zzw-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zzw-scale-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* Backdrop */
.zzw-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 0;
}

.zzw-panel {
  position: absolute;
  inset: 0;
  outline: none;
  z-index: 1;
}

/* Close button */
.zzw-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.15s;
}

.zzw-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL - SCROLL VERTICAL COMO ZARA
   ═══════════════════════════════════════════════════════════════ */

.zzw-layout {
  height: 100%;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0;
}

/* Columna de Thumbnails */
.zzw-thumbs {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.5);
  padding: 20px 10px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.zzw-thumbs::-webkit-scrollbar {
  width: 4px;
}

.zzw-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.zzw-thumbs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zzw-thumb {
  width: 80px;
  cursor: pointer;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    outline 0.2s;
  border-radius: 4px;
  overflow: hidden;
  outline: 2px solid transparent;
}

.zzw-thumb:hover {
  opacity: 0.8;
}

.zzw-thumb.zzw-thumb-active {
  opacity: 1;
  outline: 2px solid #fff;
}

.zzw-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════
   ÁREA PRINCIPAL - SCROLL VERTICAL CON TODAS LAS IMÁGENES
   ═══════════════════════════════════════════════════════════════ */

.zzw-main {
  height: 100vh;
  overflow: hidden;
}

.zzw-main-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.zzw-main-scroll::-webkit-scrollbar {
  display: none;
}

/* Cada imagen en el scroll vertical - ajustada al ANCHO */
.zzw-image-item {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0px 40px;
  box-sizing: border-box;
}

/* Contenedor de zoom */
.zzw-zoom-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
  width: 100%;
}

.zzw-zoom-wrap.zzw-zoomed {
  cursor: default;
  overflow: visible;
}

/* Imagen ajustada al ANCHO como Zara */
.zzw-zoom-wrap img {
  width: calc(100vw - 200px);
  max-width: 900px;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.zzw-zoom-wrap.zzw-zoomed img {
  max-width: none;
  max-height: none;
}

/* Hint de zoom */
.zzw-zoom-wrap::after {
  content: "";
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

.zzw-zoom-wrap:hover::after {
  opacity: 1;
}

.zzw-zoom-wrap.zzw-zoomed::after {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .zzw-layout {
    grid-template-columns: 70px 1fr;
  }

  .zzw-thumbs {
    padding: 15px 8px;
  }

  .zzw-thumb {
    width: 54px;
  }

  .zzw-image-item {
    padding: 15px;
  }

  .zzw-zoom-wrap img {
    width: calc(100vw - 100px);
    max-width: none;
  }

  .zzw-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* Prevenir conflictos */
.zzw-modal ~ .pswp,
.zzw-modal ~ .rey-lightbox {
  display: none !important;
  pointer-events: none !important;
}
