.before-after-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  position: relative;
}

.comparison {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  cursor: ew-resize;
  border-radius: 8px;
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
  position: relative;
  user-select: none;
  aspect-ratio: 3/2;
  --container-width: 100%;
  --container-height: 100%;
  /* box-shadow: 0 16px 48px rgba(193, 49, 183, 0.15); */
}

.comparison-figure {
  background-size: var(--container-width) var(--container-height);
  background-position: left center;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.comparison-figure .divisor {
  background-size: var(--container-width) var(--container-height);
  background-position: left center;
  background-repeat: no-repeat;
  position: absolute;
  width: 50%;
  box-shadow: 0 5px 10px -2px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100%;
  border-right: 3px solid #fff;
  transition: none;
}

.comparison-figure .divisor::after {
  content: '⟷';
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  z-index: 10;
}

.comparison-figure .divisor::before {
  content: '';
  position: absolute;
  right: -1.5px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #fff;
  z-index: 5;
}

.comparison-labels {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 15;
}

.before-label,
.after-label {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
  max-width: fit-content;
  white-space: nowrap;
}

.before-label {
  text-align: left;
  align-self: flex-start;
}

.after-label {
  text-align: right;
  align-self: flex-end;
}

/* .before-label::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: var(--overlay-width, 50%);
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  transition: width 0.1s ease;
  z-index: 1;
} */

.before-label span,
.after-label span {
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .comparison {
    width: 100%;
    max-width: 100%;
  }
  
  .comparison-figure .divisor::after {
    width: 25px;
    height: 25px;
    font-size: 12px;
    right: -12.5px;
  }
}


