/* Botón volver arriba — apilado encima del lanzador Chatwoot */

#nuevo-movetop {
    display: none !important;
}

#movetop,
#custom-movetop-btn {
    position: fixed !important;
    right: var(--iadev-fab-edge, 18px) !important;
    bottom: calc(
        var(--iadev-fab-edge, 18px)
        + var(--iadev-chat-launcher-size, 112px)
        + var(--iadev-fab-gap, 14px)
    ) !important;
    width: var(--iadev-movetop-size, 48px) !important;
    height: var(--iadev-movetop-size, 48px) !important;
    background-color: #e74c3c !important;
    color: #fff !important;
    border-radius: 50% !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28) !important;
    z-index: 9996 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    padding: 0 !important;
    opacity: 1 !important;
}

#movetop.visible,
#custom-movetop-btn.visible {
    display: flex !important;
}

#movetop:hover,
#custom-movetop-btn:hover {
    background-color: #c0392b !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34) !important;
}

#movetop i,
#movetop span,
#custom-movetop-btn i {
    font-size: 22px !important;
    color: #fff !important;
    line-height: 1 !important;
}

body.has-conversion-sticky:not(.has-conversion-form-active) #movetop,
body.has-conversion-sticky:not(.has-conversion-form-active) #custom-movetop-btn {
    bottom: calc(
        72px
        + env(safe-area-inset-bottom, 0px)
        + var(--iadev-chat-launcher-size, 112px)
        + var(--iadev-fab-gap, 14px)
    ) !important;
}

@media (max-width: 767px) {
    html body.has-conversion-form-active a#movetop.visible,
    html body.has-conversion-form-active #movetop,
    html body.has-conversion-form-active #custom-movetop-btn.visible,
    html body.has-conversion-form-active #custom-movetop-btn {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: scale(0.001) !important;
        transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease !important;
    }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    html body.has-conversion-form-active a#movetop.visible,
    html body.has-conversion-form-active #movetop,
    html body.has-conversion-form-active #custom-movetop-btn.visible,
    html body.has-conversion-form-active #custom-movetop-btn {
        transition: none !important;
    }
}

/* Ocultar duplicados legacy (solo usamos #movetop) */
a#movetop:not(#custom-movetop-btn),
a.movetop:not(#custom-movetop-btn),
a.scroll-top:not(#custom-movetop-btn),
a.to-top:not(#custom-movetop-btn),
a.back-to-top:not(#custom-movetop-btn) {
    display: none !important;
}
