/* ==============================================
   Back to Top Button
   ============================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease, color 0.2s ease;
    z-index: var(--z-back-to-top);
    -webkit-tap-highlight-color: transparent;
}

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

.back-to-top:hover {
    background: var(--color-primary);
    color: hsl(var(--primary-foreground));
    border-color: var(--color-primary);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: calc(var(--bottom-tab-height, 56px) + 1rem);
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}
