
.wp-block-ba-compare-pro-wrapper,
.ba-compare-pro {
    width: 100%;
    max-width: var(--ba-max-width, 100%);
}

.ba-compare-pro {
    margin: 0 auto;
}

.ba-compare-pro__stage {
    position: relative;
    width: 100%;
    height: var(--ba-height, 520px);
    overflow: hidden;
    border-radius: var(--ba-radius, 18px);
    background: #eef2f6;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.12);
    user-select: none;
}

.ba-compare-pro__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ba-compare-pro__before-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--ba-start, 50%)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--ba-start, 50%)) 0 0);
}

.ba-compare-pro__image--before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.ba-compare-pro__divider {
    position: absolute;
    top: 0;
    left: var(--ba-start, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.ba-compare-pro__divider::before {
    content: "";
    position: absolute;
    inset: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 0 1px rgba(17,24,39,0.06), 0 0 14px rgba(17,24,39,0.08);
}

.ba-compare-pro__handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.ba-compare-pro__arrow {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.ba-compare-pro__arrow--left {
    border-right: 9px solid #111827;
}

.ba-compare-pro__arrow--right {
    border-left: 9px solid #111827;
}

.ba-compare-pro__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 6;
}

.ba-compare-pro__label,
.ba-compare-pro__hint {
    position: absolute;
    z-index: 5;
    color: #fff;
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 13px;
    line-height: 1;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .02em;
}

.ba-compare-pro__label--before {
    left: 18px;
    top: 18px;
}

.ba-compare-pro__label--after {
    right: 18px;
    top: 18px;
}

.ba-compare-pro__hint {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
}

.ba-compare-pro-placeholder {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
}

.ba-editor-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 16px;
    width: 100%;
}

.ba-editor-media-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.ba-editor-thumb-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ba-editor-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #dbe3ea;
}

.ba-compare-pro--editor .ba-compare-pro__stage {
    min-height: 360px;
}

@media (max-width: 782px) {
    .ba-compare-pro__stage {
        height: min(68vw, var(--ba-height, 420px));
        min-height: 280px;
    }

    .ba-compare-pro__handle {
        width: 52px;
        height: 52px;
    }
}


.ba-compare-pro-block-editor-root {
    width: 100%;
}

.ba-compare-pro--editor {
    cursor: pointer;
}

.ba-compare-pro--editor .ba-compare-pro__range {
    pointer-events: none;
}

.ba-compare-pro--editor .ba-compare-pro__stage,
.ba-compare-pro--editor .ba-compare-pro__handle,
.ba-compare-pro--editor .ba-compare-pro__divider,
.ba-compare-pro--editor .ba-compare-pro__before-wrap,
.ba-compare-pro--editor .ba-compare-pro__image {
    user-select: none;
}


/* Editor selection fix: preview must not swallow clicks */
.ba-compare-pro--editor {
    position: relative;
    pointer-events: none;
}

.ba-compare-pro--editor * {
    pointer-events: none !important;
}

.ba-compare-pro-block-editor-root {
    position: relative;
}

.ba-compare-pro-block-editor-root::after {
    content: "Block anklicken zum Auswählen – Einstellungen rechts bearbeiten";
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 30;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 999px;
    pointer-events: none;
    opacity: .92;
}

.block-editor-block-list__block.is-selected .ba-compare-pro-block-editor-root::after,
.block-editor-block-list__block.is-highlighted .ba-compare-pro-block-editor-root::after {
    content: "Block ausgewählt";
}
