/* ── Launcher pill ── */

.ec-chat-widget {
    position: fixed;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    column-gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--widget-bg-color, #7c3aed);
    font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    border-radius: 40px;
    box-shadow:
        0 6px 24px rgba(124, 58, 237, .35),
        0 2px 8px rgba(0, 0, 0, .12);
    cursor: pointer;
    z-index: 499;
    transition: transform .2s ease, box-shadow .2s ease;
}

.ec-chat-widget:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(124, 58, 237, .45),
        0 4px 12px rgba(0, 0, 0, .15);
}

.ec-chat-widget.left-corner  { left: 16px; }
.ec-chat-widget.right-corner { right: 16px; }

/* Icon — image or SVG container */
.ec-chat-widget-icon-wrap {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    border-radius: 50%;
}

.ec-chat-widget-icon-wrap img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
}

.ec-chat-widget-icon-wrap svg {
    width: 22px;
    height: 22px;
}

.ec-chat-widget-content {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    padding: 1px 2px 1px 0;
}

.ec-chat-widget-title {
    margin: 0;
    white-space: nowrap;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--widget-text-color, #ffffff);
}

.ec-chat-widget-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.15;
    color: var(--widget-status-color, #86efac);
}

.ec-chat-widget-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--widget-status-color, #86efac);
    box-shadow: 0 0 6px var(--widget-status-color, #86efac);
    animation: ec-pulse 2s ease-in-out infinite;
}

@keyframes ec-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}

/* ── Iframe panel ── */

.iframe-container {
    position: fixed;
    bottom: 0;
    z-index: 1001;
    background-color: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow:
        0 -4px 40px rgba(26, 21, 48, .18),
        0 0 0 1px rgba(124, 58, 237, .08);
    overflow: hidden;
}

.iframe-container.left-corner  { left: 0; }
.iframe-container.right-corner { right: 0; }

.iframe-container iframe {
    width: 100%;
    height: calc(100% - 48px);
    border: none;
}

/* ── Header bar ── */

.iframe-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    height: 48px;
    background: var(--header-bg-color, #7c3aed);
    color: var(--header-text-color, #ffffff);
    box-sizing: border-box;
}

.iframe-title {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    color: var(--header-text-color, #ffffff);
    letter-spacing: .01em;
}

.close-button {
    background: rgba(255, 255, 255, .12);
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, .25);
}

.close-button svg {
    width: 20px;
    height: 20px;
}

/* ── Mobile: full-screen ── */

@media (max-width: 899px) {
    .iframe-container {
        width: 100vw;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        border-radius: 0;
        z-index: 100001;
    }
    .iframe-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100002;
    }
    .iframe-container iframe {
        margin-top: 48px;
        height: calc(100% - 48px);
    }
}

/* ── Desktop: sized panel ── */

@media (min-width: 900px) {
    .iframe-container {
        width: var(--iframe-width);
        max-width: 100vw;
        height: var(--iframe-height);
    }
    .iframe-container iframe {
        width: 100%;
        height: calc(100% - 48px);
        border: none;
        overflow: auto;
    }
}
