.slider {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto;
}
.slides {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.slide {
    min-width: 100%;
    box-sizing: border-box;
    position: relative;
}
.slide img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 20px;
}
.slide h2 {
    position: absolute;
    bottom: 20px;
    left: 10%;
    right: 10%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    width: auto;
    max-width: 90%;
}
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}
.prev {
    left: 10px;
}
.next {
    right: 10px;
}
.dots {
    text-align: center;
    margin-top: 10px;
}
.dot {
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}
.active {
    background-color: #333;
}

@media (max-width: 768px) {
    .prev, .next {
        top: 40%;
        padding: 8px;
    }
    .slide h2 {
        bottom: 10px;
        font-size: 14px;
        padding: 5px;
    }
}