/**
 * Fixed dock: on-page chat (Typebot) + WhatsApp — bottom-right.
 */

/*
 * Typebot @0.3.x ignores theme.button.isHidden — the default launcher still renders.
 * We open the bubble via #floating-chat-fab only; hide the duplicate launcher.
 */
typebot-bubble::part(button) {
    display: none !important;
}

/*
 * One shell for Typebot + FAB dock = same global stacking level (chat no longer under footer).
 * Shell: pointer-events none; children opt-in. Dock after bubble in DOM so FABs stay clickable.
 * Do NOT use transform on ::part(bot) (breaks inner fixed vs page stack). Lift: bottom offset.
 */
#b2b-floating-overlays {
    position: fixed;
    inset: 0;
    z-index: 2147483010;
    pointer-events: none;
    isolation: isolate;
}

#b2b-floating-overlays > typebot-bubble {
    pointer-events: auto;
}

#b2b-floating-overlays > #floating-contact-dock {
    pointer-events: none;
}

typebot-bubble::part(bot) {
    bottom: 5rem !important;
    /* Opaque panel: matches site theme (no rgba bleed-through over the page). */
    background-color: var(--background-color) !important;
}

#contact {
    position: relative;
    z-index: 0;
}

body > footer.footer,
footer.footer {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.floating-contact-dock {
    position: fixed;
    z-index: auto;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
    visibility: visible;
}

.floating-contact-dock > * {
    pointer-events: auto;
}

.floating-fab {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1.45rem;
    line-height: 1;
    color: #fff;
}

.floating-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.floating-fab:active {
    transform: translateY(0);
}

.floating-fab:focus {
    outline: none;
}

.floating-fab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.floating-fab--secondary-contact:focus-visible {
    outline-color: #0d9488;
}

.floating-fab--chat {
    background: #0071e3;
}

.floating-fab--chat:hover {
    background: #0062c7;
}

.floating-fab--secondary-contact {
    background: linear-gradient(145deg, var(--whatsapp-green, #25d366) 0%, var(--whatsapp-light-green, #128c7e) 100%);
}

.floating-fab--secondary-contact:hover {
    filter: brightness(1.05);
}

.floating-secondary-contact-icon {
    display: block;
    width: 22px;
    height: 22px;
}

.floating-fab:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}
