/* Основные стили слайдера */

.before-after-slider-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* Заголовок и навигация */

.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.slider-title {
    margin: 0;
    flex: 1;
    min-width: 200px;
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.slider-title h1,
.slider-title h2,
.slider-title h3,
.slider-title h4,
.slider-title h5,
.slider-title h6 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

.slider-title span {
    color: #000000;
}

.slider-title strong {
    font-weight: 800;
}

.slider-title em {
    font-style: italic;
}

.slider-navigation {
    display: flex;
    gap: 35px;
    flex-shrink: 0;
    position: relative;
    align-items: center;
}


/* Позиционирование навигации */

.nav-position-left .slider-navigation {
    order: -1;
}

.nav-position-right .slider-navigation {
    order: 1;
}


/* Слайдер */

.before-after-slider {
    position: relative;
}

.slide-item {
    position: relative;
    width: 100%;
    height: auto;
}


/* Swiper стили */

.swiper-slide {
    height: auto;
}

.swiper-button-next,
.swiper-button-prev {
    background-color: #6D7880;
    color: #FFFFFF;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}


/* Стрелки в контейнере навигации */

.slider-navigation .swiper-button-next,
.slider-navigation .swiper-button-prev {
    position: relative;
    top: auto;
    transform: none;
}


/* Стрелки в слайдере (абсолютное позиционирование) */

.before-after-slider .swiper-button-next {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.before-after-slider .swiper-button-prev {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: #495057;
}


/* Hover для стрелок в слайдере */

.before-after-slider .swiper-button-next:hover,
.before-after-slider .swiper-button-prev:hover {}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
    color: #FFFFFF;
}


/* Скрываем стандартные стрелки Swiper если навигация отключена */

.before-after-slider:not(.swiper-initialized) .swiper-button-next,
.before-after-slider:not(.swiper-initialized) .swiper-button-prev {
    display: none !important;
}


/* Скрываем стрелки в контейнере навигации если навигация отключена */

.slider-navigation:not(.swiper-initialized) .swiper-button-next,
.slider-navigation:not(.swiper-initialized) .swiper-button-prev {
    display: none !important;
}

.swiper-pagination-bullet {
    background-color: #dee2e6;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background-color: #6D7880;
    transform: scale(1.3);
}

.swiper-pagination-fraction {
    color: #6D7880;
    font-weight: bold;
}

.swiper-pagination-progressbar {
    background-color: #e9ecef;
}

.swiper-pagination-progressbar-fill {
    background-color: #007bff;
}


/* Изображения */

.slide-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}


/* Режим "До/После" */

.before-after-image .image-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    transition: min-height 0.3s ease;
}


/* Режим "Текст под слайдером" */

.text-slide-image {
    position: relative;
    min-height: 400px;
    transition: min-height 0.3s ease;
}

.text-slide-image img {
    width: 100%;
    height: auto;
    display: block;
    min-height: inherit;
}


/* Автоматическая высота */

.before-after-slider.auto-height .slide-item {
    min-height: auto !important;
    height: auto !important;
}

.before-after-slider.auto-height .slide-image {
    min-height: auto !important;
    height: auto !important;
}

.before-after-slider.auto-height .image-container {
    min-height: auto !important;
    height: auto !important;
}

.before-after-slider.auto-height .before-image,
.before-after-slider.auto-height .after-image {
    position: relative;
    height: auto;
}

.before-image,
.after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.before-image.active,
.after-image.active {
    opacity: 1;
}


/* Кнопки "До/После" */

.before-after-buttons {
    display: flex;
    gap: 10px;
}

.before-after-image img {
    height: 100% !important;
}

.before-after-button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.before-after-button.before {
    background-color: #EDEDED;
    color: #000000;
}

.before-after-button.after {
    background-color: #EDEDED;
    color: #000000;
}

.before-after-button:hover {}

.before-after-button.active {
    color: #fff !important;
    background-color: #525258;
}


/* Активные состояния кнопок для Elementor настроек */

.before-after-button.before.active {
    background-color: #495057 !important;
}

.before-after-button.after.active {
    background-color: #495057 !important;
}


/* Режим "Текст под слайдом" */

.text-slide-image {
    position: relative;
}

.text-slide-image img {
    width: 100%;
    height: auto;
    display: block;
}

.slide-text-content {
    padding: 30px;
}

.slide-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.slide-title h1,
.slide-title h2,
.slide-title h3,
.slide-title h4,
.slide-title h5,
.slide-title h6 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

.slide-title span {
    color: #007bff;
    font-weight: 600;
}

.slide-title strong {
    font-weight: 800;
}

.slide-title em {
    font-style: italic;
}

.slide-subtitle {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
    transition: all 0.3s ease;
}

.slide-subtitle span {
    color: #007bff;
    font-weight: 500;
}

.slide-subtitle strong {
    font-weight: 600;
    color: #495057;
}

.slide-subtitle em {
    font-style: italic;
}


/* Пагинация */

.slider-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 0;
}


/* Пагинация точками */

.pagination-dots .pagination-dot {
    width: 12px;
    height: 12px;
    background-color: #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dots .pagination-dot:hover {
    background-color: #adb5bd;
}

.pagination-dots .pagination-dot.active {
    background-color: #6D7880;
    border-color: #495057;
}


/* Пагинация номерами */

.pagination-numbers .pagination-dot {
    width: 32px;
    height: 32px;
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.pagination-numbers .pagination-dot:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination-numbers .pagination-dot.active {
    background-color: #007bff;
    border-color: #0056b3;
    color: #ffffff;
}


/* Пагинация прогресс-баром */

.pagination-progress .pagination-dot {
    width: 60px;
    height: 8px;
    background-color: #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
}

.pagination-progress .pagination-dot .progress-bar {
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    position: relative;
}

.pagination-progress .pagination-dot .progress-fill {
    height: 100%;
    background-color: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

.pagination-progress .pagination-dot.active .progress-fill {
    width: 100%;
}


/* Адаптивность */


/* Специальные стили для экранов 1024-1200px (3 колонки) */

@media (min-width: 1024px) and (max-width: 1199px) {
    .before-after-slider .swiper-slide {
        width: calc(33.333% - 13.33px) !important;
        margin-right: 20px !important;
    }
    .before-after-slider .swiper-slide:last-child {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .slider-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    .slider-title {
        min-width: auto;
        font-size: 20px;
    }
    .slide-title {
        font-size: 18px;
    }
    .slide-subtitle {
        font-size: 14px;
    }
    .slider-navigation {
        justify-content: space-between;
        width: 100%;
    }
    /* Swiper стрелки автоматически подстраиваются */
    .before-after-buttons {
        flex-direction: column;
        gap: 8px;
        padding: 15px;
    }
    .before-after-button {
        padding: 10px 20px;
        font-size: 13px;
        min-width: auto;
    }
    .slide-text-content {
        padding: 20px;
    }
    .slide-title {
        font-size: 20px;
    }
    .slide-subtitle {
        font-size: 14px;
    }
    /* Адаптивное позиционирование навигации */
    .nav-mobile-absolute .slider-navigation {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }
    .nav-mobile-absolute.nav-position-left .slider-navigation {
        left: 10px;
    }
    .nav-mobile-absolute.nav-position-right .slider-navigation {
        right: 10px;
    }
    .text-slide-image img {
        max-height: 430px;
        object-fit: contain;
    }
    /* Swiper стрелки автоматически подстраиваются под мобильные */
}

@media (max-width: 480px) {
    .slider-header {
        margin-bottom: 20px;
    }
    .slider-title {
        font-size: 18px;
    }
    .slide-title {
        font-size: 16px;
    }
    .slide-subtitle {
        font-size: 12px;
    }
    /* Swiper стрелки автоматически подстраиваются */
    .before-after-buttons {
        padding: 12px;
    }
    .before-after-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    .slide-text-content {
        padding: 15px;
    }
    .slide-title {
        font-size: 18px;
    }
    .slide-subtitle {
        font-size: 13px;
    }
    .pagination-dot {
        width: 10px;
        height: 10px;
    }
}


/* Hover эффекты */


/* Swiper стрелки имеют свои hover эффекты */

.slide-item:hover .before-after-button {}


/* Состояния загрузки */

.before-after-slider-wrapper.loading {
    opacity: 0.7;
    pointer-events: none;
}

.before-after-slider-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* Улучшенные тени и границы */

.before-after-slider {}

.slide-image {}

.before-after-buttons,
.slide-text-content {}


/* Фокус для доступности - убрано */


/* Состояния для touch устройств */

@media (hover: none) {
    .before-after-button:hover,
    .pagination-dot:hover {
        transform: none;
    }
    .before-after-button:active,
    .pagination-dot:active {}
}