.outrun-before-after-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.outrun-before-after-wrap.align-left {
  margin-right: auto;
}

.outrun-before-after-wrap.align-center {
  margin-left: auto;
  margin-right: auto;
}

.outrun-before-after-wrap.align-right {
  margin-left: auto;
}

.outrun-before-after {
  --outrun-ba-position: 50%;
  position: relative;
  overflow: hidden;
  width: 100%;
  line-height: 0;
  user-select: none;
  background: #f3f3f3;
  border-radius: inherit;
}

.outrun-before-after-wrap.has-aspect-ratio .outrun-before-after {
  aspect-ratio: var(--outrun-aspect-ratio);
}

.outrun-ba-image,
.outrun-ba-image img {
  display: block;
  width: 100%;
  height: auto;
}

.outrun-before-after-wrap.has-aspect-ratio .outrun-ba-image,
.outrun-before-after-wrap.has-aspect-ratio .outrun-ba-image img {
  height: 100%;
}

.outrun-before-after-wrap.has-aspect-ratio .outrun-ba-image img {
  object-fit: cover;
}

.outrun-ba-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}

.outrun-ba-after {
  position: relative;
}

.outrun-ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
}

.outrun-ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.outrun-ba-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.outrun-ba-handle::before {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  line-height: 1;
  font-size: 18px;
  color: #222;
}

.outrun-ba-label {
  position: absolute;
  top: 12px;
  z-index: 3;
  display: inline-block;
  padding: 6px 10px;
  line-height: 1;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border-radius: 3px;
  transition: opacity 120ms ease;
}

.outrun-ba-label-before {
  left: 12px;
}

.outrun-ba-label-after {
  right: 12px;
}

.outrun-before-after-placeholder {
  padding: 12px;
  border: 1px dashed #bbb;
}

.outrun-ba-label-hidden {
  opacity: 0;
}
