/* =========================================================
 * Bouton Retour en haut for Elementor
 * ========================================================= */

.sst-button {
    --sst-offset-x: 30px;
    --sst-offset-y: 30px;
    --sst-anim-duration: 0.4s;

    box-sizing: border-box;
    position: fixed !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 50px;
    height: 50px;
    max-width: none;
    align-self: center !important;
    margin: 0;
    padding: 0;
    border: none;
    background-color: #1e1e1e;
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: opacity var(--sst-anim-duration) ease,
                visibility var(--sst-anim-duration) ease,
                transform var(--sst-anim-duration) ease,
                background-color 0.3s ease,
                color 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Dans l'éditeur Elementor, le bouton reste visible (position fixe ignorée
   dans l'iframe de prévisualisation) pour permettre son édition. */
.elementor-editor-active .sst-button {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none !important;
    animation: none !important;
}

.sst-button.sst-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sst-button[data-animation="none"] {
    transition-duration: 0s, 0s, 0s, 0.3s, 0.3s;
}

/* Animation d'apparition — état initial (masqué) par type */
.sst-button[data-animation="slide-up"],
.sst-button[data-animation="bounce"] {
    transform: translateY(20px);
}

.sst-button[data-animation="zoom"] {
    transform: scale(0.5);
}

/* État visible : retour à la position/échelle normale */
.sst-button[data-animation="slide-up"].sst-visible {
    transform: translateY(0);
}

.sst-button[data-animation="zoom"].sst-visible {
    transform: scale(1);
}

.sst-button[data-animation="bounce"].sst-visible {
    transform: translateY(0);
    animation: sst-bounce-in var(--sst-anim-duration) cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sst-bounce-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    60% {
        opacity: 1;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.sst-button.sst-placement-bottom-right {
    right: var(--sst-offset-x);
    bottom: var(--sst-offset-y);
}

.sst-button.sst-placement-bottom-left {
    left: var(--sst-offset-x);
    bottom: var(--sst-offset-y);
}

.sst-button.sst-placement-top-right {
    right: var(--sst-offset-x);
    top: var(--sst-offset-y);
}

.sst-button.sst-placement-top-left {
    left: var(--sst-offset-x);
    top: var(--sst-offset-y);
}

.sst-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sst-icon i,
.sst-icon svg {
    width: 100%;
    height: 100%;
    font-size: inherit;
}

.sst-text {
    white-space: nowrap;
}
