/**
 * Стили для карусели услуг
 *
 * @package Empty_Theme
 */

/* Секция с каруселью услуг */
.services-carousel-section {
    margin: 20px 0 40px 0; /* Увеличиваем отступ снизу для большего пространства */
    padding: 0;
    position: relative; /* Для правильного позиционирования навигации */
    overflow: hidden; /* Предотвращаем горизонтальную прокрутку в Safari */
    height: auto; /* Используем auto вместо фиксированной высоты */
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #333;
}

/* Стили для элементов карусели */
.services-carousel .owl-stage-outer {
    padding: 30px 0; /* Увеличиваем вертикальный отступ с 10px до 30px */
    overflow: visible; /* Чтобы избежать проблем с отображением */
}

.service-item {
    position: relative;
    height: 320px; /* Уменьшаем высоту еще больше */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 15px; /* Увеличиваем вертикальный отступ с 0 до 20px */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* Учитываем отступы в ширине */
    max-width: 100%; /* Предотвращаем переполнение */
}

.service-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.service-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box; /* Важно: учитываем padding в ширине */
    padding: 30px;
    color: #fff;
    z-index: 2;
    transition: transform 0.3s ease;
    overflow: hidden; /* Предотвращаем переполнение контента */
}

.service-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    transition: margin 0.3s ease;
}

.service-content p {
    margin-bottom: 20px;
    font-size: 16px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Ограничиваем текст тремя строками */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis; /* Добавляем многоточие */
    max-width: 100%; /* Ограничиваем максимальную ширину */
}

.service-details {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.more-details-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0071CE;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.more-details-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

/* Анимации при наведении */
.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.service-item:hover .service-content {
    transform: translateY(-10px);
}

.service-item:hover .service-content h3 {
    margin-bottom: 15px;
}

.service-item:hover .service-details {
    opacity: 1;
    transform: translateY(0);
}

.more-details-btn:hover {
    background-color: #005aa3;
}

.more-details-btn:hover:before {
    left: 100%;
}

/* Стили для контейнера навигации карусели с точками и стрелками */
.services-carousel .bottom-nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px; /* Увеличиваем отступ сверху с 10px до 30px */
    margin-bottom: 10px; /* Добавляем отступ снизу */
    gap: 15px; /* Уменьшаем расстояние между элементами */
    width: 100%;
    height: auto; /* Используем auto вместо фиксированной высоты */
    padding-bottom: 20px; /* Увеличиваем отступ снизу с 10px до 20px */
}

/* Стили для точек навигации */
.services-carousel .owl-dots {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.services-carousel .owl-dot {
    display: inline-block;
    margin: 0;
}

.services-carousel .owl-dot span {
    display: block;
    width: 12px;
    height: 12px;
    background-color: #ccc;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.services-carousel .owl-dot.active span {
    background-color: #0071CE;
}

/* Стили для стрелок навигации */
@media (min-width: 769px) {
    /* Позиционируем стандартные стрелки карусели по бокам от слайдов */
    .services-carousel .owl-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 100%;
        z-index: 10;
    }

    .services-carousel .owl-prev,
    .services-carousel .owl-next {
        position: absolute;
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.8) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 20px !important;
        color: #333 !important;
        transition: all 0.3s ease;
    }

    .services-carousel .owl-prev {
        left: 10px;
    }

    .services-carousel .owl-next {
        right: 10px;
    }

    /* Стили для кастомных кнопок навигации возле точек */
    .services-carousel .custom-nav {
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #333;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .services-carousel .custom-nav:hover {
        background-color: #0071CE;
        color: #fff;
    }

    /* Стили для контейнера навигации внизу */
    .services-carousel .bottom-nav-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin-top: 30px;
    }

    .services-carousel .owl-dots {
        margin: 0;
        padding: 0;
        display: flex;
        gap: 8px;
    }
}

/* Стили для стрелок на мобильных (оставляем по бокам) */
@media (max-width: 768px) {
    .services-carousel .owl-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 100%;
        z-index: 10;
    }

    .services-carousel .owl-prev,
    .services-carousel .owl-next {
        position: absolute;
        width: 35px;
        height: 35px;
        background-color: rgba(255, 255, 255, 0.8) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 18px !important;
        color: #333 !important;
    }

    .services-carousel .owl-prev {
        left: 10px;
    }

    .services-carousel .owl-next {
        right: 10px;
    }

    /* Скрываем десктопные стрелки на мобильных */
    .services-carousel .desktop-nav-left,
    .services-carousel .desktop-nav-right {
        display: none !important;
    }

    /* Стили для контейнера навигации на мобильных */
    .services-carousel .owl-navigation-container {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }
}

.services-carousel .owl-prev:hover,
.services-carousel .owl-next:hover {
    background-color: #0071CE !important;
    color: #fff !important;
}

/* Адаптивные стили */
@media (max-width: 1200px) {
    .service-item {
        height: 300px; /* Уменьшаем высоту */
    }

    .section-title {
        font-size: 32px;
    }

    .services-carousel-section {
        margin: 20px 0; /* Уменьшаем отступы */
        height: auto; /* Используем auto вместо фиксированной высоты */
    }
}

@media (max-width: 992px) {
    .services-carousel-section {
        margin: 15px 0 20px 0; /* Используем положительный отступ в адаптиве */
    }

    .service-content h3 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .services-carousel .owl-nav {
        display: none;
    }

    .service-item {
        height: 300px;
        margin: 15px 10px; /* Увеличиваем вертикальный отступ с 0 до 15px */
        width: calc(100% - 20px); /* Фиксированная ширина с учетом отступов */
    }

    .service-content {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .service-content h3 {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .more-details-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Улучшаем отображение точек на мобильных устройствах */
    .services-carousel .owl-dots {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
}

@media (max-width: 576px) {
    .service-item {
        height: 250px;
    }

    .service-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .section-title {
        font-size: 24px;
    }
}
