services::before, 
services::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 8vw; 
    pointer-events: none;
    z-index: -1; 
}

.medical-container {
    max-width: 1200px;
    margin: 0 auto;
}

.medical-container h2 {
    text-align: center;
    margin-top: 2rem;
}

.services-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10vw;
    z-index: 1;
    pointer-events: none;
}

.services-fade-left {
    left: 0;
    background: linear-gradient(to right, rgb(0, 0, 0), rgba(0, 0, 0, 0.1));
    z-index: 50;
}

.services-fade-right {
    right: 0;
    background: linear-gradient(to left, rgb(0, 0, 0), rgba(0, 0, 0, 0.1));
    z-index: 50;
}

.services-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    transition: transform 0.3s ease, opacity 0.3s ease; 
    box-sizing: border-box;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.services-container-wrapper {
    position: relative;
    width: calc(100% - 40px);
    overflow: visible;
    box-sizing: border-box;
    margin: 0 auto;
    z-index: 1;
}

.service-text {
    min-width: 270px;
    height: 270px;
    z-index: 1;

    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;

    justify-content: flex-start;
    scroll-snap-align: start;

    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0px 8px 20px var(--hover-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: center;
}

.service-text:hover {
    transform: scale(1.05);
}

.service-text h3 {
    margin: 15px 0 15px 0;
    text-align: center;
}

.service-text p {
    line-height: 1.5;
    text-align: left;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--text-color);
    font-size: 2vw;
    border: none;
    cursor: pointer;
    padding: 1vw;
    z-index: 100;
}

.scroll-button.left {
    left: 0;
}

.scroll-button.right {
    right: 0;
}

/* Responsive Anpassungen */
@media screen and (max-width: 1100px) {
    .services-container {
        gap: 15px;
    }

    .service-text {
        min-width: 250px;
        height: 250px;
        padding: 8px;
    }

    .scroll-button {
        font-size: 3.5vw;
    }

    .services-fade {
        width: 15vw;
    }
}

@media screen and (max-width: 768px) {
    .services-container {
        gap: 10px;
    }

    .service-text {
        min-width: 250px;
        height: auto;
        padding: 15px;
        text-align: justify; 
    }

    .service-text h3 {
        text-align: left; 
        margin-bottom: 10px; 
    }

    .service-info p {
        text-align: justify; 
    }

    .scroll-button {
        font-size: 4vw;
    }

    .services-fade {
        width: 20vw;
    }
}

@media screen and (max-width: 480px) {
    .services-container {
        gap: 5px;
        margin-left: 50px;
    }

    .service-text {
        min-width: 220px;
        height: auto;
        padding: 3vw;
        text-align: justify; 
        box-sizing: border-box;
    }

    .service-text h3 {
        text-align: left; 
        margin-bottom: 6px;
    }

    .service-info p {
        text-align: justify; 
    }

    .scroll-button {
        font-size: 5vw;
    }

    .services-fade {
        width: 25vw;
    }
}