/* شات مطافي على التصميم الحالي للموقع — ملف مستقل عشان ما يلمسش site.css.
   نفس هوية الموقع: بياخد --ink/--bone/--signal/--rule/--dim والخطوط من site.css،
   ويعرّف محليًا اللي مش موجود في التصميم القديم. */
.chat{--ease:cubic-bezier(.22,.61,.36,1);--r-pill:980px}
.chat [hidden]{display:none!important}   /* لوحة الشات بتتقفل بخاصية hidden والكلاس بيحط flex */

.chat{position:fixed;inset-inline-end:18px;bottom:18px;z-index:66;font-family:var(--arabic)}
[dir="ltr"] .chat{font-family:var(--display)}
.chat-fab{display:inline-flex;align-items:center;gap:10px;height:54px;padding:0 18px 0 8px;border:0;border-radius:var(--r-pill);background:var(--ink);color:#fff;cursor:pointer;box-shadow:0 18px 40px -14px rgba(22,19,15,.6);transition:transform .35s var(--ease),box-shadow .35s;position:relative}
[dir="rtl"] .chat-fab{padding:0 8px 0 18px}
.chat-fab:hover{transform:translateY(-2px) scale(1.02);box-shadow:0 24px 46px -16px rgba(22,19,15,.65)}
.chat-fab-ic{width:40px;height:40px;border-radius:50%;background:var(--signal);display:grid;place-items:center}
.chat-fab-ic svg{width:22px;height:22px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linejoin:round}
.chat-fab-txt{font-weight:700;font-size:14.5px}
.chat-fab-dot{position:absolute;top:8px;inset-inline-start:40px;width:10px;height:10px;border-radius:50%;background:#30d158;box-shadow:0 0 0 2px var(--ink);animation:chatpulse 2.2s ease-in-out infinite}
@keyframes chatpulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.35);opacity:.6}}
.chat.open .chat-fab{display:none}
.chat-panel[hidden]{display:none}
.chat-panel{width:min(380px,calc(100vw - 24px));height:min(600px,calc(100vh - 100px));display:flex;flex-direction:column;background:#fff;color:var(--ink);border-radius:26px;box-shadow:0 40px 90px -30px rgba(22,19,15,.6),0 0 0 1px rgba(22,19,15,.06);overflow:hidden;animation:chatin .45s var(--ease)}
@keyframes chatin{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
.chat-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--ink);color:#fff}
.chat-avatar{width:38px;height:38px;border-radius:50%;background:var(--signal);display:grid;place-items:center;flex:0 0 auto}
.chat-avatar svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.chat-avatar svg circle{fill:#fff;stroke:none}
.chat-title{display:grid;gap:2px;flex:1;min-width:0}
.chat-title b{font-size:15px;font-weight:800}
.chat-title small{font-weight:500;opacity:.7;font-size:12px}
.chat-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;opacity:.8}
.chat-status i{width:7px;height:7px;border-radius:50%;background:#8e8e93}
.chat-status.on i{background:#30d158;box-shadow:0 0 8px #30d158}
.chat-wa{width:34px;height:34px;border-radius:50%;background:#25D366;display:grid;place-items:center;flex:0 0 auto}
.chat-wa svg{width:20px;height:20px;fill:#fff}
.chat-x{width:34px;height:34px;border:0;background:rgba(255,255,255,.12);color:#fff;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
.chat-log{flex:1;overflow-y:auto;padding:16px 14px 8px;display:flex;flex-direction:column;gap:8px;background:var(--bone);scroll-behavior:smooth}
.chat-msg{display:flex}
.chat-me{justify-content:flex-end}
.chat-b{max-width:84%;padding:10px 14px;border-radius:18px;font-size:14.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.chat-bot .chat-b{background:#fff;border-end-start-radius:6px;box-shadow:0 1px 0 var(--rule-2)}
.chat-me .chat-b{background:var(--signal);color:#fff;border-end-end-radius:6px}
.chat-b a{color:inherit;text-decoration:underline}
.chat-msg.pop{animation:chatpop .35s var(--ease)}
@keyframes chatpop{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
.chat-typing .chat-b{display:inline-flex;gap:5px;padding:12px 14px}
.chat-typing i{width:7px;height:7px;border-radius:50%;background:#b9b3a6;animation:chatdots 1.2s infinite}
.chat-typing i:nth-child(2){animation-delay:.2s}.chat-typing i:nth-child(3){animation-delay:.4s}
@keyframes chatdots{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}
.chat-chips{display:flex;gap:6px;flex-wrap:wrap;padding:6px 14px 8px;background:var(--bone)}
.chat-chips button{font:inherit;font-size:12.5px;font-weight:600;padding:7px 12px;border-radius:var(--r-pill);border:1px solid var(--rule);background:#fff;color:var(--ink);cursor:pointer;transition:background .2s}
.chat-chips button:hover{background:var(--signal);border-color:var(--signal);color:#fff}
.chat-form{display:flex;gap:8px;align-items:flex-end;padding:10px 12px;border-top:1px solid var(--rule-2);background:#fff}
.chat-form textarea{flex:1;font:inherit;font-size:14.5px;padding:10px 14px;border-radius:18px;border:1px solid var(--rule);background:var(--bone);resize:none;outline:none;max-height:120px;line-height:1.4}
.chat-form textarea:focus{border-color:var(--signal)}
.chat-form button{width:42px;height:42px;border:0;border-radius:50%;background:var(--signal);display:grid;place-items:center;cursor:pointer;flex:0 0 auto;transition:transform .25s}
.chat-form button:hover{transform:scale(1.06)}
.chat-form svg{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
[dir="rtl"] .chat-form svg{transform:scaleX(-1)}
.chat-foot{margin:0;padding:0 14px 10px;font-size:10.5px;color:var(--dim);background:#fff;text-align:center}
.wa-float{display:none}
@media(max-width:560px){.chat{inset-inline-end:12px;bottom:12px}.chat-panel{height:min(640px,calc(100vh - 80px))}}

