.image-comparisons {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Container principal */
.wrapper {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 440px;

  overflow: hidden;
  border-radius: 24px;

  background: #111827;

  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 20px 60px rgba(0, 0, 0, 0.45);

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.wrapper:hover {
  transform: translateY(-4px);

  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.3),
    0 30px 80px rgba(0, 0, 0, 0.4);
}


/* Camada das imagens */
.wrapper .images {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Garanta que o clip-path não tenha transição lenta */
.img-2 {
  z-index: 2;
  /* Isso é essencial para que o movimento seja instantâneo */
  transition: none; 
}

/* Imagens */
.images .img-1,
.images .img-2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.images .img-2 {
  clip-path: inset(0 50% 0 0); 
}

/* Depois */
.wrapper .images .img-1 {
  background: url("../imgs/depois.png") no-repeat center;
  background-size: cover;
}

/* Antes */
.wrapper .images .img-2 {
  background: url("../imgs/antes.png") no-repeat center;
  background-size: cover;
}

/* Overlay elegante */
.wrapper::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.28),
      transparent 40%
    );

  pointer-events: none;
  z-index: 2;
}

/* Slider */
.wrapper .slider {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Input invisível */
.wrapper .slider input {
  width: 100%;
  height: 100%;

  background: transparent;
  outline: none;

  cursor: ew-resize;

  -webkit-appearance: none;
  appearance: none;
}

/* Thumb invisível */
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 100%;
  background: transparent;
  border: none;
  cursor: ew-resize;
}

.slider input::-moz-range-thumb {
  width: 6px;
  height: 100%;
  background: transparent;
  border: none;
  cursor: ew-resize;
}

.slider input::-moz-range-track {
  background: transparent;
}

/* Linha central */
.slider .drag-line {
  position: absolute;
  top: 0;
  left: 50%;

  width: 4px;
  height: 100%;

  background: rgba(255, 255, 255, 0.95);

  transform: translateX(-50%);
  pointer-events: none;

  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.5),
    0 0 24px rgba(255, 255, 255, 0.25);
}

/* Botão do meio */
.slider .drag-line::before {
  content: "⇆";

  position: absolute;
  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.12);

  backdrop-filter: blur(12px);

  border: 1px solid rgba(255, 255, 255, 0.25);

  color: #fff;
  font-size: 22px;
  font-weight: 700;

  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.35),
    inset 0 0 12px rgba(255, 255, 255, 0.15);
}

/* Labels */
.img-1 .label,
.img-2 .label {
  position: absolute;
  bottom: 18px;

  padding: 10px 16px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.12);

  backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.18);

  color: #fff;

  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;

  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.25);

  z-index: 3;

  transition: opacity 0.3s ease; 
}

/* Mantém centralizado */
.img-2 .label {
  left: 18px;
}

.img-1 .label {
  right: 18px;
}

.slider {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.slider input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0; /* O input deve ficar invisível, mas cobrindo tudo */
  cursor: ew-resize;
  z-index: 2;
}

.slider .drag-line {
  pointer-events: none; /* O mouse passa direto pela linha e clica no input */
  z-index: 1;
}

/* Responsivo */
@media (max-width: 820px) {
  .wrapper {
    width: 100%;
    max-width: 750px;
    height: 420px;
    border-radius: 22px;
  }

  .slider .drag-line::before {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .image-comparisons {
    padding: 10px;
  }

  .wrapper {
    height: 320px;
  }

  .img-1 .label,
  .img-2 .label {
    font-size: 11px;
    padding: 8px 12px;
  }
}
