/* Stylefair Reseller — chat */
.sfr-chat,.sfr-inbox,.sfr-chatbtn,.sfr-pchat{--k-navy:var(--navy,#16213E);--k-red:var(--red,#E3154F);--k-line:var(--line,#E6E8F0);--k-soft:var(--soft,#F3F4F8);--k-muted:var(--muted,#8A92A8);--k-ink:var(--ink,#1A2035);--k-ink2:var(--ink-2,#4B5470);--k-green:#16A34A}
.sfr-chat .sfr-ico,.sfr-inbox .sfr-ico,.sfr-chatbtn .sfr-ico{width:20px;height:20px;flex:none}
html.sfr-chat-lock{overflow:hidden}
@media (min-width:768px){html.sfr-chat-lock{overflow:auto}}

/* buttons */
.sfr-chatbtn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;height:46px;padding:0 18px;border-radius:12px;border:1.5px solid var(--k-navy);background:#fff;color:var(--k-navy);font:inherit;font-weight:700;font-size:.95rem;cursor:pointer;transition:background .2s,color .2s,transform .15s}
.sfr-chatbtn:hover{background:var(--k-navy);color:#fff}
.sfr-chatbtn__dot{position:absolute;top:8px;right:10px;width:9px;height:9px;border-radius:50%;background:var(--k-green);box-shadow:0 0 0 2px #fff;animation:sfrPulse 2s infinite}
@keyframes sfrPulse{0%{box-shadow:0 0 0 2px #fff,0 0 0 2px rgba(22,163,74,.5)}70%{box-shadow:0 0 0 2px #fff,0 0 0 8px rgba(22,163,74,0)}100%{box-shadow:0 0 0 2px #fff,0 0 0 2px rgba(22,163,74,0)}}
.sfr-pchat{margin:12px 0 4px;display:flex;flex-direction:column;gap:4px}
.sfr-chatbtn--pdp{width:100%;height:50px}
.sfr-pchat small{color:var(--k-muted);font-size:.78rem;text-align:center}

/* window */
.sfr-chat{position:fixed;inset:0;z-index:10010;pointer-events:none}
.sfr-chat[hidden]{display:none!important}
.sfr-chat__win{position:absolute;right:24px;bottom:24px;width:380px;max-width:calc(100vw - 32px);height:min(600px,calc(100vh - 48px));background:#fff;border-radius:22px;box-shadow:0 30px 70px -20px rgba(10,15,30,.45),0 0 0 1px rgba(22,33,62,.06);display:flex;flex-direction:column;overflow:hidden;pointer-events:auto;transform:translateY(20px) scale(.97);opacity:0;transition:transform .3s cubic-bezier(.2,.8,.2,1),opacity .25s;transform-origin:bottom right}
.sfr-chat.is-open .sfr-chat__win{transform:none;opacity:1}
.sfr-chat__head{display:flex;align-items:center;gap:12px;padding:14px 14px 14px 16px;background:linear-gradient(135deg,var(--k-navy),#2A3B6E);color:#fff}
.sfr-chat__av,.sfr-chat__hav{width:42px;height:42px;border-radius:50%;background:#fff;color:var(--k-navy);display:grid;place-items:center;font-weight:800;flex:none;overflow:hidden;box-shadow:0 0 0 2px rgba(255,255,255,.35)}
.sfr-chat__av img,.sfr-chat__hav img{width:100%;height:100%;object-fit:cover}
.sfr-chat__who{flex:1;min-width:0}
.sfr-chat__who b{display:block;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sfr-chat__who small{display:flex;align-items:center;gap:6px;font-size:.76rem;opacity:.8}
.sfr-chat__on{width:8px;height:8px;border-radius:50%;background:#4ADE80;flex:none}
.sfr-chat__x,.sfr-chat__all{width:36px;height:36px;border-radius:50%;border:0;background:rgba(255,255,255,.12);color:#fff;font-size:1.4rem;line-height:1;cursor:pointer;display:grid;place-items:center;flex:none}
.sfr-chat__x:hover,.sfr-chat__all:hover{background:rgba(255,255,255,.25);color:#fff}
.sfr-chat__all .sfr-ico{width:18px;height:18px}
.sfr-chat__body,.sfr-conv__body{flex:1;overflow-y:auto;padding:16px;background:#F6F7FB;display:flex;flex-direction:column;gap:8px;overscroll-behavior:contain}
.sfr-chat__hello{display:flex;gap:10px;align-items:flex-end;margin-bottom:4px}
.sfr-chat__hav{width:32px;height:32px;font-size:.8rem;box-shadow:none;background:var(--k-navy);color:#fff}
.sfr-chat__hello p{margin:0;background:#fff;border-radius:16px 16px 16px 4px;padding:10px 13px;font-size:.92rem;color:var(--k-ink);box-shadow:0 1px 2px rgba(22,33,62,.06);max-width:85%}
.sfr-chat__privacy{margin:4px auto 0;font-size:.74rem;color:var(--k-muted);text-align:center;max-width:90%}
.sfr-chat__load{display:flex;gap:6px;justify-content:center;padding:30px 0}
.sfr-chat__load i{width:8px;height:8px;border-radius:50%;background:#C7CBD8;animation:sfrDot 1s infinite}
.sfr-chat__load i:nth-child(2){animation-delay:.15s}.sfr-chat__load i:nth-child(3){animation-delay:.3s}
@keyframes sfrDot{0%,80%,100%{transform:scale(.6);opacity:.5}40%{transform:scale(1);opacity:1}}

/* messages */
.sfr-msg{max-width:82%;display:flex;flex-direction:column;gap:3px;animation:sfrMsgIn .25s ease}
@keyframes sfrMsgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.sfr-msg.is-me{align-self:flex-end;align-items:flex-end}
.sfr-msg.is-them{align-self:flex-start}
.sfr-msg__b{padding:9px 13px;border-radius:16px;font-size:.93rem;line-height:1.5;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px rgba(22,33,62,.06)}
.sfr-msg.is-me .sfr-msg__b{background:linear-gradient(135deg,#F43F6E,var(--k-red));color:#fff;border-bottom-right-radius:4px}
.sfr-msg.is-them .sfr-msg__b{background:#fff;color:var(--k-ink);border-bottom-left-radius:4px}
.sfr-msg.is-them.is-admin .sfr-msg__b{background:#EEF2FF}
.sfr-msg__b a{color:inherit;text-decoration:underline}
.sfr-msg time{font-size:.68rem;color:var(--k-muted);padding:0 4px;font-family:var(--f-num,inherit)}
.sfr-msg__who{font-size:.7rem;font-weight:700;color:var(--k-ink2);padding:0 4px}
.sfr-msg__prod,.sfr-chat__prod{display:flex;gap:10px;align-items:center;background:#fff;border:1px solid var(--k-line);border-radius:12px;padding:6px 10px 6px 6px;max-width:260px;text-decoration:none!important;color:var(--k-ink)}
.sfr-msg__prod img,.sfr-chat__prod img{width:42px;height:50px;object-fit:cover;border-radius:8px;flex:none}
.sfr-msg__prod span,.sfr-chat__prod span{min-width:0;display:flex;flex-direction:column;line-height:1.3}
.sfr-msg__prod small,.sfr-chat__prod small{font-size:.68rem;color:var(--k-muted)}
.sfr-msg__prod b,.sfr-chat__prod b{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sfr-msg__prod em,.sfr-chat__prod em{font-style:normal;font-size:.8rem;color:var(--k-red);font-weight:700;font-family:var(--f-num,inherit)}
.sfr-chat__prod{margin:0 12px;max-width:none;border-style:dashed;background:#FFF8FB}
.sfr-chat__prod[hidden]{display:none}

/* composer */
.sfr-chat__form{padding:10px 12px 12px;background:#fff;border-top:1px solid var(--k-line);margin:0}
.sfr-chat__guest{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
.sfr-chat__guest[hidden]{display:none}
.sfr-chat__guest input{height:40px;border:1px solid var(--k-line);border-radius:10px;padding:0 10px;font:inherit;font-size:.88rem;min-width:0;outline:0}
.sfr-chat__guest input:focus,.sfr-chat__send textarea:focus{border-color:var(--k-navy)}
.sfr-chat__err{color:#DC2626;font-size:.8rem;margin:0 0 6px;font-weight:600}
.sfr-chat__err:empty{display:none}
.sfr-chat__send{display:flex;gap:8px;align-items:flex-end}
.sfr-chat__send textarea{flex:1;min-width:0;min-height:44px;max-height:120px;resize:none;border:1px solid var(--k-line);border-radius:14px;padding:11px 14px;font:inherit;font-size:.93rem;line-height:1.4;outline:0;background:var(--k-soft)}
.sfr-chat__send button{width:44px;height:44px;border-radius:50%;border:0;background:var(--k-red);color:#fff;display:grid;place-items:center;cursor:pointer;flex:none;transition:transform .15s,opacity .2s}
.sfr-chat__send button:hover{transform:scale(1.06)}
.sfr-chat__send button:disabled{opacity:.6}
.sfr-chat__send button .sfr-ico{width:20px;height:20px}

/* inbox */
.sfr-inbox{display:grid;grid-template-columns:320px minmax(0,1fr);height:min(640px,calc(100vh - 220px));min-height:440px;background:#fff;border:1px solid var(--k-line);border-radius:18px;overflow:hidden}
.sfr-inbox__list{border-right:1px solid var(--k-line);overflow-y:auto;background:#fff}
.sfr-inbox__item{display:flex;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--k-line);text-decoration:none!important;color:var(--k-ink);transition:background .15s}
.sfr-inbox__item:hover{background:#FAFBFD}
.sfr-inbox__item.is-on{background:#FFF5F8;box-shadow:inset 3px 0 0 var(--k-red)}
.sfr-inbox__av{width:42px;height:42px;border-radius:50%;background:var(--k-navy);color:#fff;display:grid;place-items:center;font-weight:800;flex:none}
.sfr-inbox__txt{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.sfr-inbox__txt b{font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--k-navy)}
.sfr-inbox__txt em{font-style:normal;font-size:.72rem;color:var(--k-red);font-weight:600}
.sfr-inbox__txt small{font-size:.8rem;color:var(--k-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sfr-inbox__item.is-unread small{color:var(--k-ink);font-weight:600}
.sfr-inbox__meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.sfr-inbox__meta time{font-size:.68rem;color:var(--k-muted);white-space:nowrap}
.sfr-inbox__meta i{min-width:20px;height:20px;border-radius:10px;background:var(--k-red);color:#fff;font-style:normal;font-size:.72rem;font-weight:700;display:grid;place-items:center;padding:0 6px;font-family:var(--f-num,inherit)}
.sfr-inbox__empty,.sfr-inbox__pick{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;padding:30px 20px;color:var(--k-muted);height:100%}
.sfr-inbox__empty .sfr-ico,.sfr-inbox__pick .sfr-ico{width:46px;height:46px;color:#C7CBD8}
.sfr-inbox__empty p,.sfr-inbox__pick p{margin:0;max-width:300px;font-size:.9rem}
.sfr-inbox__conv{display:flex;flex-direction:column;min-width:0;min-height:0}
.sfr-conv__head{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--k-line)}
.sfr-conv__head>div{flex:1;min-width:0}
.sfr-conv__head b{display:block;color:var(--k-navy)}
.sfr-conv__head small{color:var(--k-muted);font-size:.8rem}
.sfr-conv__head small a{color:var(--k-red);font-weight:600;text-decoration:none}
.sfr-conv__back{display:none;width:36px;height:36px;border-radius:50%;background:var(--k-soft);color:var(--k-navy)!important;align-items:center;justify-content:center;font-size:1.2rem;text-decoration:none!important}
.sfr-conv__call{width:40px;height:40px;border-radius:50%;background:var(--k-green);color:#fff!important;display:grid;place-items:center}
.sfr-conv__call .sfr-ico{width:18px;height:18px}
.sfr-conv{flex:1;display:flex;flex-direction:column;min-height:0}
.sfr-nav__badge{margin-left:auto;min-width:20px;height:20px;border-radius:10px;background:var(--k-red,#E3154F);color:#fff;font-style:normal;font-size:.72rem;font-weight:700;display:grid;place-items:center;padding:0 6px}
.sfr-admin-inbox{margin-top:4px}
.sfr-admin-inbox .sfr-inbox{height:calc(100vh - 260px)}

@media (max-width:767px){
  .sfr-chat__win{right:0;left:0;bottom:0;width:100%;max-width:none;height:min(88vh,calc(100vh - 40px));border-radius:22px 22px 0 0;transform:translateY(100%);opacity:1}
  .sfr-chat{background:rgba(10,15,30,.45);opacity:0;transition:opacity .25s;pointer-events:auto}
  .sfr-chat.is-open{opacity:1}
  .sfr-chat__form{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .sfr-inbox{grid-template-columns:1fr;height:auto;min-height:0}
  .sfr-inbox__list{border-right:0;max-height:none}
  .sfr-inbox.has-open .sfr-inbox__list{display:none}
  .sfr-inbox:not(.has-open) .sfr-inbox__conv{display:none}
  .sfr-inbox__conv{height:calc(100vh - 170px)}
  .sfr-conv__back{display:flex}
}
@media (prefers-reduced-motion:reduce){.sfr-chat__win,.sfr-msg{transition:none;animation:none}}
.sfr-chat [hidden],.sfr-inbox [hidden]{display:none!important}
html.sfr-chat-lock .sf-fab,html.sfr-chat-lock .sf-top{opacity:0;pointer-events:none}
