/* Слайдер главной галереи на странице товара */
.product-image-slider {
  position: relative;
  overflow: hidden;
}

/* Единый размер фото-галереи на всех страницах товаров (десктоп).
   aspect-ratio: 584 / 640 — пропорция эталонной страницы kolagen_27-27.html
   (форм-фактор, подобранный клиентом). При container 1232px и gap 64px
   ширина правой колонки = (1232-64)/2 = 584px → высота 640px. */
@media (min-width: 1025px) {
  .gallery-photo.product-image-slider {
    aspect-ratio: 584 / 640;
    height: auto !important;   /* перебивает inline-style от старого JS-синка */
  }
  .product-gallery {
    height: auto !important;
  }
}

.product-image-slider .install-slider {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.product-image-slider .install-slider::-webkit-scrollbar { display: none; }
.product-image-slider .install-slider img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  display: block;
}

/* Кнопки и точки — на случай если на странице ещё нет общих правил */
.product-image-slider .slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.95);
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #111);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.product-image-slider:hover .slider-btn { opacity: 1; }
.product-image-slider .slider-btn:hover { background: var(--canvas, #fff); }
.product-image-slider .slider-btn.prev { left: 10px; }
.product-image-slider .slider-btn.next { right: 10px; }
.product-image-slider .slider-btn svg { width: 18px; height: 18px; }
.product-image-slider .slider-btn[disabled] { opacity: 0.3 !important; cursor: default; pointer-events: none; }

.product-image-slider .slider-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
  padding: 6px 10px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
}
.product-image-slider .slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
}
.product-image-slider .slider-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* Подсказка "клик — увеличить" + курсор */
.product-image-slider .install-slider img { cursor: zoom-in; }

/* ====== Лайтбокс ====== */
.pis-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.pis-lightbox.open { display: flex; }
body.pis-lightbox-open { overflow: hidden; }

.pis-lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.pis-lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: background 0.15s, transform 0.15s;
}
.pis-lightbox-btn:hover { background: #fff; transform: scale(1.05); }
.pis-lightbox-btn[disabled] { opacity: 0.3; pointer-events: none; }
.pis-lightbox-btn svg { width: 24px; height: 24px; }

.pis-lightbox-close { top: 20px; right: 20px; width: 48px; height: 48px; }
.pis-lightbox-prev,
.pis-lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.pis-lightbox-prev { left: 24px; }
.pis-lightbox-next { right: 24px; }

.pis-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

@media (max-width: 768px) {
  .pis-lightbox-prev,
  .pis-lightbox-next { width: 44px; height: 44px; }
  .pis-lightbox-prev { left: 8px; }
  .pis-lightbox-next { right: 8px; }
  .pis-lightbox-close { top: 8px; right: 8px; width: 40px; height: 40px; }
}

/* Счётчик фото в углу */
.product-image-slider .install-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 9999px;
  z-index: 2;
  pointer-events: none;
}
