/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 48px;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s cubic-bezier(0.75, 0.02, 0.5, 1),
              visibility 0.3s cubic-bezier(0.75, 0.02, 0.5, 1),
              transform 0.3s cubic-bezier(0.75, 0.02, 0.5, 1),
              background-color 0.25s cubic-bezier(0.75, 0.02, 0.5, 1);
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Hide scroll-to-top on vehicle detail pages */
body.has-vehicle-detail .scroll-to-top {
  display: none !important;
}

.scroll-to-top.visible {
  opacity: 0.7;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:active {
  background-color: #1a1a1a;
  transform: translateY(0) scale(0.95);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
  .scroll-to-top {
    bottom: 90px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  
  /* Higher position on vehicle detail pages */
  body.has-vehicle-detail .scroll-to-top {
    bottom: 250px;
  }
  
  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: none;
  }
}
