/* БЛОК: Просмотр изображений и видео */
/* Модальное окно для просмотра изображений */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-viewer.show {
  display: flex;
}
.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  touch-action: pan-x pan-y pinch-zoom;
}
.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.image-viewer-close:active {
  background: rgba(255,255,255,0.3);
}
.image-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.image-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}
.image-viewer-nav:active {
  background: rgba(255, 255, 255, 0.36);
}
.image-viewer-prev {
  left: max(12px, env(safe-area-inset-left, 0px));
}
.image-viewer-next {
  right: max(12px, env(safe-area-inset-right, 0px));
}
.image-viewer-counter {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 768px) {
  .image-viewer-nav {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}

/* Модальное окно для просмотра видео */
.video-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.video-viewer.show {
  display: flex;
}
.video-viewer video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.video-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.video-viewer-close:active {
  background: rgba(255,255,255,0.3);
}

