/* Image Comparison Slider */
.comparison-container {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Aspect ratio control - adjust based on your images */
    aspect-ratio: 4 / 3; /* Typical for photos */
}

/* The AFTER image (base) */
.comparison-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The BEFORE image (overlay) */
.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* Start at 50% */
    height: 100%;
    overflow: hidden;
    z-index: 10;
    border-right: 2px solid #d4af37; 
}

/* The BEFORE image INSIDE the overlay */
.comparison-overlay .comparison-image {
    /* Critical: The overlay image must match the container's width, not the overlay's width */
    position: absolute; /* Ensures it doesn't flow weirdly */
    top: 0;
    left: 0;
    width: 100%; /* JS will override this to container width */
    height: 100%;
    object-fit: cover;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%; /* Matches overlay width */
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: #d4af37;
    border-radius: 50%;
    z-index: 20;
    cursor: col-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-handle::before, .slider-handle::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    position: absolute;
}

.slider-handle::before {
    border-right: 8px solid #1a1a18;
    left: 8px;
}

.slider-handle::after {
    border-left: 8px solid #1a1a18;
    right: 8px;
}

.comparison-label {
    position: absolute;
    top: 20px;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 2px;
    z-index: 15;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-before { left: 20px; z-index: 25; }
.label-after { right: 20px; }

/* Responsive adjustments */
@media (max-width: 800px) {
    .comparison-container {
        border-radius: 0; /* Full bleed on mobile looks better */
    }
}
