/* Exotics India AI Shopping Assistant */
:root { --ai-color: #27ABF3; }

#exotics-ai-wrap {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Bubble ── */
#exotics-ai-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
#exotics-ai-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.3); }

#exotics-ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Chat Window ── */
#exotics-ai-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ai-pop-in .25s ease;
}

@keyframes ai-pop-in {
    from { opacity:0; transform: translateY(16px) scale(.97); }
    to   { opacity:1; transform: none; }
}

/* ── Header ── */
.ai-header {
    background: var(--ai-color);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ai-header-info { display:flex; align-items:center; gap:10px; }
.ai-avatar { font-size:28px; background:rgba(255,255,255,.2); border-radius:50%; width:42px; height:42px; display:flex; align-items:center; justify-content:center; }
.ai-name   { font-weight:700; font-size:15px; }
.ai-status { font-size:11px; opacity:.85; }
.ai-header-actions { display:flex; align-items:center; gap:8px; }
.ai-cart-btn { color:#fff; text-decoration:none; font-size:16px; background:rgba(255,255,255,.2); padding:4px 10px; border-radius:20px; }
.ai-close-btn { background:none; border:none; color:#fff; font-size:18px; cursor:pointer; padding:4px 8px; opacity:.8; }
.ai-close-btn:hover { opacity:1; }

/* ── Messages ── */
.ai-messages {
    height: 320px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8faff;
}

.ai-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ai-msg.ai  { background:#fff; border:1px solid #e8edf5; border-bottom-left-radius:4px; align-self:flex-start; color:#1a1a2e; }
.ai-msg.user { background:var(--ai-color); color:#fff; border-bottom-right-radius:4px; align-self:flex-end; }

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}
.ai-typing span {
    width: 8px; height: 8px;
    background: var(--ai-color);
    border-radius: 50%;
    animation: ai-bounce .8s infinite;
    opacity: .4;
}
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce {
    0%,80%,100% { transform:translateY(0); opacity:.4; }
    40%          { transform:translateY(-6px); opacity:1; }
}

/* ── Product Cards ── */
.ai-products {
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    background: #f8faff;
    border-top: 1px solid #eef0f8;
}
.ai-products::-webkit-scrollbar { height: 4px; }
.ai-products::-webkit-scrollbar-thumb { background: var(--ai-color); border-radius: 2px; }

.ai-product-card {
    min-width: 150px;
    max-width: 150px;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow .2s;
}
.ai-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.ai-product-card img  { width:100%; height:110px; object-fit:cover; }
.ai-product-info { padding: 8px; }
.ai-product-name { font-size:12px; font-weight:600; color:#1a1a2e; margin-bottom:4px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ai-product-price { font-size:13px; font-weight:700; color:var(--ai-color); margin-bottom:6px; }
.ai-product-btn {
    width: 100%;
    padding: 5px;
    background: var(--ai-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.ai-product-btn:hover { opacity: .85; }
.ai-product-btn.added { background: #4caf50; }

/* ── Input ── */
.ai-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #eef0f8;
    background: #fff;
}
#exotics-ai-input {
    flex: 1;
    border: 1px solid #dde3f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
    line-height: 1.4;
}
#exotics-ai-input:focus { border-color: var(--ai-color); }
#exotics-ai-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ai-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .2s;
}
#exotics-ai-send:hover   { opacity: .85; }
#exotics-ai-send:disabled { opacity: .5; cursor:not-allowed; }

.ai-footer-note {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    padding: 4px 0 8px;
    background: #fff;
}

/* ── Quick Suggestions ── */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    background: #f8faff;
}
.ai-suggestion-btn {
    background: #fff;
    border: 1px solid var(--ai-color);
    color: var(--ai-color);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.ai-suggestion-btn:hover { background: var(--ai-color); color: #fff; }

/* ── Responsive ── */
@media (max-width: 480px) {
    #exotics-ai-window { width: calc(100vw - 32px); right: -8px; }
}
