body {
    font-family: 'Arial', sans-serif;
    background-color: #f6f8fa;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.chat-container {
    max-width: 380px;
    width: 98vw;
    margin: 24px auto;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(36, 175, 242, 0.11), 0 1.5px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 88vh;
    border: 1.5px solid #e1e7ec;
    min-height: 500px;
    transition: all 0.3s ease-in-out;
}

.chat-header {
    background: linear-gradient(90deg, #34c3eb 0%, #1779ab 100%);
    color: #fff;
    padding: 18px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #d3f0fb;
    text-align: center;
}

.chat-messages {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 11px;
    background: #fafdff;
    scroll-behavior: smooth;
}

.message {
    padding: 11px 16px;
    border-radius: 18px;
    max-width: 84%;
    display: inline-block;
    line-height: 1.5;
    position: relative;
    font-size: 15px;
    box-shadow: 0 1px 4px rgba(36,175,242,0.03);
    margin-bottom: 4px;
    transition: background 0.2s;
    word-break: break-word;
}

.message.user {
    background: #d9eff8;
    align-self: flex-end;
    text-align: right;
    color: #145c7f;
    border-bottom-right-radius: 6px;
    border: 1.2px solid #b0d6e8;
}

.message.bot {
    background: #fff;
    align-self: flex-start;
    text-align: left;
    color: #222;
    border-bottom-left-radius: 6px;
    border: 1.2px solid #d0e3ed;
}

.product-card {
    margin: 8px 0;
    padding: 13px 11px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0.5px 4px rgba(36,175,242,0.07);
    border: 1px solid #e6f0fa;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.product-card img {
    width: 66px;
    height: 66px;
    object-fit: contain;
    border-radius: 7px;
    border: 1px solid #e4e8ed;
    background: #fff;
    flex-shrink: 0;
}

.product-card .product-details {
    flex: 1;
}

.product-card .product-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    color: #147cb5;
}

.product-card .product-price {
    font-weight: 600;
    color: #23a9e1;
    margin-bottom: 3px;
}

.product-card .product-link {
    color: #23a9e1;
    text-decoration: underline;
    font-size: 15px;
    font-weight: 500;
    margin-right: 10px;
}

.chat-input {
    display: flex;
    border-top: 1px solid #e1e7ec;
    padding: 12px 9px;
    background-color: #fafdff;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 19px;
    border: 1.2px solid #bde3f7;
    outline: none;
    background: #fff;
    transition: border 0.2s;
}

.chat-input input:focus {
    border: 1.5px solid #23a9e1;
}

.chat-input button {
    padding: 10px 22px;
    background: linear-gradient(90deg, #34c3eb 0%, #1779ab 100%);
    color: #fff;
    border: none;
    border-radius: 19px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 1px 4px rgba(36,175,242,0.09);
    transition: background 0.2s;
}

.chat-input button:hover {
    background: linear-gradient(90deg, #1779ab 0%, #34c3eb 100%);
}

.typing-indicator {
    display: inline-block;
    margin-left: 10px;
    height: 20px;
    width: 50px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #34c3eb;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* 🔧 MOBILE FIXES */
@media (max-width: 520px) {
    html, body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
    }

    .chat-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        margin: 0;
        z-index: 9999;
        flex-direction: column;
    }

    .chat-header {
        font-size: 18px;
        padding: 14px 10px;
    }

    .chat-messages {
        flex: 1;
        padding: 10px;
        height: calc(100vh - 140px);
        overflow-y: auto;
    }

    .message {
        font-size: 14px;
        padding: 9px 10px;
        max-width: 90%;
    }

    .chat-input {
        padding: 10px;
        gap: 6px;
    }

    .chat-input input {
        font-size: 15px;
        padding: 10px 12px;
    }

    .chat-input button {
        font-size: 15px;
        padding: 10px 16px;
    }

    .product-card {
        flex-direction: row;
        padding: 10px 8px;
        gap: 10px;
    }

    .product-card img {
        width: 48px;
        height: 48px;
    }

    .product-card .product-title,
    .product-card .product-link,
    .product-card .product-price {
        font-size: 14px;
    }
}
