/* Visor publico: ajustes de encuadre y experiencia tactil. */
.lmain {
  min-width: 0;
  min-height: 0;
  z-index: 1;
}

.lmain img.lmain-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lzoom-open {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 12;
  min-height: 42px;
  padding: .58rem .78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  border: 1px solid rgba(248, 221, 123, .34);
  border-radius: 999px;
  background: rgba(0, 0, 0, .7);
  color: #f8dd7b;
  font-family: 'Montserrat', sans-serif;
  font-size: .56rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.lzoom-open > span:first-child {
  font-size: 1.05rem;
  line-height: 1;
}

.lmobile-hint {
  display: none;
}

/* Visor inmersivo */
.gallery-zoom {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  color: #fff;
  overscroll-behavior: contain;
  touch-action: none;
}

.gallery-zoom.open {
  display: block;
}

body.gallery-zoom-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.gz-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(212, 168, 67, .055), transparent 52%),
    #000;
  touch-action: none;
}

.gz-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.gz-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: calc(.65rem + env(safe-area-inset-top)) .8rem .65rem;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: .7rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.gz-control,
.gz-counter {
  pointer-events: auto;
}

.gz-control {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.gz-close {
  font-size: 1.65rem;
  font-weight: 200;
}

.gz-reset {
  font-size: .56rem;
  letter-spacing: .08em;
  color: #f8dd7b;
}

.gz-counter {
  justify-self: center;
  min-height: 34px;
  padding: .5rem .8rem;
  border: 1px solid rgba(212, 168, 67, .28);
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: rgba(255, 255, 255, .9);
  font-family: 'Montserrat', sans-serif;
  font-size: .58rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.gz-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(0, 0, 0, .5);
  color: rgba(255, 255, 255, .88);
  font-size: 1.6rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.gz-prev {
  left: max(.65rem, env(safe-area-inset-left));
  border-radius: 999px;
}

.gz-next {
  right: max(.65rem, env(safe-area-inset-right));
  border-radius: 999px;
}

.gz-hint {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 5;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: .52rem .78rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: rgba(255, 255, 255, .72);
  font-family: 'Montserrat', sans-serif;
  font-size: .54rem;
  letter-spacing: .08em;
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity .2s ease;
  backdrop-filter: blur(8px);
}

.gallery-zoom.is-magnified .gz-hint {
  opacity: 0;
}

@media (max-width: 768px) {
  .lbox,
  .ll {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .ll {
    flex-direction: column;
  }

  .lmc {
    flex: 0 0 64vh;
    flex-basis: 64dvh;
    width: 100%;
    height: 64vh;
    height: 64dvh;
    min-width: 0;
    min-height: 0;
    isolation: isolate;
  }

  .ld-top {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex: 0 0 calc(48px + env(safe-area-inset-top));
    height: calc(48px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: #080808;
    border-bottom: 1px solid rgba(212, 168, 67, .14);
    z-index: 20;
  }

  .lclose {
    top: calc(6px + env(safe-area-inset-top));
    right: .55rem;
    width: 38px;
    height: 38px;
    z-index: 24;
    font-size: 1.35rem;
    border-color: rgba(212, 168, 67, .42);
    background: rgba(8, 8, 8, .9);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  }

  .ldnav {
    width: 38px;
    height: 38px;
  }

  .ldpos {
    max-width: calc(100vw - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .52rem;
  }

  .lmain {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    padding: .35rem .45rem;
    background: #000;
  }

  .lmain img.lmain-photo {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .lhit,
  .la {
    display: none !important;
  }

  .lcount {
    left: .75rem;
    bottom: calc(74px + .7rem);
    transform: none;
    min-height: 34px;
    display: flex;
    align-items: center;
    font-size: .52rem;
    z-index: 12;
  }

  .lzoom-open {
    right: .75rem;
    bottom: calc(74px + .7rem);
    min-width: 44px;
    min-height: 44px;
    border-color: rgba(248, 221, 123, .48);
    background: rgba(8, 8, 8, .9);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  }

  .lths {
    flex: 0 0 74px;
    width: 100%;
    height: 74px;
    padding: .45rem .8rem .55rem;
    scroll-snap-type: x proximity;
    position: relative;
    z-index: 4;
  }

  .lth,
  .lth-vid {
    width: 50px;
    height: 60px;
    scroll-snap-align: center;
  }

  .lic {
    flex: 0 0 36vh;
    flex-basis: 36dvh;
    width: 100%;
    height: 36vh;
    height: 36dvh;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    border-top: 1px solid rgba(212, 168, 67, .18);
    border-left: 0;
  }

  .lit {
    min-height: 0;
    padding: 1rem 1rem .8rem;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .lit::-webkit-scrollbar {
    display: none;
  }

  .lac {
    position: relative;
    flex: 0 0 auto;
    padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom));
    background: #090909;
    border-top: 1px solid rgba(212, 168, 67, .14);
  }

  .l-bfav,
  .l-bwa {
    min-height: 44px;
  }

  .gz-stage {
    padding: calc(60px + env(safe-area-inset-top)) 0 calc(58px + env(safe-area-inset-bottom));
  }

  .gz-nav {
    width: 44px;
    height: 52px;
    opacity: .82;
  }
}

@media (max-width: 480px) {
  .lmc {
    flex-basis: 66dvh;
    height: 66dvh;
  }

  .lic {
    flex-basis: 34dvh;
    height: 34dvh;
  }

  .lzoom-open > span:last-child {
    display: none;
  }

  .lzoom-open {
    width: 44px;
    padding: 0;
  }

  .gz-nav {
    top: auto;
    bottom: calc(.8rem + env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
  }

  .gz-hint {
    bottom: calc(1.05rem + env(safe-area-inset-bottom));
    font-size: .5rem;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .lmc {
    flex-basis: 100dvh;
    height: 100dvh;
  }

  .lic {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gz-image,
  .gz-hint {
    transition: none !important;
  }
}
