/* Tarheroya Online Customer Service — ویجت چت */
.troc{--k:#0A0A0B;--ln:#E4E4E7;--mu:#71717A;--soft:#F4F4F5;--ok:#22C55E;--e:cubic-bezier(.2,.75,.2,1);position:fixed;z-index:99990;bottom:20px;right:20px;direction:rtl;font-family:TrocVazir,Vazir,Tahoma,sans-serif;font-size:14px;line-height:1.8;color:#18181B;-webkit-font-smoothing:antialiased;transition:bottom .45s var(--e)}
.troc.troc-left{right:auto;left:20px}
.troc *,.troc *::before,.troc *::after{box-sizing:border-box;margin:0;padding:0;font-family:inherit;letter-spacing:normal;text-transform:none}
.troc button{appearance:none;border:0;background:none;color:inherit;cursor:pointer;line-height:1;box-shadow:none;min-height:0;text-decoration:none}
.troc svg{display:block;width:100%;height:100%}
.troc [hidden]{display:none!important}

/* دکمه‌ی شناور */
.troc-fab{position:relative;display:grid;place-items:center;width:60px;height:60px;border-radius:50%;background:var(--k)!important;color:#fff!important;box-shadow:0 18px 34px -12px rgba(0,0,0,.55),inset 0 0 0 1px rgba(255,255,255,.12);transition:transform .35s var(--e),box-shadow .35s;animation:trocIn .6s .4s var(--e) both}
.troc-fab:hover{transform:scale(1.06);box-shadow:0 22px 40px -12px rgba(0,0,0,.65),inset 0 0 0 1px rgba(255,255,255,.18)}
.troc-fab::before{content:"";position:absolute;inset:0;border-radius:50%;box-shadow:0 0 0 0 rgba(10,10,11,.35);animation:trocPing 3s 2s infinite}
.troc.is-open .troc-fab::before{animation:none}
.troc-fab-i,.troc-fab-x{grid-area:1/1;width:27px;height:27px;transition:transform .45s var(--e),opacity .3s}
.troc-fab-x{width:22px;height:22px;opacity:0;transform:rotate(-90deg) scale(.5)}
.troc.is-open .troc-fab-i{opacity:0;transform:rotate(90deg) scale(.5)}
.troc.is-open .troc-fab-x{opacity:1;transform:none}
.troc.is-online .troc-fab::after{content:"";position:absolute;bottom:3px;left:3px;width:13px;height:13px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 3px var(--k)}
.troc-badge{position:absolute;top:-4px;right:-4px;min-width:23px;height:23px;padding:0 6px;border-radius:12px;background:#EF4444;color:#fff;font:900 12px/23px TrocVazir,Vazir,Tahoma,sans-serif;font-style:normal;text-align:center;box-shadow:0 0 0 3px #fff;animation:trocPop .5s var(--e)}
@keyframes trocPing{0%{box-shadow:0 0 0 0 rgba(10,10,11,.35)}60%,100%{box-shadow:0 0 0 16px rgba(10,10,11,0)}}
@keyframes trocIn{from{opacity:0;transform:translateY(20px) scale(.6)}}
@keyframes trocPop{from{transform:scale(.3)}}

/* متن کوتاه کنار دکمه */
.troc-teaser{position:absolute;bottom:72px;right:0;display:flex;align-items:flex-start;gap:10px;width:max-content;max-width:min(280px,calc(100vw - 40px));padding:12px 14px 12px 34px;border-radius:18px 18px 6px 18px;background:#fff;box-shadow:0 20px 44px -16px rgba(0,0,0,.35),0 0 0 1px rgba(0,0,0,.05);cursor:pointer;animation:trocTease .6s var(--e) both}
.troc-left .troc-teaser{right:auto;left:0;border-radius:18px 18px 18px 6px}
.troc-teaser-av{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--k);color:#fff;font-weight:900;font-size:14px}
.troc-teaser p{font-size:13.5px;font-weight:700;line-height:1.8;color:#18181B}
.troc-teaser.is-msg p{font-weight:500}
.troc-teaser-x{position:absolute;top:8px;left:8px;width:22px;height:22px;padding:5px;border-radius:50%;color:var(--mu)!important;background:var(--soft)!important}
@keyframes trocTease{from{opacity:0;transform:translateY(10px) scale(.9)}}

/* پنل */
.troc-panel{position:absolute;bottom:76px;right:0;display:flex;flex-direction:column;width:380px;height:min(620px,calc(100vh - 120px));overflow:hidden;border-radius:26px;background:#fff;box-shadow:0 40px 90px -30px rgba(0,0,0,.55),0 0 0 1px rgba(0,0,0,.06);transform-origin:bottom right;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(16px) scale(.94);transition:opacity .3s,transform .45s var(--e),visibility 0s .45s}
.troc-left .troc-panel{right:auto;left:0;transform-origin:bottom left}
.troc.is-open .troc-panel{opacity:1;visibility:visible;pointer-events:auto;transform:none;transition:opacity .3s,transform .45s var(--e),visibility 0s}
.troc-h{position:relative;display:flex;align-items:center;gap:12px;padding:16px 18px;background:radial-gradient(140% 160% at 100% 0%,#3F3F46 0%,#18181B 45%,#050506 100%);color:#fff;overflow:hidden}
.troc-h::after{content:"";position:absolute;width:180px;height:180px;left:-60px;top:-110px;border-radius:50%;border:30px solid rgba(255,255,255,.04);pointer-events:none}
.troc-av{position:relative;flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#fff;color:var(--k);font-weight:900;font-size:18px}
.troc-av i{position:absolute;bottom:0;left:0;width:12px;height:12px;border-radius:50%;background:#A1A1AA;box-shadow:0 0 0 2.5px #18181B}
.troc.is-online .troc-av i{background:var(--ok)}
.troc-h-t{flex:1;min-width:0;display:flex;flex-direction:column}
.troc-h-t b{font-size:15.5px;font-weight:900;line-height:1.5}
.troc-st{font-size:12px;color:#A1A1AA;line-height:1.6}
.troc-hx{flex:none;width:36px;height:36px;padding:8px;border-radius:50%;background:rgba(255,255,255,.1)!important;color:#fff!important;transition:background .3s}
.troc-hx:hover{background:rgba(255,255,255,.2)!important}

.troc-body{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 14px 6px;background:var(--soft) radial-gradient(rgba(0,0,0,.05) 1px,transparent 1px) 0 0/16px 16px;scrollbar-width:thin}
.troc-list{display:flex;flex-direction:column}
.troc-day{align-self:center;margin:8px 0 6px}
.troc-day span{display:block;padding:2px 12px;border-radius:999px;background:rgba(255,255,255,.9);box-shadow:0 0 0 1px rgba(0,0,0,.05);font-size:11.5px;color:var(--mu)}
.troc-m{display:flex;flex-direction:column;max-width:82%;margin:3px 0;animation:trocMsg .35s var(--e) both}
@keyframes trocMsg{from{opacity:0;transform:translateY(8px)}}
.troc-m.is-v{align-self:flex-start;align-items:flex-start}
.troc-m.is-a,.troc-m.is-s{align-self:flex-end;align-items:flex-end}
.troc-bb{overflow:hidden;border-radius:18px;font-size:14px;line-height:1.85;word-wrap:break-word;overflow-wrap:anywhere}
.troc-tx{padding:9px 14px}
.troc-m.is-v .troc-bb{background:var(--k);color:#fff;border-bottom-right-radius:6px}
.troc-m.is-a .troc-bb{background:#fff;color:#18181B;border-bottom-left-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.troc-m.is-s .troc-bb{background:#fff;color:#3F3F46;border-bottom-left-radius:6px;box-shadow:inset 0 0 0 1px var(--ln)}
.troc-bb a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.troc-m.is-pending{opacity:.6}
.troc-meta{display:flex;align-items:center;gap:4px;margin:2px 4px 0;font-size:10.5px;color:#A1A1AA;line-height:1.4}
.troc-tick::after{content:"✓";font-style:normal;font-size:11px;color:#A1A1AA}
.troc-m.is-seen .troc-tick::after{content:"✓✓";color:#18181B;letter-spacing:-3px}
.troc-m.is-pending .troc-tick::after{content:"🕓";font-size:9px}
.troc-img{display:block;max-width:230px}
.troc-img img{display:block;width:100%;height:auto;max-height:260px;object-fit:cover}
.troc-fl{display:flex!important;align-items:center;gap:8px;padding:10px 14px;text-decoration:none!important;font-size:13px;font-weight:700}
.troc-fl svg{flex:none;width:20px;height:20px}
.troc-fl span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;direction:ltr}
.troc-up{opacity:.8}
.troc-typing{display:flex;gap:4px;width:max-content;margin:4px auto 8px 0;padding:12px 14px;border-radius:18px 18px 18px 6px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.troc-typing span{width:7px;height:7px;border-radius:50%;background:#A1A1AA;animation:trocDot 1.2s infinite}
.troc-typing span:nth-child(2){animation-delay:.15s}
.troc-typing span:nth-child(3){animation-delay:.3s}
@keyframes trocDot{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-5px);opacity:1}}

/* معرفی مهمان */
.troc-intro{padding:10px 14px 4px;background:#fff;border-top:1px solid var(--ln)}
.troc-intro p{font-size:11.5px;color:var(--mu);margin-bottom:6px}
.troc-intro-f{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.troc .troc-intro input{width:100%;height:36px;padding:0 12px;border:1.5px solid var(--ln);border-radius:12px;background:var(--soft);color:#18181B;font-size:13px;outline:0;box-shadow:none;margin:0}
.troc .troc-intro input:focus{border-color:#18181B;background:#fff}

/* شکلک‌ها */
.troc-emo{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;padding:8px 10px;background:#fff;border-top:1px solid var(--ln)}
.troc-emo button{height:34px;border-radius:10px;font-size:19px;line-height:34px;transition:background .2s,transform .2s}
.troc-emo button:hover{background:var(--soft);transform:scale(1.12)}

/* نوشتن پیام */
.troc-f{display:flex;align-items:flex-end;gap:4px;padding:10px 10px 12px;background:#fff;border-top:1px solid var(--ln)}
.troc-ib{flex:none;width:38px;height:42px;padding:9px;border-radius:12px;color:var(--mu)!important;transition:background .2s,color .2s}
.troc-ib:hover{background:var(--soft)!important;color:#18181B!important}
.troc .troc-f textarea{flex:1;min-width:0;height:42px;max-height:120px;margin:0;padding:10px 14px;border:0;border-radius:20px;background:var(--soft);color:#18181B;font-size:14px;line-height:1.6;resize:none;outline:0;overflow-y:auto;scrollbar-width:none;box-shadow:inset 0 0 0 1.5px transparent;transition:box-shadow .2s,background .2s}
.troc .troc-f textarea:focus{background:#fff;box-shadow:inset 0 0 0 1.5px #18181B}
.troc .troc-f textarea::-webkit-scrollbar{display:none}
.troc-send{flex:none;display:grid;place-items:center;width:42px;height:42px;padding:10px;border-radius:50%;background:var(--k)!important;color:#fff!important;transition:transform .3s var(--e),opacity .3s}
.troc-send svg{transform:scaleX(-1)}
.troc-send:not(:disabled):hover{transform:scale(1.08)}
.troc-send:disabled{opacity:.3;cursor:default}
.troc-err{padding:8px 14px;background:#FEF2F2;color:#B91C1C;font-size:12.5px;border-top:1px solid #FECACA}

/* هماهنگی با نوارهای پایین سایت */
body.trp-bar-on .troc{bottom:96px}

@media (max-width:520px){
	.troc{bottom:16px;right:16px}
	.troc.troc-left{left:16px}
	.troc-fab{width:56px;height:56px}
	.troc-panel{position:fixed;inset:0;width:100%;height:100%;height:100dvh;border-radius:0;transform:translateY(24px)}
	.troc.is-open .troc-fab{opacity:0;pointer-events:none;transform:scale(.6)}
	.troc-h{padding:14px 16px;padding-top:calc(14px + env(safe-area-inset-top))}
	.troc-f{padding-bottom:calc(12px + env(safe-area-inset-bottom))}
	html.troc-lock,html.troc-lock body{overflow:hidden!important}
	body.trwm-dash .troc{bottom:84px}
	body.trp-bar-on .troc{bottom:92px}
}
@media (prefers-reduced-motion:reduce){.troc *,.troc *::before,.troc *::after{animation:none!important;transition:none!important}}
