/* ===== Universal Slider — product gallery ===== */
/* Перебиваем home2 .hero__* (display:none на слайдах, nav opacity:0, fixed height) */

.product-top__gallery {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

body.home2-page .product-gallery-slider.hero__slider,
.product-gallery-slider.hero__slider,
.product-gallery-slider {
  position: relative !important;
  display: block !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  user-select: none;
  -webkit-user-select: none;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  background: #fff !important;
  background-color: #fff !important;
  border: 1px solid #e8e4dc;
  box-shadow: none !important;
  cursor: grab;
}

/* Desktop: не растягивать вертикальные фото на весь экран */
@media (min-width: 768px) {
  body.home2-page .product-top__gallery,
  .product-top__gallery {
    max-width: 640px !important;
  }

  body.home2-page .product-gallery-slider.hero__slider,
  .product-gallery-slider.hero__slider,
  .product-gallery-slider {
    max-width: 640px !important;
    max-height: 520px !important;
  }

  body.home2-page .product-gallery-slider .hero__slide.active,
  .product-gallery-slider .hero__slide.active {
    max-height: 520px !important;
  }

  body.home2-page .product-gallery-slider .hero__image-wrap,
  .product-gallery-slider .hero__image-wrap {
    max-width: 640px !important;
    max-height: 520px !important;
  }

  body.home2-page .product-gallery-slider .hero__image-wrap img,
  .product-gallery-slider .hero__image-wrap img {
    max-width: 640px !important;
    max-height: 520px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto;
    object-fit: contain !important;
  }
}

/* Все слайды участвуют; неактивные — absolute. home2: .hero__slide{display:none!important} */
body.home2-page .product-gallery-slider .hero__slide,
.product-gallery-slider .hero__slide {
  display: block !important;
  grid-area: auto !important;
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: 0 !important;
  pointer-events: none !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
  background: transparent !important;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* home2: .hero__slide:first-child { display:grid; opacity:1 } — сбрасываем */
body.home2-page .product-gallery-slider .hero__slide:first-child,
.product-gallery-slider .hero__slide:first-child {
  display: block !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.home2-page .product-gallery-slider .hero__slide.active,
body.home2-page .product-gallery-slider .hero__slide:first-child.active,
.product-gallery-slider .hero__slide.active,
.product-gallery-slider .hero__slide:first-child.active {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 1 !important;
  pointer-events: auto !important;
  height: auto !important;
  width: 100% !important;
}

body.home2-page .product-gallery-slider .hero__image-wrap,
.product-gallery-slider .hero__image-wrap {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  display: block !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.product-gallery-slider .hero__image-wrap::after {
  display: none !important;
  content: none !important;
}

body.home2-page .product-gallery-slider .hero__image-wrap img,
.product-gallery-slider .hero__image-wrap img,
body.home2-page .product-gallery-slider .hero__slide.active .hero__image-wrap img {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  animation: none !important;
  z-index: auto !important;
}

.product-gallery-slider .hero__overlay {
  display: none !important;
}

/* Стрелки — home2 mobile ставит opacity:0; pointer-events:none */
body.home2-page .product-gallery-slider .hero__nav,
.product-gallery-slider .hero__nav {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 30 !important;
  width: 44px !important;
  height: 44px !important;
  border: none !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.product-gallery-slider .hero__nav:hover,
.product-gallery-slider .hero__nav:active {
  background: #fff !important;
  opacity: 1 !important;
}

.product-gallery-slider .hero__nav--prev { left: 10px !important; }
.product-gallery-slider .hero__nav--next { right: 10px !important; }

.product-gallery-slider .hero__nav svg {
  width: 22px !important;
  height: 22px !important;
  pointer-events: none !important;
  opacity: 1 !important;
}

.product-gallery-slider .hero__nav svg path {
  stroke: #333 !important;
  stroke-width: 2.2;
}

/* Точки поверх фото, снизу по центру */
.product-gallery-pagination {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.product-gallery-pagination .hero__pag-item {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
}

.product-gallery-pagination .hero__pag-item.active {
  background: #9D855F;
  transform: scale(1.15);
}

.uslider--dragging { cursor: grabbing !important; }
.uslider--dragging img { pointer-events: none; }

.product-gallery-slider[data-single] .hero__nav,
.product-gallery-pagination[data-single] {
  display: none !important;
}

@media (max-width: 767px) {
  .product-top__gallery {
    padding: 0;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  body.home2-page .main-content .product-gallery-slider.hero__slider,
  body.home2-page .product-gallery-slider.hero__slider,
  .product-gallery-slider.hero__slider,
  .product-gallery-slider {
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
  }

  body.home2-page .main-content .product-gallery-slider .hero__slide.active,
  body.home2-page .product-gallery-slider .hero__slide.active,
  .product-gallery-slider .hero__slide.active {
    max-height: none !important;
    width: 100% !important;
    height: auto !important;
  }

  body.home2-page .main-content .product-gallery-slider .hero__image-wrap,
  body.home2-page .main-content .hero__image-wrap,
  body.home2-page .product-gallery-slider .hero__image-wrap,
  .product-gallery-slider .hero__image-wrap {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  body.home2-page .main-content .product-gallery-slider .hero__image-wrap img,
  body.home2-page .main-content .product-gallery-slider .hero__slide.active .hero__image-wrap img,
  body.home2-page .product-gallery-slider .hero__image-wrap img,
  body.home2-page .product-gallery-slider .hero__slide.active .hero__image-wrap img,
  .product-gallery-slider .hero__image-wrap img {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto !important;
    border-radius: 16px !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  body.home2-page .product-gallery-slider .hero__nav,
  .product-gallery-slider .hero__nav {
    width: 40px !important;
    height: 40px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  .product-gallery-slider .hero__nav--prev { left: 6px !important; }
  .product-gallery-slider .hero__nav--next { right: 6px !important; }

  .product-gallery-pagination {
    gap: 6px;
    bottom: 10px;
    padding: 0;
  }

  .product-gallery-pagination .hero__pag-item {
    width: 9px;
    height: 9px;
  }
}
