  #backToTop {
    display: block; /* Show on small screens */position: fixed;
  bottom: 70px;
  right: 30px;
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  background-color: #865E47;
  color: #E6C3A0;
  font-size: 28px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  pointer-events: none; /* disable clicks when hidden */
  opacity: 0;
  visibility: hidden;
}

#backToTop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* enable clicks when visible */
}

#backToTop:hover {
  transform: scale(1.1);
  background-color: #E6C3A0;
  color: #865E47;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

@media (max-width: 2560px) {
  #backToTop {
    width: 70px;
    height: 70px;
    font-size: 35px;
     right: 30px; /* distance from the right edge */
    bottom: 40px; /* distance from the bottom */
}
}
@media (max-width: 1024px) {
  #backToTop {
    width: 50px;
    height: 50px;
    font-size: 24px;
     right: 30px; /* distance from the right edge */
    bottom: 40px; /* distance from the bottom */
  }
}

/* For mobile (max-width: 390px) */
@media (max-width: 390px) {
  #backToTop {
    width: 40px;
    height: 40px;
    font-size: 20px;
     right: 10px; /* distance from the right edge */
    bottom: 40px; /* distance from the bottom */
  }
}
