.proland-back-to-top {
    position: fixed;
    inset-inline-end: max(
        1rem,
        calc(
            (100vw - var(--wp--style--global--content-size, 900px)) / 2 + 1rem
        )
    );
    bottom: 1.5rem;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 3rem;
    height: 3rem;

    border: none;
    border-radius: 999px;
    cursor: pointer;

    font-size: 1.4rem;
    line-height: 1;

    background-color: var(--wp--preset--color--primary, #000);
    color: var(--wp--preset--color--base, #fff);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);

    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Visible after scroll */
.proland-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* When moved above the footer we still want smooth motion */
.proland-back-to-top.is-above-footer {
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* Hover / focus states */
.proland-back-to-top:hover,
.proland-back-to-top:focus-visible {
    outline: none;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
    background-color: var(--wp--preset--color--primary-variant, #111);
}

/* High-contrast focus ring */
.proland-back-to-top:focus-visible {
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px var(--wp--preset--color--primary, #000);
}

/* Smaller screens: just keep it 1rem from edge */
@media (max-width: 782px) {
    .proland-back-to-top {
        inset-inline-end: 1rem;
        bottom: 1rem;
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.2rem;
    }
}
