/* Back to top — public & admin */

.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 5.75rem;
    z-index: 998;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--brand, #ca591b);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-brand, 0 4px 18px rgba(202, 89, 27, 0.28));
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
}

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

.back-to-top:hover {
    background: var(--brand-dark, #a34715);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--brand, #ca591b);
    outline-offset: 2px;
}

/* No WhatsApp widget — sit at default corner */
body:not(:has(.whatsapp-float)) .back-to-top {
    bottom: 1.5rem;
}

.admin-body .back-to-top {
    bottom: 1.5rem;
    background: #3f3d3c;
}

.admin-body .back-to-top:hover {
    background: #000000;
}

@media (max-width: 640px) {
    .back-to-top {
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    body:not(:has(.whatsapp-float)) .back-to-top {
        bottom: 1rem;
    }

    body:has(.whatsapp-float) .back-to-top {
        bottom: 5.25rem;
    }
}
