/* ===== AI Shop Assistant Pro ===== */

#aisa-chat-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#aisa-toggle-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.22);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
#aisa-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(0,0,0,0.28); }

/* Pulse animation on toggle button */
#aisa-toggle-btn::after {
    content: '';
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.35;
    animation: aisa-pulse 2.5s infinite;
}
@keyframes aisa-pulse {
    0%   { transform: scale(1); opacity: 0.35; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Chat Box */
#aisa-chat-box {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 360px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 56px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aisa-pop 0.28s cubic-bezier(.34,1.56,.64,1);
}
@keyframes aisa-pop {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
#aisa-chat-header {
    padding: 14px 18px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}
#aisa-bot-name  { font-size: 15px; font-weight: 600; }
#aisa-status    { font-size: 11px; opacity: 0.85; margin-top: 2px; }

/* Messages */
#aisa-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    min-height: 300px;
    max-height: 400px;
    scroll-behavior: smooth;
}

.aisa-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
    animation: aisa-in 0.18s ease;
}
@keyframes aisa-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.aisa-msg.bot  {
    background: #fff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.aisa-msg.user {
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing */
.aisa-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.aisa-typing span {
    width: 7px; height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: aisa-bounce 1.1s infinite;
}
.aisa-typing span:nth-child(2) { animation-delay: 0.18s; }
.aisa-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes aisa-bounce {
    0%,60%,100% { transform: translateY(0); }
    30% { transform: translateY(-7px); }
}

/* ===== PRODUCT CARD ===== */
.aisa-product-card {
    width: 100%;
    max-width: 290px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    overflow: hidden;
    align-self: flex-start;
    animation: aisa-in 0.25s ease;
    border: 1px solid #e2e8f0;
}

.aisa-product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f1f5f9;
    display: block;
}

.aisa-product-body {
    padding: 12px 14px;
}

.aisa-product-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aisa-product-desc {
    font-size: 11.5px;
    color: #64748b;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.aisa-product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.aisa-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.aisa-product-old-price {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
}

.aisa-sale-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.aisa-stock-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.aisa-stock-badge.in  { background: #dcfce7; color: #16a34a; }
.aisa-stock-badge.out { background: #fee2e2; color: #dc2626; }

.aisa-rating {
    font-size: 11px;
    color: #f59e0b;
    margin-bottom: 10px;
}

.aisa-product-actions {
    display: flex;
    gap: 8px;
}

.aisa-btn-cart {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
}
.aisa-btn-cart:hover    { opacity: 0.88; transform: translateY(-1px); }
.aisa-btn-cart:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.aisa-btn-view {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    white-space: nowrap;
}
.aisa-btn-view:hover { background: #f1f5f9; }

/* Multiple product cards */
.aisa-products-grid {
    align-self: flex-start;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aisa-products-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Add to cart success toast */
.aisa-toast {
    position: fixed;
    bottom: 110px;
    right: 24px;
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 100000;
    animation: aisa-toast-in 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.aisa-toast a { color: #7dd3fc; font-size: 12px; text-decoration: none; }
@keyframes aisa-toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input */
#aisa-chat-input-area {
    display: flex;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
    align-items: center;
}
#aisa-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}
#aisa-input:focus { border-color: #0ea5e9; background: #fff; }
#aisa-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%; border: none;
    color: white; cursor: pointer;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.2s, transform 0.15s;
    flex-shrink: 0;
}
#aisa-send-btn:hover    { opacity: 0.88; transform: scale(1.08); }
#aisa-send-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

#aisa-chat-footer {
    text-align: center;
    font-size: 10.5px;
    color: #94a3b8;
    padding: 6px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

/* Mobile */
@media (max-width: 420px) {
    #aisa-chat-box { width: calc(100vw - 32px); right: 50%; transform: translateX(50%); bottom: 84px; }
}
