/* Before/after comparison slider — shared by /view, /interior-view and /share. */

.comparison-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: ew-resize;
    user-select: none;
}

.comparison-slider img {
    display: block;
    width: 100%;
    height: auto;
}

.comparison-slider .after-container {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
}

.comparison-slider .after-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

.comparison-slider .slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #fff;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    z-index: 10;
    will-change: left;
}

.comparison-slider .slider-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.comparison-slider .slider-handle::after {
    content: '◀ ▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: var(--primary);
    font-weight: bold;
    white-space: nowrap;
    z-index: 11;
}

.comparison-labels,
.slider-labels {
    display: flex;
    justify-content: space-between;
    max-width: 800px;
    margin: 0.5rem auto 1rem;
    font-weight: 600;
}

.comparison-labels span {
    padding: 0.25rem 0.75rem;
    background: var(--card-sectionning-background-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.slider-labels {
    padding: 0 0.5rem;
    font-weight: normal;
}

.slider-labels span {
    font-size: 0.85rem;
    color: var(--muted-color);
}

.comparison-fallback {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comparison-fallback .comparison-item {
    text-align: center;
}

.comparison-fallback .comparison-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--muted-border-color);
}

.comparison-fallback .comparison-item h4 {
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .comparison-fallback {
        grid-template-columns: 1fr;
    }
}
