.chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9980;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    pointer-events: none;
}

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

.chat-widget__panel {
    pointer-events: auto;
    width: min(600px, calc(100vw - 40px));
    height: min(560px, calc(100vh - 140px));
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transform: translateY(24px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.chat-widget.is-ready .chat-widget__panel {
    transition: transform 0.35s ease, opacity 0.28s ease, visibility 0.28s ease;
}

.chat-widget.is-open .chat-widget__panel {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.chat-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px 10px 18px;
    background: #000000;
    color: #ffffff;
}

.chat-widget__title {
    margin: 0;
    font-family: "bold", sans-serif;
    font-size: 15px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.chat-widget__close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.chat-widget__close:hover,
.chat-widget__close:focus {
    background: rgba(255, 255, 255, 0.24);
}

.chat-widget__close svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.chat-widget__frame {
    flex: 1 1 auto;
    min-height: 0;
    background: #f7f7f7;
}

.chat-widget__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.chat-widget__bubble {
    pointer-events: auto;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #000000;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-widget__bubble:hover,
.chat-widget__bubble:focus {
    background: #535353;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.chat-widget__bubble svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

@media (max-width: 639px) {
    .chat-widget {
        right: 12px;
        bottom: 12px;
        left: 12px;
        align-items: stretch;
    }

    .chat-widget__panel {
        width: 100%;
        height: min(70vh, calc(100vh - 108px));
        border-radius: 14px;
    }

    .chat-widget__bubble {
        align-self: flex-end;
        width: 58px;
        height: 58px;
    }
}
