:root {
    --handle-size: 42px;
    --handle-bg: #ffffff;
    --handle-border: rgba(0, 0, 0, 0.15);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ================================
   Image Comparison Container
   ================================ */
.img-compare {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow);
    touch-action: none;
    user-select: none;
    max-width: 1616px;
    margin: 60px auto;
    padding: 60px 32px;
    text-align: center;
}

@media (max-width: 1081px) {
    .img-compare {
        margin-top: 0;
    }
}

/* ================================
   Images
   ================================ */
.img-compare .img-base,
.img-compare .img-top {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Top image is clipped, not resized */
/* Default diagonal split at 50% position with 8% offset to match JS */
.img-compare .img-top {
    clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%);
    -webkit-clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%);
}

/* ================================
   Handle
   ================================ */
.img-compare .handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--handle-size);
    height: var(--handle-size);
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--handle-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

/* Chevron icon */
.img-compare .handle::before {
    content: "";
    background: url(https://assets.corsair.com/image/upload/v1770240350/image-slider/MM-PDP_slider-icon.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

/* Keyboard focus */
.img-compare .handle:focus {
    outline: 3px solid rgba(59, 130, 246, 0.45);
    outline-offset: 3px;
}

/* ================================
   Responsive
   ================================ */
@media (min-width: 900px) {
    :root {
        --handle-size: 48px;
    }
}