#services-block {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-bottom: 120px;
}

.services-title {
    color: var(--stroke);
    margin-bottom: 40px;
}

.categories-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 40px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    transition: all 0.3s ease;
}

.categories-wrapper::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    cursor: pointer;
}

.category-wrapper {
    height: 51px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 30px;
    border: 1px solid var(--stroke);
    border-radius: 5px;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    background: transparent;
    z-index: 1;
}

.category-wrapper .category-icon img {
    filter: brightness(0) invert(1);
    transition: filter 0.3s;
}

.category-item.active .category-icon img {
    filter: brightness(0) invert(0);
}

.category-item.active .category-title {
    color: black;
}

.category-item.active .category-wrapper {
    background: white;
    border-color: white;
}

.category-item:hover .category-wrapper {
    background: linear-gradient(180deg, #4f5166 0%, #62647d 100%);
    border-color: transparent;
}

.category-item.active:hover .category-wrapper {
    background: linear-gradient(180deg, #4f5166 0%, #62647d 100%);
    border-color: transparent;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-title {
    margin: 0;
    font-weight: 500;
    font-size: 16px;
    color: var(--stroke);
    transition: color 0.3s;
}

.category-item:hover .category-title {
    color: var(--stroke);
}

.category-item:hover .category-icon img {
    filter: brightness(0) invert(1);
}

.category-item.active:hover .category-title {
    color: var(--stroke);
}

.category-item.active:hover .category-icon img {
    filter: brightness(0) invert(1);
}

.services-lists {
    margin-top: 30px;
    gap: 60px;
    display: flex;
    flex-direction: column;
    display: none;
}

.services-lists.active {
    display: flex;
}

.service-title {
    color: var(--stroke);
}

.title-wrap {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.price-wrap {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: auto;
}

.service-price {
    color: var(--stroke);
    display: flex;
    text-align: center;
    justify-content: center;
    align-self: center;
}

.service-description {
    color: var(--secondary-text);
}

.services-list {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.services-list.active {
    display: grid;
    animation: fadeIn 0.4s ease;
}

#services-block .service-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 30px;
    background-color: var(--background_secondary);
    border-radius: 10px;
    gap: 100px;
}

.service-left {
    flex: 0 0 750px;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
}

.service-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-image {
    max-width: 620px;
    max-height: 250px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-image img {
    max-width: 620px;
    max-height: 250px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

/* На 1510px убираем иконки, но оставляем flex */
@media (max-width: 1510px) {
    .category-icon {
        display: none;
    }
    
    .category-wrapper {
        gap: 0;
        justify-content: center;
        padding: 20px 25px;
    }
}

/* Грид 4 в ряд для экранов 1280px */
@media (max-width: 1280px) {
    .categories-wrapper {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
        overflow-x: visible;
        padding-bottom: 0;
        justify-content: space-evenly;
    }
    
    .category-item {
        flex-shrink: 1;
    }
    
    .category-wrapper {
        width: 100%;
        justify-content: center;
        min-width: 0;
        padding: 18px 22px;
    }
}

@media (max-width: 1200px) {
    .service-wrapper {
        gap: 50px;
    }
    
    .service-left {
        flex: 0 0 600px;
        max-width: 600px;
    }
    
    .category-wrapper {
        padding: 16px 20px;
    }
}

/* Грид 3 в ряд для средних экранов */
@media (max-width: 1000px) {
    .categories-wrapper {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        overflow-x: visible;
        padding-bottom: 0;
        justify-content: space-evenly;
    }
    
    .category-item {
        flex-shrink: 1;
    }
    
    .category-wrapper {
        width: 100%;
        justify-content: center;
        min-width: 0;
        padding: 15px 20px;
    }
}

@media (max-width: 992px) {
    .service-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    
    .service-left {
        flex: 1;
        max-width: 100%;
        width: 100%;
    }
    
    .service-right {
        width: 100%;
        height: 300px;
    }
    
    .price-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-top: 20px;
    }
    
    .service-price {
        order: 1;
        align-self: flex-start;
    }
}

/* Переход на flex для планшетов */
@media (max-width: 768px) {
    .categories-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-x: visible;
    }
    
    .category-item {
        width: 100%;
    }
    
    .category-wrapper {
        width: 100%;
        justify-content: center;
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .category-title {
        font-size: 14px;
    }
    
    .service-right {
        height: 250px;
        display: none;
    }
    
    .service-wrapper {
        gap: 20px;
    }
    
    .services-list {
        grid-template-columns: 1fr;
    }

        .service-button {
        width: 100%;
    }
}

/* Flex для маленьких экранов */
@media (max-width: 480px) {
    .categories-wrapper {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .category-item {
        width: 100%;
    }
    
    .category-wrapper {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .category-title {
        font-size: 13px;
    }

    #services-block .service-wrapper {
        padding: 15px;
    }

    #services-block .service-price,
    #services-block .service-title {
        font-size: 24px;
    }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@media (max-width: 480px) {
    .services-lists{
        margin-bottom: 40px;
    }
}