/* ============ Rokari Chat 2.2 — site-wide assistant widget ============ */
.rkchat-root{--rkc-green:#14342b;--rkc-green2:#1e4a3e;--rkc-lime:#d7f58a;--rkc-teal:#0e8f7e;--rkc-ink:#17251f;--rkc-muted:#64756c;--rkc-line:#e5e9e0;--rkc-paper:#f5f7f2;font-family:Vazirmatn,Tahoma,sans-serif;position:fixed;bottom:20px;left:20px;z-index:99990;direction:rtl}
.rkchat-root .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
/* ---------- Launcher ---------- */
.rkchat-launcher{display:flex;align-items:center;gap:10px;background:linear-gradient(135deg,var(--rkc-green),var(--rkc-green2));color:var(--rkc-lime);border:0;border-radius:99px;min-height:54px;padding:0 21px;box-shadow:0 14px 40px #14342b45;cursor:pointer;transition:transform .18s,box-shadow .18s;font-weight:800;font-size:13.5px;position:relative;font-family:inherit}
.rkchat-launcher:hover{transform:translateY(-3px);box-shadow:0 18px 50px #14342b55}
.rkchat-launcher svg{width:23px;height:23px}
.rkchat-launcher::after{content:'';position:absolute;inset:-5px;border-radius:99px;border:2px solid #d7f58a3d;animation:rkcPulse 2.4s ease-out infinite}
@keyframes rkcPulse{0%{transform:scale(.9);opacity:1}100%{transform:scale(1.25);opacity:0}}
.rkchat-launcher-badge{position:absolute;top:-6px;inset-inline-start:-6px;background:#d9534f;color:#fff;font-size:10.5px;font-weight:800;min-width:20px;height:20px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
@media (max-width:600px){.rkchat-launcher-label{display:none}.rkchat-launcher{width:56px;height:56px;justify-content:center;padding:0}}

.rkchat-panel[hidden]{display:none!important}
/* ---------- Panel (anchored to the launcher's left edge — direction independent) ---------- */
.rkchat-panel{position:absolute;bottom:calc(100% + 14px);left:0;right:auto;width:min(396px,calc(100vw - 32px));height:min(600px,calc(100vh - 130px));height:min(600px,calc(100dvh - 130px));background:var(--rkc-paper);border:1px solid var(--rkc-line);border-radius:22px;box-shadow:0 28px 80px #10201b38;display:flex;flex-direction:column;overflow:hidden;animation:rkcIn .28s cubic-bezier(.2,.9,.3,1.1)}
@keyframes rkcIn{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:none}}
.rkchat-head{display:flex;align-items:center;gap:12px;padding:15px 17px;background:linear-gradient(135deg,var(--rkc-green),var(--rkc-green2));color:#fff;flex-shrink:0}
.rkchat-orb{width:42px;height:42px;border-radius:14px;background:#d7f58a26;display:grid;place-items:center;color:var(--rkc-lime);flex-shrink:0}
.rkchat-orb svg{width:23px;height:23px}
.rkchat-head-text{flex:1;min-width:0}
.rkchat-head-text strong{display:block;font-size:14px}
.rkchat-head-text span{font-size:10.5px;color:#bcd4bd;display:inline-flex;align-items:center;gap:6px}
.rkchat-dot{width:7px;height:7px;border-radius:50%;background:#a8d643;display:inline-block;animation:rkcBlink 2s infinite}
@keyframes rkcBlink{50%{opacity:.35}}
.rkchat-icon-btn{background:#ffffff14;border:0;color:#fff;width:37px;height:37px;border-radius:11px;display:grid;place-items:center;cursor:pointer;transition:background .15s}
.rkchat-icon-btn:hover{background:#ffffff26}
.rkchat-icon-btn svg{width:18px;height:18px}

/* ---------- Messages ---------- */
.rkchat-messages{flex:1;overflow-y:auto;padding:15px;display:flex;flex-direction:column;gap:11px;scroll-behavior:smooth;background:
radial-gradient(circle at 85% 8%,#d7f58a14,transparent 40%),
radial-gradient(circle at 10% 95%,#0e8f7e12,transparent 45%),var(--rkc-paper)}
.rkchat-msg{max-width:88%;padding:11px 15px;border-radius:17px;font-size:13.5px;line-height:2;white-space:pre-wrap;word-break:break-word;animation:rkcMsg .25s ease}
@keyframes rkcMsg{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.rkchat-msg.user{align-self:flex-start;background:var(--rkc-green);color:#fff;border-radius:17px 17px 4px 17px;margin-inline-start:auto}
html[dir=rtl] .rkchat-msg.user{align-self:flex-end;margin-inline-start:0;margin-inline-end:auto;border-radius:17px 17px 17px 4px}
.rkchat-msg.bot{align-self:flex-end;background:#fff;border:1px solid var(--rkc-line);color:var(--rkc-ink);border-radius:17px 17px 17px 4px;margin-inline-end:auto}
html[dir=rtl] .rkchat-msg.bot{align-self:flex-start;margin-inline-end:0;margin-inline-start:auto;border-radius:17px 17px 4px 17px}
.rkchat-msg.bot b{color:var(--rkc-teal)}
.rkchat-msg a{color:var(--rkc-teal);text-decoration:underline;text-underline-offset:3px;word-break:break-all}
.rkchat-typing{align-self:flex-start;display:flex;gap:5px;padding:13px 17px;background:#fff;border:1px solid var(--rkc-line);border-radius:17px 17px 17px 4px;margin-inline-end:auto}
html[dir=rtl] .rkchat-typing{align-self:flex-start;margin-inline-end:0;margin-inline-start:auto}
.rkchat-typing i{width:7px;height:7px;border-radius:50%;background:#a8bfa6;animation:rkcTyp 1.1s infinite}
.rkchat-typing i:nth-child(2){animation-delay:.18s}.rkchat-typing i:nth-child(3){animation-delay:.36s}
@keyframes rkcTyp{0%,100%{transform:translateY(0);opacity:.5}50%{transform:translateY(-4px);opacity:1}}
/* product mini-cards */
.rkchat-products{display:flex;flex-direction:column;gap:8px;width:94%;align-self:flex-end;margin-inline-end:auto;max-width:340px}
html[dir=rtl] .rkchat-products{align-self:flex-start;margin-inline-end:0;margin-inline-start:auto}
.rkchat-product{display:flex;gap:10px;align-items:center;background:#fff;border:1px solid var(--rkc-line);border-radius:14px;padding:8px 10px;text-decoration:none;transition:transform .15s,border-color .15s}
.rkchat-product:hover{transform:translateY(-2px);border-color:#9fc48a}
.rkchat-product img{width:50px;height:50px;border-radius:10px;object-fit:contain;background:#f2f5ec;flex-shrink:0}
.rkchat-product .rkc-p-body{min-width:0;flex:1}
.rkchat-product .rkc-p-name{font-size:12px;font-weight:700;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--rkc-ink)}
.rkchat-product .rkc-p-price{font-size:11px;color:var(--rkc-teal);font-weight:800}
.rkchat-product .rkc-p-oos{font-size:10.5px;color:#d9534f;font-weight:700}
.rkchat-product .rkc-p-arrow{width:33px;height:33px;border-radius:10px;background:#eef4e0;color:var(--rkc-green);display:grid;place-items:center;flex-shrink:0}
.rkchat-product .rkc-p-arrow svg{width:15px;height:15px}

/* ---------- Chips ---------- */
.rkchat-chips{display:flex;gap:7px;padding:0 15px 9px;overflow-x:auto;scrollbar-width:none;flex-shrink:0}
.rkchat-chips::-webkit-scrollbar{display:none}
.rkchat-chips:empty{display:none}
.rkchat-chip{background:#fff;border:1.5px solid var(--rkc-line);border-radius:99px;padding:6px 13px;font-size:11.5px;font-weight:600;color:var(--rkc-ink);white-space:nowrap;cursor:pointer;transition:all .15s;font-family:inherit}
.rkchat-chip:hover{background:var(--rkc-lime);border-color:var(--rkc-lime);color:var(--rkc-green)}

/* ---------- Form ---------- */
.rkchat-form{display:flex;gap:8px;padding:11px 13px;background:#fff;border-top:1px solid var(--rkc-line);flex-shrink:0}
.rkchat-form input{flex:1;min-width:0;border:1.5px solid var(--rkc-line);border-radius:13px;min-height:46px;padding:0 15px;outline:none;font-size:13.5px;background:var(--rkc-paper);font-family:inherit}
.rkchat-form input:focus{border-color:#9fc48a;box-shadow:0 0 0 4px #a8d64320}
.rkchat-send{width:46px;height:46px;border-radius:13px;border:0;background:linear-gradient(135deg,var(--rkc-green),var(--rkc-green2));color:var(--rkc-lime);display:grid;place-items:center;cursor:pointer;transition:transform .15s;flex-shrink:0}
.rkchat-send:hover{transform:translateY(-2px)}
.rkchat-send svg{width:19px;height:19px;transform:rotate(180deg)}
html[dir=rtl] .rkchat-send svg{transform:none}
.rkchat-note{margin:0;padding:7px 15px calc(9px + env(safe-area-inset-bottom));font-size:9.5px;color:var(--rkc-muted);background:#fff;flex-shrink:0}

/* ---------- Mobile ---------- */
@media (max-width:600px){
.rkchat-root{bottom:84px;left:12px;right:auto}
.rkchat-launcher{box-shadow:0 12px 32px #14342b55}
.rkchat-panel{position:fixed;bottom:0;top:auto;left:0;right:0;width:100%;max-width:none;height:calc(100dvh - 60px);height:calc(100vh - 60px);border-radius:20px 20px 0 0}
}
@media (prefers-reduced-motion:reduce){.rkchat-panel,.rkchat-msg{animation:none}.rkchat-launcher::after{animation:none}}
