/* Image Comparison Slider - Final Fixed Version */
.img-comp-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* The before image container */
.img-comp-img.before {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

/* The after image container */
.img-comp-img.after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* The actual images */
.img-comp-img img {
  display: block;
  width: auto;
  height: 100%!important;
  max-width: none;
  object-fit: cover;
  object-position: left center;
}

/* The drag handle */
.img-comp-slider {
  position: absolute;
  z-index: 9;
  cursor: ew-resize;
  width: 40px;
  height: 40px;
  background-color: #fff;
  border-radius: 50%;
  top: 50%;
  left: 50%; /* Default position */
  transform: translate(-50%, -50%); /* Center it on the border */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* The divider line */
.img-comp-slider::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 9999px;
  background-color: #fff;
  left: 50%;
  transform: translateX(-50%);
  top: -4999px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* The drag arrows */
.img-comp-slider::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-left: 2px solid #555;
  border-right: 2px solid #555;
  border-top: 0;
  border-bottom: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Labels */
.img-comp-label {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 3px;
  z-index: 5;
}

.img-comp-label.before-label {
  top: 10px;
  left: 10px;
}

.img-comp-label.after-label {
  top: 10px;
  right: 10px;
}