
.before-after-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: auto;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;

  /* This fixes layout shift by reserving space based on image ratio */
  aspect-ratio: 3 / 2;

  /* Optional: background color while image loads */
  background-color: #f4f4f4;
}
.before-after-container img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.after-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}
.after-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
}
.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: #fff;
  border-left: 2px solid black;
  border-right: 2px solid black;
  z-index: 10;
  pointer-events: none;
}
.label {
  position: absolute;
  top: 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 20;
  text-transform: uppercase;
}
.label.before { left: 10px; }
.label.after { right: 10px; }
@media (max-width: 768px) {
  .label {
    font-size: 12px;
    padding: 5px 8px;
  }
}
