#cwaa-chat-root {
    position: fixed;
    bottom: 25px;
    z-index: 999999;
    font-family: system-ui, -apple-system, sans-serif;
}
/* Direction Matrix Layout Controls */
.cwaa-rtl {
    right: 25px;
    direction: rtl;
    text-align: right;
}
.cwaa-ltr {
    left: 25px;
    direction: ltr;
    text-align: left;
}
#cwaa-launcher {
    background: #161616;
    color: #fff;
    padding: 14px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#cwaa-window {
    width: 360px;
    height: 520px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    position: absolute;
    bottom: 65px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cwaa-rtl #cwaa-window { right: 0; }
.cwaa-ltr #cwaa-window { left: 0; }

#cwaa-header {
    background: #f5f5f7;
    padding: 15px;
    border-bottom: 1px solid #e5e5ea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cwaa-close-btn { cursor: pointer; color: #8e8e93; }
#cwaa-messages-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fafafa;
}
.cwaa-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
}
.cwaa-bot-msg { background: #e5e5ea; color: #000; }
.cwaa-user-msg { background: #007aff; color: #fff; }

.cwaa-rtl .cwaa-bot-msg { margin-left: auto; }
.cwaa-rtl .cwaa-user-msg { margin-right: auto; }
.cwaa-ltr .cwaa-bot-msg { margin-right: auto; }
.cwaa-ltr .cwaa-user-msg { margin-left: auto; }

#cwaa-input-row {
    display: flex;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5e5ea;
}
#cwaa-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d1d6;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}
#cwaa-input-row button {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}
.cwaa-rtl #cwaa-input-row button { margin-right: 8px; }
.cwaa-ltr #cwaa-input-row button { margin-left: 8px; }

/* Elegant Product Card In-Chat Styling */
.cwaa-product-card {
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.cwaa-product-card h4 { margin: 0 0 6px 0; font-size: 15px; color: #1c1c1e; }
.cwaa-price { font-weight: bold; color: #007aff; font-size: 16px; margin-bottom: 6px; }
.cwaa-stock-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 8px;
}
.cwaa-stock-badge.in-stock { background: #e2f9e9; color: #1a7f37; }
.cwaa-stock-badge.out-stock { background: #ffebe9; color: #cf222e; }
.cwaa-buy-btn {
    display: block;
    text-align: center;
    background: #161616;
    color: #fff !important;
    text-decoration: none !important;
    padding: 6px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s;
}
.cwaa-buy-btn:hover { background: #007aff; }
.cwaa-typing { animation: pulse 1.5s infinite; }
@keyframes pulse { 0% {opacity: 0.4;} 50% {opacity: 1;} 100% {opacity: 0.4;} }