/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #de0039 0%, #b3002e 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  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 10px 22px rgba(179, 0, 46, 0.35);
}

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

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

.scroll-to-top:hover {
  background: linear-gradient(135deg, #ff1a4f 0%, #c60033 100%);
  opacity: 1;
  box-shadow: 0 14px 28px rgba(179, 0, 46, 0.4);
}

.scroll-to-top:active {
  background: linear-gradient(135deg, #b3002e 0%, #8c0024 100%);
  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;
  }
}
