#chatbot-widget{font-family:'Inter',system-ui,-apple-system,sans-serif;font-size:14px;line-height:1.5;color:var(--ink,#0f172a)}
#chatbot-widget *{box-sizing:border-box;margin:0;padding:0}

/* Toggle Button */
.chatbot-toggle{position:fixed;bottom:90px;right:24px;z-index:9999;width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border:none;font-size:26px;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 24px rgba(109,40,217,.45);transition:all .3s cubic-bezier(.4,0,.2,1);border:2px solid rgba(255,255,255,.15)}
.chatbot-toggle:hover{transform:scale(1.1);box-shadow:0 6px 32px rgba(109,40,217,.55)}
.chatbot-toggle:active{transform:scale(.95)}
.chatbot-toggle .badge{position:absolute;top:-4px;right:-4px;background:#ef4444;color:#fff;font-size:11px;font-weight:800;min-width:22px;height:22px;border-radius:11px;display:flex;align-items:center;justify-content:center;padding:0 5px;border:2px solid #fff;animation:badgePop .3s ease}
@keyframes badgePop{0%{transform:scale(0)}50%{transform:scale(1.2)}100%{transform:scale(1)}}

/* Panel */
.chatbot-panel{position:fixed;bottom:90px;right:24px;z-index:9998;width:400px;max-width:calc(100vw - 32px);max-height:600px;height:calc(100vh - 160px);background:#fff;border-radius:20px;box-shadow:0 20px 80px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.03);display:none;flex-direction:column;overflow:hidden;animation:chatPanelIn .35s cubic-bezier(.16,1,.3,1);border:none}
.chatbot-panel.open{display:flex}
@keyframes chatPanelIn{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}

/* Header */
.chatbot-header{background:linear-gradient(135deg,#6d28d9 0%,#4f46e5 50%,#2563eb 100%);color:#fff;padding:18px 20px;display:flex;align-items:center;gap:12px;flex-shrink:0;position:relative;overflow:hidden}
.chatbot-header::after{content:'';position:absolute;top:-50%;right:-30%;width:120px;height:120px;border-radius:50%;background:rgba(255,255,255,.06);pointer-events:none}
.chatbot-header .avatar{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.18);backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.chatbot-header .info{flex:1;min-width:0}
.chatbot-header .info strong{display:block;font-size:15px;font-weight:700;letter-spacing:-.01em}
.chatbot-header .info span{font-size:11px;opacity:.85;display:flex;align-items:center;gap:5px}
.chatbot-header .info span::before{content:'';width:7px;height:7px;border-radius:50%;background:#34d399;display:inline-block;box-shadow:0 0 6px rgba(52,211,153,.5)}
.chatbot-header .close-btn{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.12);backdrop-filter:blur(4px);border:none;color:#fff;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0}
.chatbot-header .close-btn:hover{background:rgba(255,255,255,.25);transform:scale(1.05)}

/* Messages */
.chatbot-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:8px;background:linear-gradient(180deg,#f8fafc 0%,#f1f5f9 100%)}
.chatbot-messages::-webkit-scrollbar{width:4px}
.chatbot-messages::-webkit-scrollbar-track{background:transparent}
.chatbot-messages::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:2px}
.chatbot-messages::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Messages */
.msg{max-width:88%;padding:12px 16px;border-radius:18px;font-size:13.5px;line-height:1.6;word-wrap:break-word;animation:msgIn .25s ease;position:relative}
@keyframes msgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.msg.user{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;align-self:flex-end;border-bottom-right-radius:6px;box-shadow:0 2px 12px rgba(109,40,217,.2)}
.msg.bot{background:#fff;color:#1e293b;align-self:flex-start;border-bottom-left-radius:6px;box-shadow:0 1px 8px rgba(0,0,0,.05);border:1px solid #e2e8f0}
.msg.bot strong{color:#6d28d9;font-weight:700}
.msg .msg-time{display:block;font-size:10px;opacity:.5;margin-top:4px;text-align:right}
.msg.user .msg-time{text-align:right;color:rgba(255,255,255,.6)}

/* Action Buttons */
.msg.bot .msg-actions{margin-top:10px;display:flex;flex-wrap:wrap;gap:8px}
.msg.bot .msg-actions .btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:10px;font-size:12px;font-weight:700;border:none;cursor:pointer;transition:all .2s;text-decoration:none}
.msg.bot .msg-actions .btn-primary{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;box-shadow:0 2px 8px rgba(109,40,217,.25)}
.msg.bot .msg-actions .btn-primary:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(109,40,217,.35)}
.msg.bot .msg-actions .btn-secondary{background:#f1f5f9;color:#475569;border:1px solid #e2e8f0}
.msg.bot .msg-actions .btn-secondary:hover{background:#e2e8f0;border-color:#cbd5e1}

/* Suggestion Chips */
.msg.bot .msg-suggestions{margin-top:10px;display:flex;flex-wrap:wrap;gap:6px}
.msg.bot .msg-suggestions button{background:#fff;border:1.5px solid #e2e8f0;border-radius:999px;padding:7px 14px;font-size:12px;font-weight:600;color:#475569;cursor:pointer;transition:all .2s;white-space:nowrap}
.msg.bot .msg-suggestions button:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-color:transparent;transform:translateY(-1px);box-shadow:0 2px 8px rgba(109,40,217,.25)}

/* Link Buttons */
.msg.bot .msg-buttons{margin-top:10px;display:flex;flex-wrap:wrap;gap:8px}
.msg.bot .msg-buttons a{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:10px;font-size:12px;font-weight:700;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;text-decoration:none;transition:all .2s;box-shadow:0 2px 8px rgba(109,40,217,.25)}
.msg.bot .msg-buttons a:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(109,40,217,.35)}

/* FAQ Items */
.msg.bot .msg-faq{margin-top:10px;display:flex;flex-direction:column;gap:4px;max-height:220px;overflow-y:auto}
.msg.bot .msg-faq .faq-item{display:flex;flex-direction:column;gap:3px;padding:10px 14px;border-radius:12px;background:#f8fafc;border:1px solid #e2e8f0;cursor:pointer;transition:all .2s;text-align:left;width:100%;font-family:inherit}
.msg.bot .msg-faq .faq-item:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);border-color:transparent;transform:translateY(-1px);box-shadow:0 4px 12px rgba(109,40,217,.2)}
.msg.bot .msg-faq .faq-item:hover .q{color:#fff}
.msg.bot .msg-faq .faq-item:hover .a{color:rgba(255,255,255,.8)}
.msg.bot .msg-faq .faq-item .q{font-size:12.5px;font-weight:700;color:#1e293b;transition:color .15s}
.msg.bot .msg-faq .faq-item .a{font-size:11.5px;color:#64748b;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;transition:color .15s}

/* Quick Actions */
.quick-actions{padding:10px 16px;display:flex;gap:6px;overflow-x:auto;flex-shrink:0;background:#fff;border-bottom:1px solid #f1f5f9}
.quick-actions::-webkit-scrollbar{height:0}
.quick-actions button{flex-shrink:0;padding:7px 13px;border-radius:999px;font-size:11.5px;font-weight:700;border:1.5px solid #e2e8f0;background:#fff;color:#475569;cursor:pointer;transition:all .2s;white-space:nowrap;display:flex;align-items:center;gap:5px}
.quick-actions button i{font-size:10px}
.quick-actions button:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-color:transparent;transform:translateY(-1px);box-shadow:0 2px 8px rgba(109,40,217,.25)}

/* Typing Indicator */
.chatbot-typing{padding:12px 16px;align-self:flex-start;background:#fff;border-radius:18px;border-bottom-left-radius:6px;display:none;align-items:center;gap:8px;font-size:13px;color:#94a3b8;border:1px solid #e2e8f0;box-shadow:0 1px 4px rgba(0,0,0,.03)}
.chatbot-typing.show{display:flex}
.chatbot-typing .dots{display:flex;gap:4px}
.chatbot-typing .dots span{width:7px;height:7px;border-radius:50%;background:#94a3b8;animation:dotBounce 1.2s infinite}
.chatbot-typing .dots span:nth-child(2){animation-delay:.2s}
.chatbot-typing .dots span:nth-child(3){animation-delay:.4s}
@keyframes dotBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}

/* Input */
.chatbot-input{display:flex;gap:8px;padding:14px 16px;background:#fff;border-top:1px solid #f1f5f9;flex-shrink:0}
.chatbot-input input{flex:1;border:1.5px solid #e2e8f0;border-radius:12px;padding:11px 16px;font-size:13.5px;outline:none;font-family:inherit;color:#1e293b;background:#f8fafc;transition:all .2s}
.chatbot-input input:focus{border-color:#6d28d9;background:#fff;box-shadow:0 0 0 3px rgba(109,40,217,.08)}
.chatbot-input input::placeholder{color:#94a3b8}
.chatbot-input button{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border:none;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0;box-shadow:0 2px 8px rgba(109,40,217,.25)}
.chatbot-input button:hover{transform:scale(1.06);box-shadow:0 4px 12px rgba(109,40,217,.35)}
.chatbot-input button:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}

/* Rating Widget */
.chatbot-rating{padding:16px;display:flex;flex-direction:column;align-items:center;gap:10px;background:linear-gradient(135deg,#f8fafc,#f1f5f9);border-radius:16px;margin:8px 0;border:1px solid #e2e8f0}
.chatbot-rating h4{font-size:14px;font-weight:700;color:#1e293b;margin:0}
.chatbot-rating p{font-size:12px;color:#64748b;margin:0}
.chatbot-rating .stars{display:flex;gap:6px}
.chatbot-rating .stars button{width:40px;height:40px;border-radius:12px;border:2px solid #e2e8f0;background:#fff;font-size:20px;cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center}
.chatbot-rating .stars button:hover{transform:scale(1.15);border-color:#6d28d9;background:#f5f3ff}
.chatbot-rating .stars button.active{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-color:transparent;box-shadow:0 2px 8px rgba(109,40,217,.3)}
.chatbot-rating .review-input{width:100%;padding:10px 14px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:13px;font-family:inherit;resize:none;outline:none;min-height:60px;color:#1e293b;background:#fff;transition:border-color .2s}
.chatbot-rating .review-input:focus{border-color:#6d28d9;box-shadow:0 0 0 3px rgba(109,40,217,.08)}
.chatbot-rating .review-input::placeholder{color:#94a3b8}
.chatbot-rating .submit-rating{padding:10px 24px;border-radius:10px;background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border:none;font-size:13px;font-weight:700;cursor:pointer;transition:all .2s;box-shadow:0 2px 8px rgba(109,40,217,.25)}
.chatbot-rating .submit-rating:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(109,40,217,.35)}
.chatbot-rating .submit-rating:disabled{opacity:.5;cursor:not-allowed;transform:none}
.chatbot-rating .skip-rating{font-size:12px;color:#94a3b8;cursor:pointer;border:none;background:none;text-decoration:underline}
.chatbot-rating .skip-rating:hover{color:#6d28d9}
.chatbot-rating .rated-success{text-align:center;padding:12px}
.chatbot-rating .rated-success i{font-size:28px;color:#22c55e;margin-bottom:6px}
.chatbot-rating .rated-success p{font-size:13px;font-weight:600;color:#1e293b}

/* End Chat Button */
.end-chat-btn{padding:6px 14px;border-radius:8px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);color:#fff;font-size:11px;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap}
.end-chat-btn:hover{background:rgba(255,255,255,.22)}

/* Product Card */
.msg.bot .msg-product-card{display:flex;gap:10px;padding:10px;background:#f8fafc;border-radius:10px;margin-top:8px;align-items:center;border:1px solid #e2e8f0}
.msg.bot .msg-product-card img{width:52px;height:52px;border-radius:8px;object-fit:cover;background:#e2e8f0}
.msg.bot .msg-product-card .info{flex:1}
.msg.bot .msg-product-card .info .name{font-size:12.5px;font-weight:700;color:#1e293b}
.msg.bot .msg-product-card .info .price{font-size:12.5px;color:#6d28d9;font-weight:700}

/* Source Badge */
.msg .source-badge{display:inline-block;font-size:9px;padding:2px 6px;border-radius:4px;background:#f1f5f9;color:#64748b;margin-top:4px}

/* Dark Theme */
[data-theme="dark"] .chatbot-panel{background:#1e293b;border:1px solid #334155}
[data-theme="dark"] .chatbot-messages{background:linear-gradient(180deg,#0f172a 0%,#1e293b 100%)}
[data-theme="dark"] .msg.bot{background:#1e293b;color:#e2e8f0;border-color:#334155}
[data-theme="dark"] .msg.bot strong{color:#818cf8}
[data-theme="dark"] .msg.bot .msg-suggestions button{background:#1e293b;border-color:#334155;color:#e2e8f0}
[data-theme="dark"] .msg.bot .msg-suggestions button:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-color:transparent}
[data-theme="dark"] .msg.bot .msg-actions .btn-secondary{background:#334155;color:#e2e8f0;border-color:#475569}
[data-theme="dark"] .msg.bot .msg-faq .faq-item{background:#334155;border-color:#475569}
[data-theme="dark"] .msg.bot .msg-faq .faq-item .q{color:#e2e8f0}
[data-theme="dark"] .msg.bot .msg-faq .faq-item .a{color:#94a3b8}
[data-theme="dark"] .msg.bot .msg-faq .faq-item:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);border-color:transparent}
[data-theme="dark"] .msg.bot .msg-faq .faq-item:hover .q{color:#fff}
[data-theme="dark"] .msg.bot .msg-faq .faq-item:hover .a{color:rgba(255,255,255,.8)}
[data-theme="dark"] .quick-actions{background:#1e293b;border-color:#334155}
[data-theme="dark"] .quick-actions button{background:#1e293b;border-color:#334155;color:#e2e8f0}
[data-theme="dark"] .quick-actions button:hover{background:linear-gradient(135deg,#6d28d9,#4f46e5);color:#fff;border-color:transparent}
[data-theme="dark"] .chatbot-input{background:#1e293b;border-color:#334155}
[data-theme="dark"] .chatbot-input input{background:#334155;border-color:#475569;color:#e2e8f0}
[data-theme="dark"] .chatbot-input input:focus{border-color:#6d28d9;background:#1e293b;box-shadow:0 0 0 3px rgba(109,40,217,.15)}
[data-theme="dark"] .chatbot-input input::placeholder{color:#64748b}
[data-theme="dark"] .chatbot-typing{background:#1e293b;border-color:#334155;color:#64748b}
[data-theme="dark"] .chatbot-rating{background:#1e293b;border-color:#334155}
[data-theme="dark"] .chatbot-rating h4{color:#e2e8f0}
[data-theme="dark"] .chatbot-rating .stars button{background:#334155;border-color:#475569;color:#e2e8f0}
[data-theme="dark"] .chatbot-rating .review-input{background:#334155;border-color:#475569;color:#e2e8f0}
[data-theme="dark"] .msg.bot .msg-product-card{background:#334155;border-color:#475569}
[data-theme="dark"] .msg.bot .msg-product-card .info .name{color:#e2e8f0}
[data-theme="dark"] .msg .source-badge{background:#334155;color:#94a3b8}

/* Mobile */
@media(max-width:768px){
/* max-width from the desktop rule (100vw - 32px) would otherwise win over width:100% and
   leave a 32px gutter on the left while pinning content against the right edge. */
.chatbot-panel{right:0;bottom:0;width:100%;max-width:none;height:100%;max-height:100%;border-radius:0}
.chatbot-toggle{bottom:80px;right:16px;width:52px;height:52px;font-size:22px}
.chatbot-header{padding:12px 14px;gap:8px}
.chatbot-header .info strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.end-chat-btn{padding:5px 10px;font-size:10.5px}
.chatbot-messages{padding:12px}
.chatbot-input{padding:12px}
.msg{max-width:92%}
.quick-actions{padding:8px 12px}
.quick-actions button{padding:6px 11px;font-size:10.5px}
.chatbot-typing{padding:10px 14px;font-size:12px}
.chatbot-rating{padding:14px;margin:6px 8px}
/* The floating call/WhatsApp bubbles must not sit on top of the composer or messages. */
body.chat-open .float-call-btn,body.chat-open .call-fab,body.chat-open [data-float-call],
body.chat-open .wa-float,body.chat-open .whatsapp-float,body.chat-open #whatsappFloat{opacity:0;pointer-events:none;visibility:hidden}
}
