/**
 * Bouton global « Revenir en haut ».
 */
.ap-back-to-top {
    position: fixed;
    right: clamp(1rem, 2.5vw, 2rem);
    bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: var(--color-primary, #008a4b);
    box-shadow: 0 0.65rem 1.8rem rgba(0, 56, 31, 0.24);
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease,
        background-color 180ms ease;
}

.ap-back-to-top[hidden] {
    display: inline-flex;
}

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

.ap-back-to-top:hover {
    background: var(--color-primary-dark, #006d3b);
}

.ap-back-to-top:focus-visible {
    outline: 3px solid rgba(0, 138, 75, 0.3);
    outline-offset: 4px;
}

.ap-back-to-top__icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

@media (max-width: 520px) {
    .ap-back-to-top {
        width: 3rem;
        padding-inline: 0;
    }

    .ap-back-to-top__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ap-back-to-top {
        transition: none;
    }
}
