.cs-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* initial fallback */
    --position: 50%;
}

.cs-image-container {
    position: relative;
    width: 100%;
    /* Default height if not set by slider */
    min-height: 300px;
    height: auto; 
    display: flex;
}

.cs-image-before {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Clip path uses the custom property */
    clip-path: polygon(var(--position) 0, 100% 0, 100% 100%, var(--position) 100%);
}

.cs-slider-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    z-index: 10;
    cursor: col-resize;
}

.cs-slider-input:focus {
    outline: none;
}

.cs-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 100vh; /* Cover the whole height for interaction */
    background: transparent;
    cursor: col-resize;
}

.cs-slider-input::-moz-range-thumb {
    width: 40px;
    height: 100vh;
    background: transparent;
    cursor: col-resize;
    border: none;
}

.cs-slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position);
    width: 2px;
    background: white;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}

.cs-slider-button {
    position: absolute;
    top: 50%;
    left: var(--position);
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cs-label {
    position: absolute;
    top: 20px;
    padding: 5px 12px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 4;
}

.cs-label-before {
    left: 20px;
}

.cs-label-after {
    right: 20px;
}