/* Блок «Услуги» — слайдер категорий (block-all-services).
   Перенесено из инлайнового <style> шаблона widgets/block_all_services-shortlist.blade.php. */
.services-block {
    padding: 80px 0;
    position: relative;
    overflow: hidden; /* Скрываем выходящие за пределы элементы */
}

.services-slider-wrapper {
    position: relative;
    padding: 20px 0;
    margin: 0 -20px; /* Компенсируем padding контейнера */
}

.services-swiper {
    padding: 20px 20px 30px; /* Увеличиваем нижний padding */
    overflow: visible !important; /* Принудительно видимый */
    -webkit-overflow-scrolling: touch; /* Для iOS */
    touch-action: pan-y; /* Для touch устройств */
    position: relative;
    z-index: 2;
}

/* Исправление для WebKit (Samsung Browser, Chrome) */
.services-swiper::-webkit-scrollbar {
    display: none; /* Скрываем скроллбар */
}

.swiper-wrapper {
    align-items: stretch;
    box-sizing: border-box;
    position: relative;
}

.swiper-slide {
    height: auto;
    box-sizing: border-box;
}

.service-category-card {
    width: 350px;
    min-width: 350px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible; /* Важно! */
    -webkit-transform: translateZ(0); /* Исправление рендеринга на Android */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.service-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.category-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.category-icon {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.category-icon img {
    max-width: 25px;
    max-height: 25px;
    width: auto;
    height: auto;
}

.category-title-wrapper {
    flex: 1;
    min-width: 0; /* Исправление для flexbox */
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    line-height: 1.2;
    transition: color 0.3s ease;
    word-break: break-word;
    overflow-wrap: break-word;
}

.category-title:hover {
    color: #3498db;
}

.services-count {
    color: #7f8c8d;
    font-size: 13px;
}

.services-list {
    flex: 1;
    margin-bottom: 0;
    overflow-y: auto;
    max-height: 350px; /* Ограничиваем высоту списка */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
    padding-right: 5px; /* Место для скроллбара */
}

/* Стилизация скроллбара внутри карточки */
.services-list::-webkit-scrollbar {
    width: 4px;
}

.services-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.services-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.services-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.service-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.service-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    font-size: 14px;
    flex: 1;
    transition: color 0.3s ease;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0; /* Исправление для flexbox */
}

.service-link:hover {
    color: #3498db;
}

.service-link .fa-bolt {
    margin-right: 5px;
    font-size: 12px;
}

.service-price {
    color: #95a5a6;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Частичный показ следующего слайда */
.services-swiper .swiper-slide {
    width: 350px !important;
    min-width: 350px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    transform: translate3d(0,0,0); /* Аппаратное ускорение */
    -webkit-transform: translate3d(0,0,0);
}

.services-swiper .swiper-slide-active {
    opacity: 1;
}

.services-swiper .swiper-slide-next {
    opacity: 0.9;
}

/* Адаптивность */
@media (max-width: 768px) {
    .services-slider-wrapper {
        margin: 0 -15px;
    }

    .services-swiper {
        padding: 15px 15px 25px;
    }

    .service-category-card {
        width: 300px;
        min-width: 300px;
        padding: 20px;
    }

    .services-swiper .swiper-slide {
        width: 300px !important;
        min-width: 300px;
    }

    .category-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .category-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .services-list {
        max-height: 300px;
    }

    .service-link {
        font-size: 13px;
    }

    .service-price {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .services-slider-wrapper {
        margin: 0 -10px;
    }

    .services-swiper {
        padding: 10px 10px 20px;
    }

    .service-category-card {
        width: 280px;
        min-width: 280px;
        padding: 18px;
    }

    .services-swiper .swiper-slide {
        width: 280px !important;
        min-width: 280px;
    }

    .category-title {
        font-size: 16px;
    }

    .services-list {
        max-height: 250px;
    }
}

/* Исправления для мобильных устройств */
@media (hover: none) and (pointer: coarse) {
    .service-category-card:hover {
        transform: none; /* Отключаем hover на тач-устройствах */
    }

    .services-swiper {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}

/* Исправление для Samsung Internet Browser */
@media (-webkit-touch-callout: none) {
    .services-swiper {
        -webkit-overflow-scrolling: auto !important;
    }
}
