/* ─── Image Comparison Sliders ─── */
.results__comparisons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 5rem;
  max-width: 963px;
  margin-inline: auto;
}

@media (max-width: 900px) {
  .results__comparisons {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

.image-comparison {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05); /* Soft shadow */
  aspect-ratio: 4 / 3; /* Shorter rectangle */
  user-select: none;
}

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

.image-comparison__before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 50% 0 0);
  z-index: 10;
}

.image-comparison__divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 30; /* Very high z-index */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: ew-resize;
}

.image-comparison__handle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  color: #111;
  transition: transform 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0; /* Prevent squashing in narrow divider */
  border: 2px solid #fff;
  position: relative;
  z-index: 31;
}

.image-comparison__handle svg {
  width: 24px;
  height: 24px;
}

.image-comparison__divider:hover .image-comparison__handle {
  transform: scale(1.1);
}

.image-comparison__slider {
  display: none; /* Hide the old range input */
}

.image-comparison.is-dragging {
  cursor: grabbing;
}

.image-comparison.is-dragging .image-comparison__divider {
  cursor: grabbing;
}

.image-comparison.is-dragging .image-comparison__handle {
  transform: scale(1.15);
  background-color: var(--color-primary);
  color: #fff;
  border: 2px solid #fff;
}
