/* ============================================
   ГАЛЕРЕЯ "ДО/ПОСЛЕ" С ИНТЕРАКТИВНЫМ ПОЛЗУНКОМ
   ============================================ */

/* Основная обёртка галереи */
.ba-slider-wrapper {
  position: relative;
  padding: 0 60px;
  margin-bottom: 50px;
}

/* Контейнер для страниц */
.ba-grid-container {
  position: relative;
  overflow: hidden;
}

/* Страницы галереи */
.ba-page {
  display: none;
  animation: fadeIn 0.5s ease;
}

.ba-page.active {
  display: block;
}

/* Анимация появления страницы */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   БЛОКИ СРАВНЕНИЯ "ДО/ПОСЛЕ"
   ============================================ */

.ba-mix {
  position: relative;
  width: 100%;
  height: 450px;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
}

.ba-mix:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Изображения до и после */
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

/* Маска для изображения "после" */
.ba-posle {
  mask-image: linear-gradient(to right, transparent 50%, black 50%);
  -webkit-mask-image: linear-gradient(to right, transparent 50%, black 50%);
}

/* ============================================
   ИНТЕРАКТИВНЫЙ ПОЛЗУНОК
   ============================================ */

.ba-slider {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
}

/* Центральная ручка управления */
.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 5;
  transition: transform 0.2s ease;
}

.ba-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Иконка стрелок на ручке */
.ba-handle::before {
  content: '↔';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

/* ============================================
   НАВИГАЦИЯ СТРЕЛКАМИ
   ============================================ */

.ba-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  color: #333;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  outline: none;
}

.ba-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ba-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.ba-nav-prev {
  left: 0;
}

.ba-nav-next {
  right: 0;
}

/* ============================================
   ТОЧКИ НАВИГАЦИИ
   ============================================ */

.ba-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.ba-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(200, 200, 200, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ba-dot:hover {
  background: rgba(200, 200, 200, 0.8);
  transform: scale(1.2);
}

.ba-dot.active {
  width: 30px;
  border-radius: 6px;
  background: #333;
}

/* ============================================
   АДАПТИВНЫЙ ДИЗАЙН
   ============================================ */

/* Планшеты */
@media (max-width: 991px) {
  .ba-mix {
    height: 400px;
  }
}

/* Мобильные устройства */
@media (max-width: 767px) {
  .ba-slider-wrapper {
    padding: 0 40px;
  }

  .ba-mix {
    height: 350px;
  }

  .ba-handle {
    width: 44px;
    height: 44px;
  }

  .ba-handle::before {
    font-size: 20px;
  }

  .ba-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Маленькие экраны */
@media (max-width: 480px) {
  .ba-slider-wrapper {
    padding: 0 30px;
  }

  .ba-mix {
    height: 300px;
  }

  .ba-nav {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
}
