.decorai-before-after {
    --decorai-before-after-position: 46%;
    position: relative;
    width: 100%;
    contain: layout paint;
}

.decorai-before-after__media {
    position: relative;
    aspect-ratio: 16 / 10.3;
    overflow: hidden;
    border-radius: 12px;
}

.decorai-before-after__layer {
    position: absolute;
    inset: 0;
}

.decorai-before-after__layer--after {
    clip-path: inset(0 0 0 var(--decorai-before-after-position));
}

.decorai-before-after.is-dragging .decorai-before-after__layer--after {
    will-change: clip-path;
}

.decorai-before-after__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.decorai-before-after__labels {
    position: absolute;
    inset: 14px 14px auto 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    pointer-events: none;
    z-index: 3;
}

.decorai-before-after__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 6px;
    background: rgba(28, 24, 20, 0.72);
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.01em;
    backdrop-filter: blur(6px);
}

.decorai-before-after__handle {
    position: absolute;
    inset: 0 auto 0 var(--decorai-before-after-position);
    transform: translateX(-50%);
    width: 0;
    z-index: 2;
    pointer-events: none;
}

.decorai-before-after.is-dragging .decorai-before-after__handle {
    will-change: inset;
}

.decorai-before-after__divider {
    position: absolute;
    inset: 0 auto 0 50%;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 20px rgba(12, 12, 11, 0.14);
}

.decorai-before-after__handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 1);
    box-shadow:
        0 16px 32px rgba(12, 12, 11, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(6px) saturate(1.5);
}

.decorai-before-after__handle-button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.18);
}

.decorai-before-after__handle-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 76px;
    height: 28px;
    transform: translate(-50%, -50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='28' viewBox='0 0 76 28' fill='none'%3E%3Cpath d='M14 14L22 6V22L14 14Z' fill='%23FFFFFF' fill-opacity='0.95'/%3E%3Cpath d='M62 14L54 6V22L62 14Z' fill='%23FFFFFF' fill-opacity='0.95'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.decorai-before-after__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    z-index: 4;
}

.decorai-before-after--empty {
    padding: 16px 18px;
    border: 1px dashed #d5d0ca;
    border-radius: 12px;
    background: #fff;
    color: #5a534d;
}

@media (max-width: 767px) {
    .decorai-before-after__media {
        border-radius: 8px;
    }

    .decorai-before-after__labels {
        inset: 12px 12px auto 12px;
    }

    .decorai-before-after__label {
        font-size: 13px;
        padding: 8px 10px;
    }

    .decorai-before-after__handle-button {
        width: 22px;
        height: 64px;
        border-width: 3px;
    }

}
