/* =========================================
   COMPARISON SLIDER STYLES
   ========================================= */

   .dp-before-after-section {
    padding: 80px 0;
    background-color: #ffffff;
    font-family: 'PP Neue Montreal', sans-serif;
}

.dp-before-after-section .dp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- Headers --- */
.dp-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.dp-heading-lg {
    font-size: 48px;
    font-weight: 400;
    margin-bottom: 20px;
    color: #121212;
    line-height: 1.1;
}

.dp-text-desc {
    font-size: 18px;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Layout Grid --- */
.dp-ba-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки как в оригинале */
    gap: 20px;
}

.dp-ba-item {
    width: 100%;
}

/* --- Slider Core Logic (ВАЖНО!) --- */
.dp-ba-slider {
    position: relative;
    width: 100%;
    /* Пропорция 1:1 или другая, зависит от картинок. 
       Здесь ставим padding-bottom, чтобы блок имел высоту до загрузки картинок */
    padding-bottom: 100%; 
    overflow: hidden;
    border-radius: 20px;
    background-color: #f0f0f0;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Images --- */
.dp-ba-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Скрывает лишнюю часть картинки */
}

.dp-ba-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Картинка всегда 100% ширины контейнера */
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Чтобы не таскать картинку */
}

/* Левая картинка (Before) - она будет обрезаться шириной блока */
.dp-img-left {
    width: 50%; /* Стартовое значение */
    z-index: 2;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

/* Правая картинка (After) - лежит под низом на всю ширину */
.dp-img-right {
    z-index: 1;
}

/* --- Range Input (Controller) --- */
input.dp-ba-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0; /* Невидимый, но кликабельный */
    z-index: 10; /* Поверх всего */
    cursor: col-resize;
    appearance: none;
    -webkit-appearance: none;
}

/* --- Handle (Icon) --- */
.dp-ba-handle {
    position: absolute;
    top: 50%;
    left: 50%; /* Стартовое значение */
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    z-index: 5;
    pointer-events: none; /* Клики проходят сквозь него на input */
    transition: left 0.1s ease-out; /* Плавность перемещения */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Labels (Before/After) --- */
.dp-ba-label {
    position: absolute;
    bottom: 20px;
    background: #ffffff;
    color: #000000;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 3;
    pointer-events: none;
}

.dp-label-left {
    left: 20px;
}

.dp-label-right {
    right: 20px;
}

/* --- Mobile --- */
@media (max-width: 900px) {
    .dp-ba-grid {
        grid-template-columns: 1fr; /* Одна колонка на мобиле */
        gap: 30px;
    }
    
    .dp-before-after-section .dp-container {
        padding: 0 20px;
    }
    
    .dp-heading-lg {
        font-size: 32px;
    }
}