.slider {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    margin-bottom: 40px;
    border-radius: 30px;
    height: 100%;
    min-height: 470px;
}

.slider-container {
    position: relative;
    width: 1400px;
    height: 470px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 30px;
}

.slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.prev-slide,
.next-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--text-light);
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 21px;
    transition: color 0.3s ease;
}

.prev-slide:hover,
.next-slide:hover {
    color: var(--primary-color);
}

.prev-slide {
    left: -35px;
}

.next-slide {
    right: -35px;
}

.dots {
    position: absolute;
    bottom: 23px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.dot {
    width: 14px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--primary-color);
}

@media (max-width: 1400px) {
    .slider-container {
        width: 100%;
    }

    .prev-slide {
        left: 12px;
    }

    .next-slide {
        right: 12px;
    }
}

@media (max-width: 768px) {
    .slider-container {
        height: 440px;
    }

    .slider{
        margin-bottom: 10px;
    }
}

/* product-slider */
.product-slider {
    width: 100%;
    position: relative;
    overflow: visible;
    margin: 23px 0;
}

.product-slider-container {
    position: relative;
    width: 1400px;
    height: 140px;
    margin: 0 auto;
    overflow: hidden;
}

.product-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.product-slide {
    flex: 0 0 20%;
    width: 20%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5px; /* Добавляем отступы между карточками */
    box-sizing: border-box;
}

.product-card {
    width: 100%;
    max-width: 300px;
    height: 130px;
    min-height: 150px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px;
    transition: transform 0.3s ease;
    text-decoration: none !important;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 140px;
    height: 110px;
    object-fit: contain;
}

.product-card h4 {
    font-size: 16px;
    color: var(--text-color);
    margin: 0;
    text-align: center;
    text-decoration: none !important;
}

.prev-product-slide,
.next-product-slide {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none; 
    color: #333;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 24px;
    transition: color 0.3s ease;
    z-index: 10;
}

.prev-product-slide:hover,
.next-product-slide:hover {
    background: none; 
    color: var(--primary-color); 
}

.prev-product-slide {
    left: 0;
}

.next-product-slide {
    right: 0;
}

@media (max-width: 1300px) {
    .product-slider-container {
        width: 100%;
        max-width: 1200px;
    }
    
    .product-slide {
        flex: 0 0 25%;
        width: 25%;
        padding: 0 8px; /* Увеличиваем отступы для меньших экранов */
    }
    
    .product-card {
        height: 120px;
    }
    
    .product-card img {
        width: 120px;
        height: 90px;
    }
    
    .prev-product-slide {
        left: 10px;
    }

    .next-product-slide {
        right: 10px;
    }
}

@media (max-width: 1024px) {
    .product-slide {
        flex: 0 0 33.333%;
        width: 33.333%;
        padding: 0 10px; /* Еще больше отступов */
    }
    
    .product-card {
        height: 110px;
        padding: 5px;
    }
    
    .product-card img {
        width: 100px;
        height: 80px;
    }
    
    .product-card h4 {
        font-size: 14px;
    }
}

@media (max-width: 870px) {
    .product-slider {
        display: block !important;
        margin: 15px 0 !important;
    }
    
    .product-slider-container {
        display: block !important;
        height: 140px !important;
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    .product-slide {
        flex: 0 0 50%;
        width: 50%;
        padding: 0 15px; /* Максимальные отступы для мобильных */
    }
    
    .product-card {
        width: 100%;
        height: 130px;
        min-height: 130px;
        padding: 8px;
    }
    
    .product-card img {
        width: 110px;
        height: 85px;
    }
    
    .product-card h4 {
        font-size: 14px;
    }
    
    .prev-product-slide,
    .next-product-slide {
        display: block !important;
        padding: 12px;
        font-size: 20px;
    }
    
    .prev-product-slide {
        left: 5px;
    }
    
    .next-product-slide {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .product-slider-container {
        height: 120px !important;
    }
    
    .product-slide {
        padding: 0 10px; /* Уменьшаем отступы для очень маленьких экранов */
    }
    
    .product-card {
        height: 110px;
        min-height: 110px;
        padding: 5px;
    }
    
    .product-card img {
        width: 90px;
        height: 70px;
    }
    
    .product-card h4 {
        font-size: 12px;
    }
}

@media (min-width: 871px) {
    .product-slider {
        display: block !important;
    }
}

/* Исправление для модального окна новостей */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Убираем скролл у модального окна */
}

.modal-content {
    background-color: var(--light-color);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh; /* Ограничиваем максимальную высоту */
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden; /* Убираем скролл у контейнера */
    display: flex;
    flex-direction: column;
}

.service-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; /* Добавляем скролл только для контента */
    flex: 1;
    padding-right: 10px; /* Отступ для скроллбара */
}

/* Стили для скроллбара в модальном окне */
.service-details::-webkit-scrollbar {
    width: 8px;
}

.service-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.service-details::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.service-details::-webkit-scrollbar-thumb:hover {
    background: #b71c1c;
}

/* Для новостного контента */
.news-content {
    max-height: none; /* Убираем ограничение высоты */
    overflow: visible; /* Убираем скролл у самого контента */
}

/* Убедимся, что заголовки и другие элементы не создают лишних скроллов */
.service-title,
.news-title {
    margin-top: 0;
    padding-top: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        padding: 20px;
    }
    
    .service-details {
        padding-right: 5px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-height: 98vh;
        padding: 15px;
    }
}