.ai-chatbot {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1045;
    font-family: var(--primary-font, Arial, sans-serif);
}

.ai-chatbot-toggle,
.ai-chatbot-close,
.ai-chatbot-form button {
    border: 0;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.ai-chatbot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--warehouse-yellow, #ffe735);
    color: #111;
    box-shadow: 0 14px 36px rgba(3, 0, 155, 0.22);
    font-size: 1.35rem;
}

.ai-chatbot-toggle:hover,
.ai-chatbot-toggle:focus {
    background: var(--warehouse-yellow-strong, #f7d600);
}

.ai-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(370px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 116px));
    display: none;
    grid-template-rows: auto 1fr auto auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--warehouse-line, #e8e8ef);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(15, 18, 32, 0.24);
}

.ai-chatbot.is-open .ai-chatbot-panel {
    display: grid;
}

.ai-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: var(--warehouse-blue, #03009b);
    color: #fff;
}

.ai-chatbot-kicker {
    display: block;
    color: var(--warehouse-yellow, #ffe735);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
}

.ai-chatbot-header h2 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.ai-chatbot-close {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ai-chatbot-close:hover,
.ai-chatbot-close:focus {
    background: rgba(255, 255, 255, 0.24);
}

.ai-chatbot-messages {
    padding: 16px;
    overflow-y: auto;
    background: #f7f8fb;
}

.ai-chatbot-message {
    display: flex;
    margin-bottom: 12px;
}

.ai-chatbot-message-user {
    justify-content: flex-end;
}

.ai-chatbot-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    color: #171721;
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
    overflow-wrap: anywhere;
}

.ai-chatbot-message-user .ai-chatbot-bubble {
    background: var(--warehouse-blue, #03009b);
    color: #fff;
}

.ai-chatbot-product,
.ai-chatbot-order {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    color: #171721;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--warehouse-line, #e8e8ef);
    border-radius: 8px;
}

.ai-chatbot-order {
    grid-template-columns: 1fr;
}

.ai-chatbot-product img {
    width: 58px;
    height: 58px;
    border-radius: 6px;
    object-fit: cover;
    background: #f1f1f5;
}

.ai-chatbot-product strong,
.ai-chatbot-order strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.88rem;
    line-height: 1.25;
}

.ai-chatbot-description {
    display: block;
    margin-bottom: 5px;
    color: #5d5d69;
    font-size: 0.78rem;
    line-height: 1.35;
}

.ai-chatbot-markdown-list {
    margin: 6px 0 0;
    padding-left: 18px;
}

.ai-chatbot-bubble code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(3, 0, 155, 0.08);
    color: var(--warehouse-blue, #03009b);
    font-size: 0.84em;
}

.ai-chatbot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #5d5d69;
    font-size: 0.78rem;
}

.ai-chatbot-price {
    color: var(--warehouse-blue, #03009b);
    font-weight: 800;
}

.ai-chatbot-view-link {
    display: inline-flex;
    margin-top: 7px;
    color: var(--warehouse-blue, #03009b);
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-chatbot-typing {
    align-items: center;
    gap: 5px;
    padding: 0 16px 12px;
    background: #f7f8fb;
}

.ai-chatbot-typing:not([hidden]) {
    display: flex;
}

.ai-chatbot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warehouse-blue, #03009b);
    animation: aiChatbotTyping 0.9s infinite ease-in-out;
}

.ai-chatbot-typing span:nth-child(2) {
    animation-delay: 0.12s;
}

.ai-chatbot-typing span:nth-child(3) {
    animation-delay: 0.24s;
}

.ai-chatbot-form {
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--warehouse-line, #e8e8ef);
}

.ai-chatbot-form input {
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--warehouse-line, #e8e8ef);
    border-radius: 6px;
    color: #171721;
    outline: 0;
}

.ai-chatbot-form input:focus {
    border-color: var(--warehouse-blue, #03009b);
    box-shadow: 0 0 0 3px rgba(3, 0, 155, 0.08);
}

.ai-chatbot-form button {
    width: 46px;
    height: 44px;
    border-radius: 6px;
    background: var(--warehouse-yellow, #ffe735);
    color: #111;
}

.ai-chatbot-form button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@keyframes aiChatbotTyping {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 575.98px) {
    .ai-chatbot {
        right: 14px;
        bottom: 14px;
    }

    .ai-chatbot-panel {
        bottom: 68px;
        width: calc(100vw - 28px);
        height: min(520px, calc(100vh - 96px));
    }

    .ai-chatbot-toggle {
        width: 54px;
        height: 54px;
    }
}
