.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  user-select: none;
}
.lb-overlay.lb-open {
  opacity: 1;
}

.lb-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.lb-overlay.lb-open .lb-content {
  transform: scale(1);
  opacity: 1;
}

.lb-image {
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
}
.lb-image.lb-loading {
  opacity: 0;
}

/* Кнопки */
.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}
.lb-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.lb-close {
  top: 20px;
  right: 20px;
  position: fixed;
}

.lb-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lb-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: sans-serif;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Скрываем стрелки, если одно изображение */
.lb-single .lb-prev,
.lb-single .lb-next,
.lb-single .lb-counter {
  display: none;
}

@media (max-width: 600px) {
  .lb-btn { width: 42px; height: 42px; font-size: 20px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: 10px; right: 10px; }
}

/* Блокировка скролла body */
body.lb-locked {
  overflow: hidden;
}