* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* WRAPPER MASSE WERDEN MIT JS berechnet before_after
} */
.r_before_after_wrapper {
  position: relative;
  /* height: 540px; */
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  width: 100%;
  margin: auto;
  /* overflow: hidden; */
  cursor: pointer;
  /* max-height: 100vh; */
  max-height: 80vh;
}

.overlay-text {
  position: absolute;
  top: 18%;
  left: 6.5%;
  z-index: 2;
}

.overlay-text h1 {
  font-size: 55px;
  line-height: 1.1;
  z-index: 2;
}

.overlay-text span {
  font-size: 55px;
  line-height: 1.1;
  z-index: 1;
}

.r_headline span {
  text-align: left;
  position: absolute;
  font-size: 120px;
  line-height: 1;
  top: 33%;
  left: 5%;
  color: #A8A8A8;
  /* Base aluminum-like color */
  background: linear-gradient(45deg, #969696, #9e9e9e, #c0c0c0);
  /* Subtle metallic gradient */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.r_slider_wrapper {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  border-right: 1px solid rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.r_before_image, .r_after_image {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  /* width: 100vw; */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.r_headline {
  position: absolute;
  text-align: center;
  z-index: 1;
  color: #black;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  margin: 0;
}

.r_before_image {
  background-image: url('../img/loftduschen/nachher.jpg');
  z-index: 0;
}

.r_after_image {
  background-image: url('../img/loftduschen/vorher.jpg');
  z-index: 1;
}

.r_slider_btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* background-color: #fff; */
  width: 90px;
  height: 90px;
  z-index: 2;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, .5);
  /* overflow: hidden; */
}

.r_slider_icon {
  position: absolute;
  background-color: #fff;
  z-index: 2;
  display: block;
}

.r_left {
  left: 1px;
  top: 0;
  width: 45px;
  height: 90px;
  border-bottom-left-radius: 45px;
  border-top-left-radius: 45px;
}

.r_right {
  left: calc(50% - 1px);
  top: 0;
  width: 45px;
  height: 90px;
  border-bottom-right-radius: 45px;
  border-top-right-radius: 45px;
}

.r_slider_icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  fill: black;
  transform: translate(-50%, -50%);
  font-size: 20px !important;
}

.r_slider_btn:before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  width: 55px;
  height: 110px;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1;
  border-bottom-left-radius: 55px;
  border-top-left-radius: 55px;
}

.r_slider_btn:after {
  content: '';
  position: absolute;
  top: -10px;
  left: 45px;
  width: 55px;
  height: 110px;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-bottom-right-radius: 55px;
  border-top-right-radius: 55px;
}

/*MEDIA QUERIES*/
@media(max-width: 996px) {
  .r_headline span {
    text-align: left;
    position: absolute;
    font-size: 90px;
    line-height: 1;
    top: 30%;
    left: 5%;
    color: #A8A8A8;
    /* Base aluminum-like color */
    background: linear-gradient(45deg, #969696, #9e9e9e, #c0c0c0);
    /* Subtle metallic gradient */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .overlay-text {
    position: absolute;
    top: 15%;
    left: 6%;
    z-index: 2;
  }
}

@media(max-width: 768px) {
  .r_before_after_wrapper {
    height: 400px;
  }

  .r_slider_btn {
    width: 60px;
    height: 60px;
  }

  .r_left {
    width: 30px;
    height: 60px;
    border-bottom-left-radius: 30px;
    border-top-left-radius: 30px;
  }

  .r_right {
    width: 30px;
    height: 60px;
    border-bottom-right-radius: 30px;
    border-top-right-radius: 30px;
  }

  .r_slider_btn:before {
    top: -10px;
    left: -10px;
    width: 40px;
    height: 80px;
    border-bottom-left-radius: 55px;
    border-top-left-radius: 55px;
  }

  .r_slider_btn:after {
    content: '';
    position: absolute;
    top: -10px;
    left: 30px;
    width: 40px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-bottom-right-radius: 55px;
    border-top-right-radius: 55px;
  }

  .r_headline span {
    font-size: 66px;
    line-height: 1;
  }

  .overlay-text h1 {
    font-size: 40px;
    line-height: 1.1;
    z-index: 2;
  }
}

@media(max-width: 576px) {
  .r_slider_btn {
    width: 30px;
    height: 30px;
  }

  .r_left {
    width: 15px;
    height: 30px;
    border-bottom-left-radius: 15px;
    border-top-left-radius: 15px;
    left: 1px;
  }

  .r_right {
    width: 15px;
    height: 30px;
    border-bottom-right-radius: 15px;
    border-top-right-radius: 15px;
    left: 50%;
  }

  .r_slider_btn:before {
    top: -5px;
    left: -5px;
    width: 20px;
    height: 40px;
    border-bottom-left-radius: 55px;
    border-top-left-radius: 55px;
  }

  .r_slider_btn:after {
    top: -5px;
    left: 15px;
    width: 20px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-bottom-right-radius: 55px;
    border-top-right-radius: 55px;
  }

  .r_headline {
    font-size: 18px;
  }

  .overlay-text {
    position: absolute;
    top: 15%;
    left: 6%;
    z-index: 2;
  }

  .overlay-text h1 {
    font-size: 35px;
    line-height: 1.1;
    z-index: 2;
  }

  .overlay-text span {
    font-size: 55px;
    line-height: 1.1;
    z-index: 1;
  }

  .r_headline span {
    font-size: 50px;
    line-height: 1.1;
    top: 32%;
    left: 5%;
  }
}

/*
  finger animation styles
*/
.r_finger_animation {
  position: absolute;
  top: 57%;
  /* Kept as per your code */
  z-index: 3;
  left: 70%;
  /* transform: translate(-50%, -120px); */
}

.r_finger_animation svg {
  height: 60px;
  overflow: visible;
  /* transform: translateX(5px); */
}

/*svg*/
.cls-1 {
  fill: #000000;
}

.cls-2 {
  fill: none;
  stroke: #000000;
  stroke-width: 2px;
}

.cls-2, .cls-3 {
  stroke-miterlimit: 10;
}

.cls-3 {
  fill: none;
  stroke: #231f20;
  stroke-width: 0.75px;
}

#arrow {
  transform: translateX(0px);
  opacity: 1;
  z-index: 1;
  /* Lower z-index for arrow */
  -webkit-animation-name: arrow-movement;
  animation-name: arrow-movement;
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
  -webkit-animation-duration: 2s;
  animation-duration: 2s;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  -webkit-animation-fill-mode: forwards;
  animation-fill-mode: forwards;
}

#hand {
  transform: translate(-50%, -28px) translateX(20px) rotate(-90deg);
  /* Adjusted translateY to 0px for vertical alignment, kept right side */
  z-index: 2;
  /* Higher z-index for hand */
  -webkit-animation-name: hand-movement;
  animation-name: hand-movement;
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
  -webkit-animation-duration: 2s;
  animation-duration: 2s;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  -webkit-animation-fill-mode: forwards;
  animation-fill-mode: forwards;
}

@-webkit-keyframes arrow-movement {
  0% {
    transform: rotate(-180deg) translateX(-10px);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: rotate(-180deg) translateX(0px);
    opacity: 0;
  }
}

@keyframes arrow-movement {
  0% {
    transform: rotate(-180deg) translateX(-10px);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: rotate(-180deg) translateX(0px);
    opacity: 0;
  }
}

@-webkit-keyframes hand-movement {
  0% {
    transform: translate(-50%, -28px) translateX(25px) rotate(-90deg);
    /* Start further right */
  }

  50% {
    transform: translate(-50%, -28px) translateX(15px) rotate(-90deg);
    /* Move left */
  }

  100% {
    transform: translate(-50%, -28px) translateX(25px) rotate(-90deg);
    /* Back to right */
  }
}

@keyframes hand-movement {
  0% {
    transform: translate(-50%, -28px) translateX(25px) rotate(-90deg);
    /* Start further right */
  }

  50% {
    transform: translate(-50%, -28px) translateX(15px) rotate(-90deg);
    /* Move left */
  }

  100% {
    transform: translate(-50%, -28px) translateX(25px) rotate(-90deg);
    /* Back to right */
  }
}

@media(max-width: 1200px) {
  .r_finger_animation {
    top: 58%;
    left: 68%;
  }
}

@media(max-width: 996px) {
  .r_finger_animation {
    top: 60%;
    left: 65%;
  }
}

@media(max-width: 768px) {
  .r_finger_animation {
    top: 61%;
    left: 64%;
  }
}

@media(max-width: 576px) {
  .r_finger_animation {
    top: 65%;
    left: 63%;
  }

  .r_finger_animation svg {
    height: 50px;
  }
}

.r_before_after_wrapper {
  touch-action: pan-y;
  /* Allow vertical touch scrolling by default */
}
