.back-to-top {
  position: fixed;
  bottom: 50px;
  right: 50px;
  text-decoration: none;
  width: max-content;

  /* State Control */
  z-index: 102; 
  opacity: 0; 
}

/* State: Class added by JavaScript to make the button visible */
body a.back-to-top.show {
  opacity: 1;
}

/* --- For Mobile Screens  --- */

@media screen and (max-width: 768px) {
  .back-to-top {
    z-index: 501;
    bottom: auto; 
    top: 60px; 
    right: 50px; 
    height: auto;
  }
}
