/**
 * Back to Top Button - Glassmorphism Style
 * Mobile-only floating button to scroll back to top
 */

/* Back to Top Button - Glassmorphism */
.back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #333;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    /* Below admin toolbar (9999) and any cart buttons */
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    align-items: center;
    justify-content: center;
}

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

.back-to-top-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.back-to-top-btn:active {
    transform: scale(0.95);
}

.back-to-top-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode adjustments */
[data-theme="dark"] .back-to-top-btn {
    background: rgba(50, 50, 70, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .back-to-top-btn:hover {
    background: rgba(70, 70, 100, 0.5);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* Only show on mobile */
@media (max-width: 767.98px) {
    .back-to-top-btn {
        display: flex;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .back-to-top-btn {
        transition: none;
    }
}
