/* 1. Базовые настройки параграфа */
.paragraph--type--gallery .header {
  font-size: 48px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 37px;
}

@media (max-width: 767px) {
  .paragraph--type--gallery .header {
    font-size: 25px;
    margin-bottom: 15px;
  }
}

/* 2. Обертка и контейнер ленты */
.photoswipe-gallery-wrapper {
  position: relative;
  margin: 20px 0;
  --gap: 15px;
}

.photoswipe-gallery-wrapper .photoswipe-gallery {
  display: flex !important;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: visible !important;
  
  /* УБИРАЕМ это свойство, так как JS scrollTo({behavior: 'smooth'}) сам управляет плавностью */
  /* scroll-behavior: smooth; */ 
  
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 15px 0 25px 0; 
  margin-top: -15px; 
  scrollbar-width: none;
}

.photoswipe-gallery-wrapper .photoswipe-gallery::-webkit-scrollbar {
  display: none;
}

/* 3. Карточки (Элементы галереи) */
.photoswipe-gallery-wrapper .photoswipe-gallery .field__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /*transition: transform 0.3s ease;*/
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.photoswipe-gallery-wrapper .photoswipe-gallery .field__item img {
  display: block;
  width: auto;
  height: 461px;
  max-width: 85vw;
  object-fit: cover;
  border-radius: 16px;
  /*box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);*/
}

/* 4. Эффект наведения (Hover) — только для десктопов */
@media (hover: hover) {
  .photoswipe-gallery-wrapper .photoswipe-gallery .field__item:hover {
    transform: translateY(-5px); 
    z-index: 2; 
  }
  
  .photoswipe-gallery-wrapper .photoswipe-gallery .field__item:hover img {
    /*box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);*/
  }
}

/* 5. Кнопки навигации (Стеклянный стиль) */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: opacity 0.4s ease, visibility 0.4s ease, background 0.3s ease, transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.nav-btn:disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* 6. Прогресс-бар */
.gallery-progress-bar {
  width: 350px;
  height: 3px;
  background: rgba(0, 0, 0, 0.05);
  margin: 0 auto;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.gallery-progress-thumb {
  position: absolute;
  height: 100%;
  width: 30%;
  background: rgba(255, 180, 104, 1);
  border-radius: 10px;
  left: 0;
  /* Плавное движение ползунка */
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  transform-origin: left;
}

/* 7. Адаптивность для мобильных */
@media (max-width: 768px) {
  .photoswipe-gallery-wrapper .photoswipe-gallery .field__item img {
    height: 380px; 
  }

  .nav-btn {
    display: none !important;
  }

  .photoswipe-gallery-wrapper .photoswipe-gallery {
    padding-bottom: 25px;
    gap: 12px;
  }
  
  .gallery-progress-bar {
    width: 220px;
  }
}
