/* CSS Dinâmico Baseado em Variáveis */


@keyframes sbttFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sbttPulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 15px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.sbtt-btn {
    position: fixed;
    bottom: var(--sbtt-bottom, 90px);
    right: var(--sbtt-right, 20px);
    left: var(--sbtt-left, auto);
    /* Suporte a esquerda */
    width: var(--sbtt-size, 60px);
    height: var(--sbtt-size, 60px);
    aspect-ratio: 1 / 1;
    background-color: var(--sbtt-bg-color, #333333);
    color: var(--sbtt-icon-color, #ffffff) !important;
    border: 2px solid var(--sbtt-border-color, rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box;
    /* Maintain size with border */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    /* Remove padding padrão do navegador */

    /* Estado Inicial (Escondido) */
    opacity: 0;
    visibility: hidden;
    transform: translateX(var(--sbtt-x-offset, 0px)) translateY(20px) scale(0.8);
    transition: transform var(--sbtt-anim-duration, 450ms) var(--sbtt-anim-easing, cubic-bezier(0.22, 1, 0.36, 1)), opacity var(--sbtt-anim-duration, 450ms) ease, box-shadow var(--sbtt-anim-duration, 450ms) ease, visibility 0s linear var(--sbtt-anim-duration, 450ms);
    /* Efeito Bouncy */

    z-index: 99990;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sbtt-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(var(--sbtt-x-offset, 0px)) translateY(0) scale(1);
    transition-delay: 0s;
}

.sbtt-btn:hover {
    background-color: var(--sbtt-bg-color, #333333) !important;
    /* Trava a cor! */
    color: var(--sbtt-icon-color, #ffffff) !important;
    transform: translateX(var(--sbtt-x-offset, 0px)) translateY(-5px) scale(1.1);
    /* Pulo e Aumento Restaurado */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    /* filter: none; -> Sem mudança de cor */
}

/* Ícone */
.sbtt-btn-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 0;
}

.sbtt-btn-icon svg {
    width: 24px !important;
    height: 24px !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    stroke-width: 2.5px;
    display: block !important;
    transform-origin: center center;
    transform: scale(var(--sbtt-icon-scale, 0.4));
    transition: none;
}

.sbtt-btn:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.85);
    outline-offset: 3px;
}

/* Tablet Responsiveness */
@media (max-width: 768px) {
    .sbtt-btn {
        /* Alinhamento de tablet: usa valores dinâmicos do PHP */
        bottom: var(--sbtt-bottom, 90px) !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    /* Valores são injetados dinamicamente pelo PHP via media queries inline */
    /* Os !important abaixo são apenas para garantir prioridade sobre temas */
    .sbtt-btn {
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        border-radius: 50% !important;
        transition: all var(--sbtt-anim-duration, 450ms) var(--sbtt-anim-easing, cubic-bezier(0.22, 1, 0.36, 1)) !important;
        animation: sbttPulse 2s infinite !important;
    }

    /* Force Hover to match WhatsApp (Scale only, no Translate) */
    .sbtt-btn:hover {
        transform: translateX(var(--sbtt-x-offset, 0px)) scale(1.1) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
        background-color: var(--sbtt-bg-color, #333333) !important;
        /* Prevent color flicker */
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbtt-btn,
    .sbtt-btn.visible,
    .sbtt-btn:hover {
        animation: none !important;
        transition: none !important;
        transform: translateX(var(--sbtt-x-offset, 0px)) !important;
    }

    .sbtt-btn-icon {
        transform: translate(-50%, -50%) !important;
    }
}