/* Site-wide scroll-to-top, WhatsApp, and chat — match contact-us.php */

/* Always show the full stack once the page is scrollable (same as contact-us at scroll) */
#site-scroll,
#whatsapp-button {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.chatbot-widget {
    display: block !important;
    pointer-events: auto !important;
}

.chatbot-btn,
#chatbot-toggle {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Desktop + tablet stack (bottom → top: scroll, WhatsApp, chat) */
#site-scroll,
#whatsapp-button,
.chatbot-widget {
    right: 30px !important;
    left: auto !important;
}

#site-scroll {
    bottom: 30px !important;
    z-index: 10048 !important;
}

#whatsapp-button {
    bottom: 92px !important;
    z-index: 10049 !important;
}

.chatbot-widget {
    bottom: 154px !important;
    z-index: 10050 !important;
    overflow: visible !important;
}

.chatbot-window {
    z-index: 10051 !important;
}

.chatbot-widget.is-live-support-mode {
    width: min(340px, calc(100vw - 28px)) !important;
    height: auto !important;
    min-height: 0 !important;
}

.chatbot-widget.is-live-support-mode #chatbot-toggle {
    display: none !important;
}

.chatbot-widget.is-live-support-minimized {
    width: 52px !important;
    height: 52px !important;
    min-height: 0 !important;
}

@media only screen and (max-width: 767px) {
    #site-scroll,
    #whatsapp-button,
    .chatbot-widget {
        right: max(14px, env(safe-area-inset-right)) !important;
        left: auto !important;
    }

    #site-scroll,
    #whatsapp-button,
    .chatbot-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 44px !important;
    }

    #site-scroll {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
        font-size: 17px !important;
    }

    .chatbot-widget {
        bottom: calc(136px + env(safe-area-inset-bottom)) !important;
        width: 44px !important;
        height: 44px !important;
    }

    .chatbot-widget.is-live-support-mode {
        width: min(320px, calc(100vw - 20px)) !important;
        height: auto !important;
    }

    .chatbot-widget.is-live-support-minimized {
        width: 44px !important;
        height: 44px !important;
    }

    .chatbot-proactive-restore {
        width: 44px;
        height: 44px;
    }

    .chatbot-proactive-invite.is-minimized {
        width: 44px !important;
        height: 44px !important;
    }

    #whatsapp-button {
        bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        font-size: 18px !important;
    }

    #whatsapp-button i {
        font-size: 22px !important;
        line-height: 1 !important;
    }

    .chatbot-btn {
        right: 0 !important;
        bottom: 0 !important;
        font-size: 18px !important;
        line-height: 1 !important;
    }

    .chatbot-badge {
        top: -5px !important;
        right: -5px !important;
    }

    .chatbot-window {
        position: fixed !important;
        right: max(10px, env(safe-area-inset-right)) !important;
        left: max(10px, env(safe-area-inset-left)) !important;
        bottom: calc(134px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        height: min(520px, calc(100dvh - 180px)) !important;
        max-width: none !important;
        max-height: calc(100dvh - 180px) !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        transform-origin: right bottom !important;
        z-index: 10051 !important;
    }

    .chatbot-window {
        z-index: 10052 !important;
    }
}
