figure.image {
  max-width: 700px;
  margin: 10px auto;
}
figure.image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* === Галерея-карусель === */
.gallery-wrapper {
  position: relative;
  max-width: 600px; /* Уменьшено с 1200px для меньшей видимой области */
  margin: 20px auto;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  width: 100%;
}

.gallery {
  display: flex !important;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease-in-out;
  padding: 0 10px;
  will-change: transform;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  /* Убираем min-width: max-content - это вызывает проблемы с позиционированием */
  justify-content: flex-start !important; /* Принудительно убираем центрирование */
}

/* Миниатюры — ЖЁСТКО задаём размер */
.gallery img,
.gallery .video img {
  flex: 0 0 auto;
  display: block;
  width: 200px !important;
  height: 140px !important;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery img:hover,
.gallery .video img:hover {
  transform: scale(1.03);
}

/* Принудительно устанавливаем размер для всех изображений в галерее */
.gallery img {
  min-width: 200px !important;
  min-height: 140px !important;
  max-width: 200px !important;
  max-height: 140px !important;
  width: 200px !important;
  height: 140px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

/* Видео-плитка */
.video {
  position: relative;
  min-width: 200px;
  height: 140px;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: white;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Стрелки карусели */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.3s;
}
.carousel-btn:hover { background: rgba(0, 0, 0, 0.5); }
.carousel-btn.left { left: 5px; }
.carousel-btn.right { right: 5px; }

/* === Lightbox === */
.lightbox {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.8) !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 9999 !important;
}

/* Контент Lightbox */
#lightbox-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  z-index: 1005;
}

/* Дополнительное центрирование для видео */
#lightbox-content iframe {
  flex-shrink: 0;
  align-self: center;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Видео полностью отцентрировано */
.lightbox iframe {
  width: 80vw !important;
  height: 45vw !important;
  max-width: 1000px !important;
  max-height: 90vh !important;
  display: block !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Кнопка закрытия */
.lightbox .close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 36px;
  color: white;
  cursor: pointer;
  z-index: 1015;
}

/* Стрелки в Lightbox */
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  z-index: 1010;
  transition: background 0.3s;
}
.lightbox-btn:hover { background: rgba(0, 0, 0, 0.5); }
.lightbox-btn.left { left: 20px; }
.lightbox-btn.right { right: 20px; }

/* Зоны клика — если используешь */
.lightbox-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 1001;
  cursor: pointer;
  background: transparent;
  pointer-events: auto;
}

/* Чтобы не блокировать клики по контенту */
#lightbox-content img,
#lightbox-content iframe {
  position: relative;
  z-index: 1012;
  pointer-events: auto;
}

/* === ВАЖНО: ограничиваем HERO-фото, чтобы не казалось «огромным» === */
figure.image img {
  display: block;
  max-width: 700px;    /* не шире карусели */
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* === Fix hero image size & center === */
figure.image {
  max-width: 700px;
  margin: 10px auto;
  display: block;
}

figure.image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

figure.image {
  max-width: 700px !important;
  margin: 10px auto !important;
  display: block !important;
}
figure.image {
  max-width: 700px;
  margin: 10px auto;
  display: block;
}
figure.image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.accordion-content img.lazy {
  max-width: 700px !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
}

#overview .accordion-content img.hero{
  max-width:700px;width:100%;height:auto;display:block;margin:0 auto;border-radius:8px;
}

/* Центрируем все изображения в блоках */
.accordion-content img {
  display: block;
  margin: 0 auto;
}



/* === МОБИЛЬНЫЕ СТИЛИ === */
@media (max-width: 768px) {
  .gallery-wrapper {
    max-width: 80% !important; /* Уменьшено на 20% с 100% */
    margin: 10px auto !important; /* Центрируем */
    padding: 0 10px !important;
  }
  
  .gallery img,
  .gallery .video img {
    width: 150px !important;
    height: 105px !important;
    min-width: 150px !important;
    min-height: 105px !important;
    max-width: 150px !important;
    max-height: 105px !important;
  }
  
  .video {
    min-width: 150px;
    height: 105px;
  }
  
  .gallery {
    gap: 6px !important;
    padding: 0 5px !important;
  }
}

@media (max-width: 480px) {
  .gallery-wrapper {
    max-width: 80% !important; /* Уменьшено на 20% с 100% */
    margin: 10px auto !important; /* Центрируем */
    padding: 0 5px !important;
  }
  
  .gallery img,
  .gallery .video img {
    width: 120px !important;
    height: 84px !important;
    min-width: 120px !important;
    min-height: 84px !important;
    max-width: 120px !important;
    max-height: 84px !important;
  }
  
  .video {
    min-width: 120px;
    height: 84px;
  }
  
  .gallery {
    gap: 4px !important;
    padding: 0 3px !important;
  }
}




