.image-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    /* Removed the background-color */
    border-radius: 10px;
}

.carousel {
    position: relative;
    width: 80%;
    max-width: 800px;
    overflow: hidden;
    border-radius: 10px;
    height: 500px; /* Fixed height for consistency */
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    display: none;
    max-height: 100%;
    max-width: 100%;
    border-radius: 10px;
}

.carousel-image.active {
    opacity: 1;
    display: block;
}

/* Carousel buttons - revert to absolute positioning for visibility */
.carousel-button {
    position: absolute; /* Change back to absolute positioning */
    top: 50%;
    transform: translateY(-50%);
    background-color: #67062A; /* Solid background color that matches site theme */
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50%;
    z-index: 10;
    transition: background-color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Position the prev button on the left */
.carousel-button.prev {
    left: 10px;
}

/* Position the next button on the right */
.carousel-button.next {
    right: 10px;
}

.carousel-button:hover {
    background-color: #390518; /* Darker color on hover */
}

/* Remove the :after pseudo-element that was used for button positioning */
.carousel:after {
    content: none;
}

/* Mobile responsiveness for carousel */
@media screen and (max-width: 768px) {
    .carousel {
        width: 100%; /* Full width on mobile */
        height: 300px; /* Reduced height on mobile */
        max-width: none; /* Override the max-width constraint on mobile */
    }
    
    .carousel-images {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .carousel-image {
        max-width: 90%; /* Slightly smaller than container to prevent overflow */
        margin: 0 auto; /* Center horizontally */
    }
    
    .image-section {
        margin: 10px 0; /* Reduced margins */
        padding: 0 10px; /* Add some horizontal padding */
    }
    
    .carousel-button {
        width: 32px; /* Smaller buttons */
        height: 32px;
        font-size: 14px;
        padding: 8px;
    }
    
    .carousel-button.prev {
        left: 5px;
    }
    
    .carousel-button.next {
        right: 5px;
    }
}

/* Even smaller screens */
@media screen and (max-width: 480px) {
    .carousel {
        height: 250px; /* Even smaller height */
    }
}