/* Live chat bubble and widget container */
.chat-bubble-wrap {
    position: fixed;
    z-index: 9999;
}
.chat-bubble-wrap.chat-bubble-bottom-right {
    bottom: 24px;
    right: 24px;
}
.chat-bubble-wrap.chat-bubble-bottom-left {
    bottom: 24px;
    left: 24px;
}

.chat-bubble-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--bubble-bg, #2563eb);
    color: var(--bubble-icon, #ffffff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.chat-bubble-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14), 0 3px 8px rgba(0, 0, 0, 0.08);
    filter: brightness(0.97);
}
.chat-bubble-btn:active {
    transform: translateY(0) scale(1);
}
.chat-bubble-btn:focus-visible {
    outline: 2px solid var(--bubble-bg, #2563eb);
    outline-offset: 2px;
}

.chat-bubble-icon {
    pointer-events: none;
}

/* Bubble icon animation when widget is open (tail points up); only when enabled */
.chat-bubble-wrap--animate .chat-bubble-icon {
    transition: transform 0.28s ease;
}
.chat-bubble-wrap--animate .chat-bubble-btn.is-open .chat-bubble-icon {
    transform: rotate(180deg);
}
.chat-bubble-wrap--animate .chat-bubble-btn.is-open .chat-bubble-icon img {
    transform: rotate(180deg);
}

.chat-widget-container {
    position: absolute;
    bottom: 62px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 704px;
    max-height: calc(100vh - 72px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: chat-widget-open 0.22s ease-out;
}

/* LiveChat-style theme: 360×682 desktop, 100% responsive on small screens */
.chat-widget-container[data-widget-theme="livechat"] {
    width: 360px;
    height: 682px;
    max-height: calc(100vh - 72px);
}
@media (max-width: 480px) {
    .chat-widget-container[data-widget-theme="livechat"] {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 62px;
        width: 100%;
        max-width: none;
        height: calc(100vh - 62px);
        max-height: calc(100vh - 62px);
        border-radius: 18px 18px 0 0;
    }
    .chat-bubble-bottom-right .chat-widget-container[data-widget-theme="livechat"],
    .chat-bubble-bottom-left .chat-widget-container[data-widget-theme="livechat"] {
        left: 0;
        right: 0;
    }
}

@keyframes chat-widget-open {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 420px) {
    .chat-widget-container {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 62px;
        width: 100%;
        max-width: none;
        border-radius: 18px 18px 0 0;
    }
    .chat-bubble-bottom-right .chat-widget-container,
    .chat-bubble-bottom-left .chat-widget-container {
        left: 0;
        right: 0;
    }
}
.chat-bubble-bottom-right .chat-widget-container {
    right: 0;
}
.chat-bubble-bottom-left .chat-widget-container {
    left: 0;
}

.chat-widget-container[hidden] {
    display: none !important;
}

.chat-widget-container iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}
