/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--primary-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    box-shadow: 0 4px 12px rgba(26, 31, 54, 0.15);
    font-size: 20px;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}

.back-to-top:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.15);
}

.back-to-top:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth scroll behavior for supported browsers */
html {
    scroll-behavior: smooth;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: opacity 0.1s ease-in-out, visibility 0.1s ease-in-out;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Keyboard focus visible */
.back-to-top:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
