#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  z-index: 900;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--accent-dark);
  animation: floatBounce 1s infinite alternate ease-in-out;
}

@keyframes floatBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

#back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-light);
  stroke-width: 2.5;
  fill: none;
}

[dir='rtl'] #back-to-top {
  right: auto;
  left: 24px;
}

@media (max-width: 768px) {
  #back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
  [dir='rtl'] #back-to-top {
    right: auto;
    left: 20px;
  }
}
