/* Nova chat widget — shared by every page */
@keyframes aiRise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.ai-fab,.ai-panel,.ai-tip{font-family:Inter,Arial,sans-serif;box-sizing:border-box}.ai-panel *{box-sizing:border-box}
  .ai-fab { position:fixed; right:22px; bottom:22px; z-index:60; width:62px; height:62px; border-radius:50%; border:0; cursor:pointer;
    background:radial-gradient(circle at 35% 30%, #a33a3a, #6a1c1c); box-shadow:0 12px 30px rgba(122,35,35,.45); display:grid; place-items:center; }
  .ai-fab::before { content:''; position:absolute; inset:-6px; border-radius:50%; border:2px solid rgba(122,35,35,.35); animation:aiPulse 2.4s ease-out infinite; }
  @keyframes aiPulse { from { transform:scale(.9); opacity:1; } to { transform:scale(1.35); opacity:0; } }
  .ai-fab .dot { position:absolute; top:6px; right:6px; width:12px; height:12px; border-radius:50%; background:#3ddc84; border:2px solid #fff; }
  .ai-tip { position:fixed; right:94px; bottom:36px; z-index:60; background:#fff; color:#262626; font-size:13px; padding:9px 14px; border-radius:18px 18px 4px 18px;
    box-shadow:0 8px 24px rgba(0,0,0,.12); opacity:0; transform:translateY(8px); transition:all .4s; pointer-events:none; }
  .ai-tip.on { opacity:1; transform:none; }
  .ai-panel { position:fixed; right:22px; bottom:96px; z-index:61; width:370px; height:540px; max-height:calc(100vh - 120px); background:#fff; border-radius:18px;
    box-shadow:0 24px 60px rgba(40,10,10,.28); display:flex; flex-direction:column; overflow:hidden;
    opacity:0; transform:translateY(20px) scale(.96); transform-origin:bottom right; pointer-events:none; transition:all .3s cubic-bezier(.2,.8,.2,1); }
  .ai-panel.open { opacity:1; transform:none; pointer-events:auto; }
  .ai-head { background:linear-gradient(135deg,#7a2323,#4a1212); color:#fff; padding:16px 16px 14px; display:flex; align-items:center; gap:12px; }
  .ai-head .av { width:40px; height:40px; border-radius:50%; background:#fff; display:grid; place-items:center; flex:none; }
  .ai-head .av img { width:34px; }
  .ai-head b { display:block; font-size:15px; } .ai-head small { font-size:11.5px; opacity:.8; display:flex; align-items:center; gap:6px; }
  .ai-head small::before { content:''; width:7px; height:7px; border-radius:50%; background:#3ddc84; }
  .ai-head button { margin-left:auto; background:none; border:0; color:#fff; font-size:22px; cursor:pointer; opacity:.8; }
  .ai-body { flex:1; overflow-y:auto; padding:16px; background:#faf6f3; display:flex; flex-direction:column; gap:10px; }
  .ai-msg { max-width:84%; padding:10px 13px; font-size:13.5px; line-height:1.5; border-radius:14px; white-space:pre-wrap; word-wrap:break-word; animation:aiRise .3s ease both; }
  .ai-msg.bot { background:#fff; color:#262626; border-bottom-left-radius:4px; box-shadow:0 2px 8px rgba(0,0,0,.05); }
  .ai-msg.me { align-self:flex-end; background:#741f22; color:#fff; border-bottom-right-radius:4px; }
  .ai-msg a { color:inherit; text-decoration:underline; }
  .ai-typing { display:flex; gap:4px; padding:12px 14px; }
  .ai-typing i { width:7px; height:7px; border-radius:50%; background:#c9a9a9; animation:aiDot 1s infinite; }
  .ai-typing i:nth-child(2) { animation-delay:.15s; } .ai-typing i:nth-child(3) { animation-delay:.3s; }
  @keyframes aiDot { 0%,60%,100% { transform:none; opacity:.5; } 30% { transform:translateY(-5px); opacity:1; } }
  .ai-chips { display:flex; gap:7px; flex-wrap:wrap; padding:0 16px 10px; background:#faf6f3; }
  .ai-chips button { border:1px solid #e6d3d3; background:#fff; color:#741f22; font:inherit; font-size:12px; padding:6px 11px; border-radius:16px; cursor:pointer; }
  .ai-chips button:hover { background:#f6eeec; }
  .ai-form { display:flex; gap:8px; padding:12px; border-top:1px solid #f0e6e6; background:#fff; }
  .ai-form input { flex:1; border:1px solid #e6dcdc; border-radius:22px; padding:10px 14px; font:inherit; font-size:13.5px; outline:none; }
  .ai-form input:focus { border-color:#741f22; }
  .ai-form button { width:42px; height:42px; border-radius:50%; border:0; background:#741f22; cursor:pointer; display:grid; place-items:center; flex:none; }
  .ai-foot { font-size:10.5px; color:#999; text-align:center; padding:0 12px 10px; background:#fff; }
  @media (max-width:860px) {
    .ai-fab { right:16px; bottom:16px; width:56px; height:56px; }
    .ai-tip { right:82px; bottom:28px; }
    .ai-panel { right:0; left:0; bottom:0; width:auto; height:88vh; max-height:none; border-radius:18px 18px 0 0; }
  }

.ai-tg{display:inline-flex;align-items:center;gap:6px;margin-left:auto;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);color:#fff;font-size:11.5px;font-weight:600;padding:6px 10px;border-radius:16px;text-decoration:none;white-space:nowrap}
.ai-tg:hover{background:rgba(255,255,255,.24)}
.ai-head .ai-tg + button{margin-left:6px}
.ai-foot a{color:#741f22;text-decoration:underline}
.ai-msg.bot a{color:#741f22}
@media (prefers-reduced-motion:reduce){.ai-fab::before{animation:none}}
/* keep the chat above everything and hide the floating cart while chatting */
.ai-panel{z-index:2147483100!important}
.ai-fab,.ai-tip{z-index:2147483099!important}
html.ai-open #imtta-floating-cart{display:none!important}

/* phones: compact floating chat window (not full screen) */
@media (max-width:860px){
  .ai-panel{left:12px!important;right:12px!important;bottom:84px!important;width:auto!important;height:min(62vh,500px)!important;max-height:calc(100vh - 170px)!important;border-radius:18px!important}
  .ai-head{padding:12px 14px}
  .ai-head .av{width:34px;height:34px}.ai-head .av img{width:28px}
  .ai-body{padding:12px}
  .ai-msg{font-size:13px}
  .ai-chips{padding:0 12px 8px}
  .ai-foot{display:none}
}

/* unread-reply badge + preview */
.ai-badge{position:absolute;top:-4px;left:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#e53935;color:#fff;font:700 12px/22px Inter,Arial,sans-serif;text-align:center;border:2px solid #fff;box-shadow:0 3px 8px rgba(0,0,0,.25);animation:aiBadge .5s cubic-bezier(.3,1.6,.5,1)}
@keyframes aiBadge{from{transform:scale(0)}to{transform:scale(1)}}
.ai-fab.ai-ring{animation:aiRing .9s ease 2}
@keyframes aiRing{0%,100%{transform:rotate(0)}15%{transform:rotate(-14deg)}30%{transform:rotate(12deg)}45%{transform:rotate(-8deg)}60%{transform:rotate(5deg)}}
.ai-tip.ai-new{cursor:pointer;pointer-events:auto;max-width:min(300px,calc(100vw - 110px));white-space:normal;line-height:1.4;border-left:3px solid #741f22}
.ai-tip.ai-new b{display:block;color:#741f22;font-size:12px;margin-bottom:2px}
