.image-preview-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 99999;
}

.image-preview-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.image-preview-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.image-preview-image {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
  -webkit-user-drag: none;
}

.image-preview-overlay.dragging .image-preview-image {
  cursor: grabbing;
}

.image-preview-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.image-preview-bottom-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 6px 10px;
  z-index: 2;
}

.image-preview-nav {
  position: static;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.image-preview-nav svg {
  width: 20px;
  height: 20px;
  display: block;
}

.image-preview-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-preview-counter {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
}

.image-preview-counter.is-hidden,
.image-preview-nav.is-hidden {
  display: none;
}

body.preview-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .image-preview-image {
    max-width: 100vw;
    max-height: 100vh;
  }

  .image-preview-close {
    top: 10px;
    right: 10px;
  }

  .image-preview-bottom-bar {
    bottom: 16px;
  }

  .image-preview-counter {
    font-size: 12px;
  }

  .image-preview-nav {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
}
