/* ==================== ЛАЙТБОКС ==================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  background: rgba(0, 0, 0, 0.96);
  pointer-events: all;
}

.lightbox__image {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: absolute;
  top: 25px;
  right: 35px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__prev {
  left: 35px;
}

.lightbox__next {
  right: 35px;
}

.lightbox__counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 10001;
}

/* Для изображений, которые можно открыть в лайтбоксе */
.lightbox-trigger,
.trade-item__image,
.trade-card__img,
.topic-media-gallery img,
.guide-article__image img,
.news-card__image img,
.media-preview img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.lightbox-trigger:hover,
.trade-item__image:hover,
.trade-card__img:hover,
.topic-media-gallery img:hover,
.guide-article__image img:hover,
.news-card__image img:hover,
.media-preview img:hover {
  transform: scale(1.02);
}

.trade-item__image,
.trade-card__img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trade-item__image:hover,
.trade-card__img:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {

  .lightbox__prev,
  .lightbox__next {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox__prev {
    left: 15px;
  }

  .lightbox__next {
    right: 15px;
  }

  .lightbox__close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox__image {
    max-width: 95%;
    max-height: 80%;
  }
}