/* BULLETPROOF BEFORE/AFTER STYLES */

.before-after-comparison {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  background: #000; /* Black background to catch any gaps */
}

.hero__comparison {
  height: 400px !important;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.before-after__container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000; /* Black background */
}

.before-after__before,
.before-after__after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.before-after__before {
  z-index: 1;
}

.before-after__after {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.gallery__image,
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.before-after__label {
  position: absolute;
  top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.875rem;
  font-weight: bold;
  border-radius: 0.5rem;
  z-index: 15;
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: none;
}

.before-after__label--before {
  left: 1rem;
}

.before-after__label--after {
  right: 1rem;
}

.hero__comparison .before-after__label {
  font-size: 1.5rem;
  padding: 1rem 1.5rem;
}

.before-after__slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.hero__comparison .before-after__slider {
  width: 6px;
}

.before-after__line {
  width: 100%;
  height: 100%;
  background: white;
}

.before-after__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: white;
  border: 3px solid #2c5aa0;
  border-radius: 50%;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #2c5aa0;
  transition: 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 11;
}

.hero__comparison .before-after__handle {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
  border: 4px solid white;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.before-after__handle:hover {
  background: #2c5aa0;
  color: white;
  transform: translate(-50%, -50%) scale(1.1);
}

.before-after__handle-icon {
  font-weight: bold;
}