/* Before/After wipe comparison */
.before-after {
  width: 100%;
  user-select: none;
  touch-action: none;
}

.before-after-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 2400 / 1500;
  overflow: hidden;
  cursor: ew-resize;
  border-radius: inherit;
}

@media (min-width: 1280px) {
  .before-after-viewport,
  .before-after-handle {
    cursor: ew-resize !important;
  }
}

.before-after-img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: cover;
  object-position: top center;
}

.before-after-after {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.before-after-before {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.before-after-before .before-after-img {
  max-width: none;
}

.before-after-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 3;
  width: 44px;
  transform: translateX(-50%);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.before-after-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.before-after-handle-knob {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.before-after-handle-icon {
  display: block;
  width: 14px;
  height: 14px;
  color: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.before-after-label {
  position: absolute;
  top: 12px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.before-after-label-before {
  left: 12px;
}

.before-after-label-after {
  right: 12px;
}

.before-after--compact .before-after-handle {
  width: 36px;
}

.before-after--compact .before-after-handle-knob {
  width: 28px;
  height: 28px;
}

.before-after--compact .before-after-handle-icon {
  width: 11px;
  height: 11px;
}

.before-after--compact .before-after-label {
  font-size: 10px;
  top: 8px;
  padding: 3px 8px;
}
