/* .............................................................. Фотогалерея внутри слайдера */

*{box-sizing:border-box}

/* ===== Общий контейнер слайдера ===== */
.slider-gallery{
  width:100%;
}

@media (max-width: 767px){
    .slider-gallery{
        padding-left: 12px;
    }
}

.slider-gallery__viewport{
  width:100%;
  overflow:hidden;
  position:relative;
  touch-action: pan-y;
}
.slider-gallery__track{
  display:flex;
  gap: 30px;
  transition:transform .45s cubic-bezier(.22,.61,.36,1);
  will-change:transform;
  padding:4px;
}

.slider-gallery__card{
  position:relative;
  flex:0 0 auto;
  border-radius:12px;
  overflow:hidden;
  cursor:pointer;
  background:#ddd;
  user-select:none;
  display:block;
}
.slider-gallery__card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .5s ease;
  pointer-events:none;
  -webkit-user-drag:none;
}
.slider-gallery__card:hover img{transform:scale(1.05)}

.slider-gallery__caption{
  position:absolute;
  left:0; right:0; bottom:0;
  padding:100px 14px 12px;
  color:#fff;
  font-size:20px;
  line-height: 26px;
  background:linear-gradient(transparent, rgb(0 0 0 / 94%));
  text-align:left;
  pointer-events:none;
}

/* ===== Пагинация слайдера ===== */
.slider-gallery__pagination{
  position:relative;
  width:150px;
  margin:18px auto 0;
  overflow:hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 28px,
    #000 calc(100% - 28px),
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 28px,
    #000 calc(100% - 28px),
    transparent 100%
  );
}

.slider-gallery__pagination-inner{
  display:flex;
  align-items:center;
  gap:8px;
  padding:2px 0;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.slider-gallery__pagination-inner::-webkit-scrollbar{
  display:none;
}

/* Псевдо-отступы: позволяют любой точке (в т.ч. первой и последней)
   встать точно в центр видимой области. */
.slider-gallery__pagination-inner::before,
.slider-gallery__pagination-inner::after{
  content:"";
  flex:0 0 auto;
  width: calc(50% - 5px);
}

.slider-gallery__dot{
  width:16px;
  height:16px;
  border-radius:50%;
  background:#c9c9cf;
  border:none;
  padding:0;
  cursor:pointer;
  flex:0 0 auto;
}
.slider-gallery__dot.is-active{
  background:#115EFB;
}

/* ===== На мобиле: одна карточка на всю ширину без отступов трека ===== */
@media (max-width: 767px){
  .slider-gallery__track{
    padding: 0;
    gap: 16px;
  }
}

/* ===== Лайтбокс ===== */
.lightbox-gallery{
  position:fixed;
  inset:0;
  background:rgba(10,10,12,.94);
  z-index:9999;
  display:none;
  flex-direction:column;
  opacity:0;
  transition:opacity .25s ease;
}
.lightbox-gallery.is-open{display:flex}
.lightbox-gallery.is-visible{opacity:1}

.lightbox-gallery__stage{
  flex:1;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  margin: 0 auto;
}

@media (min-width: 992px) and (max-width: 1399px){
    .lightbox-gallery__stage{
        padding-top: 30px;
    }
}

@media (min-width: 992px) and (max-width: 1199px){
    .lightbox-gallery__stage, .lightbox-gallery__thumbs{ width: 800px; }
}
@media (min-width: 1200px) and (max-width: 1399px){
    .lightbox-gallery__stage, .lightbox-gallery__thumbs{ width: 1000px; }
}
@media (min-width: 1400px) and (max-width: 1999px){
    .lightbox-gallery__stage, .lightbox-gallery__thumbs{ width: 1150px; }
}

.lightbox-gallery__imgwrap{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  align-items: end;
  justify-content:center;
  min-height:0;
  min-width:0;
}

@media (max-width: 767px){
    .lightbox-gallery__imgwrap{
        height: auto;
    }
}

.lightbox-gallery__img{
  max-width:100%;
  max-height:100%;
  width:100%;
  height:auto;
  object-fit:cover;
  border-radius:8px;
  display:block;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
  user-select:none;
}

.lightbox-gallery__caption{
    position:absolute;
    left:0; right:0; bottom:0;
    padding:60px 30px 30px;
    color:#fff;
    font-weight: 400;
    font-size: 20px;
    line-height: 26px;
    letter-spacing: 0%;
    background:linear-gradient(transparent, rgba(0,0,0,.8));
    border-radius:0 0 8px 8px;
    text-align:left;
    pointer-events:none;
}

@media (max-width: 991px){
    .lightbox-gallery__caption{
        padding: 20px 10px 10px;
        font-size: 16px;
        line-height: 20px;
    }
}

.lightbox-gallery__nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:58px;
  height:58px;
  border-radius:50%;
  border:2px solid #ffffff9c;
  background:rgba(0,0,0,.35);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:background .2s, transform .2s;
  backdrop-filter:blur(4px);
}
.lightbox-gallery__nav:hover{background:rgba(255,255,255,.18)}
.lightbox-gallery__nav:active{transform:translateY(-50%) scale(.94)}
.lightbox-gallery__nav svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lightbox-gallery__prev{left:-82px}
.lightbox-gallery__next{right:-82px}

@media (max-width: 991px){
    .lightbox-gallery__nav{
        display: none;
    }
}

/* ===== Превью-полоса лайтбокса ===== */
.lightbox-gallery__thumbs{
  flex:0 0 auto;
  max-width:100%;
  margin:30px auto 0;
  overflow:hidden;
  touch-action: pan-y;
}
.lightbox-gallery__thumbs-track{
  display:flex;
  gap:35px;
  padding:2px 0;
  will-change:transform;
  transition:transform .45s cubic-bezier(.22,.61,.36,1);
}

.lightbox-gallery__thumb{
  flex:0 0 auto;
  width:188px;
  height:105px;
  overflow:hidden;
  cursor:pointer;
  opacity:.5;
  border:2px solid transparent;
  transition:opacity .2s, border-color .2s;
  padding:0;
  background:#222;
  user-select:none;
}
.lightbox-gallery__thumb img{
  width:100%;height:100%;object-fit:cover;display:block;
  pointer-events:none;
  -webkit-user-drag:none;
}
.lightbox-gallery__thumb:hover{opacity:.85}
.lightbox-gallery__thumb.is-active{opacity:1;border-color:#115EFB}

/* ===== Пагинация лайтбокса ===== */
.lightbox-gallery__pagination{
  position:relative;
  width:150px;
  margin:24px auto 40px;
  overflow:hidden;
  flex:0 0 auto;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 28px,
    #000 calc(100% - 28px),
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 28px,
    #000 calc(100% - 28px),
    transparent 100%
  );
}

.lightbox-gallery__pagination-inner{
  display:flex;
  align-items:center;
  gap:8px;
  padding:2px 0;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-behavior:smooth;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.lightbox-gallery__pagination-inner::-webkit-scrollbar{
  display:none;
}

/* Псевдо-отступы: крайние точки тоже встают в центр */
.lightbox-gallery__pagination-inner::before,
.lightbox-gallery__pagination-inner::after{
  content:"";
  flex:0 0 auto;
  width: calc(50% - 5px);
}

.lightbox-gallery__dot{
  width:16px;
  height:16px;
  border-radius:50%;
  background:#c9c9cf;
  border:none;
  padding:0;
  cursor:pointer;
  flex:0 0 auto;
}
.lightbox-gallery__dot.is-active{
  background:#115EFB;
  border-radius:6px;
}

.lightbox-gallery__close{
  position:absolute;
  top:16px;right:16px;
  width:44px;height:44px;
  border-radius:50%;
  border: 2px solid #ffffff9c;
  background:rgba(0,0,0,.35);
  color:#fff;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .2s;
  z-index:2;
}
.lightbox-gallery__close:hover{background:rgba(255,255,255,.18)}
.lightbox-gallery__close svg{width:18px;height:18px;stroke:#fff;stroke-width:2;stroke-linecap:round}

/* ===== Лупа ===== */
.lightbox-gallery__loupe{
  position:absolute;
  width:220px;
  height:220px;
  border-radius:50%;
  pointer-events:none;
  background-repeat:no-repeat;
  border:2px solid rgba(255,255,255,.6);
  box-shadow:0 8px 30px rgba(0,0,0,.55);
  opacity:0;
  transform:scale(.85);
  transition:opacity .15s ease, transform .15s ease;
  z-index:5;
  display:none;
}
.lightbox-gallery__loupe.is-active{
  opacity:1;
  transform:scale(1);
}
/* Показываем лупу только на десктопе и только у устройства с мышью */
@media (hover: hover) and (pointer: fine) and (min-width: 992px){
  .lightbox-gallery__loupe{ display:block; }
}

@media (max-width:767px){
  .lightbox-gallery__stage{padding:60px 12px 6px; width:auto}
  .lightbox-gallery__nav{width:42px;height:42px}
  .lightbox-gallery__prev{left:6px}
  .lightbox-gallery__next{right:6px}
  .lightbox-gallery__thumb{width:120px;height:68px}
  .lightbox-gallery__thumbs-track{gap:14px}
}