/* Refactored with chatGPT on 18th October 2024, UK */

.comparison-container {
    position: relative;
    width: 100%;
    max-width: 450px; /* Set the maximum width */
    margin: 0 auto;
    overflow: hidden;
}

.comparison-wrapper {
    position: relative;
    width: 100%;
    height: auto;
}

.comparison-wrapper img {
/*    width: 100%;*/
    height: auto;
    display: block;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0; /* Fix the left side */
    width: 50%; /* Initial width (this will be dynamic when dragging the slider) */
    height: 100%;
    overflow: hidden;
    pointer-events: none; /* Prevent any interaction with the overlay */
}

.comparison-overlay img {
/*    width: 100%;*/
    height: 100%;
    object-fit: cover;
    position: relative; /* Ensure the image does not shift */
    left: 0; /* Keep the left side of the image fixed */
}

.slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* Start the slider in the middle */
    width: 5px;
    background-color: #333;
    cursor: ew-resize;
    z-index: 10;
}

.circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 11;
}
/* Prevent user from selecting elements during dragging */
.comparison-container, 
.comparison-container * {
    user-select: none; /* Disable selection for all child elements */
    -webkit-user-select: none; /* For Safari */
    -ms-user-select: none; /* For IE/Edge */
    -moz-user-select: none; /* For Firefox */
}