/* Bharath, the shopkeeper assistant (public/js/assistant.js) */
.bharath{position:fixed;left:18px;bottom:18px;z-index:60;font-family:var(--font,system-ui),sans-serif}
.bharath[hidden]{display:none}
.bh-dock{position:relative;display:flex;align-items:center;gap:10px;padding:5px 16px 5px 5px;border:0;border-radius:999px;background:#0f3a22;color:#fff;cursor:pointer;
  box-shadow:0 10px 26px rgba(10,40,20,.28);font:inherit;font-weight:700;font-size:.92rem;transition:transform .2s,box-shadow .2s}
.bh-dock:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(10,40,20,.34)}
.bh-dock:focus-visible,.bharath button:focus-visible,.bharath a:focus-visible,.bharath input:focus-visible{outline:3px solid #f6c343;outline-offset:2px}
.bh-dock img{width:46px;height:46px;border-radius:50%;background:#f6e9cf;border:2px solid #f6c343;object-fit:cover}
.bh-dot{position:absolute;top:2px;left:38px;width:14px;height:14px;border-radius:50%;background:#e4572e;border:2px solid #fff}
.bh-dot[hidden]{display:none}
.motion .bh-dot{animation:bh-ping 1.6s ease-out infinite}
@keyframes bh-ping{0%{box-shadow:0 0 0 0 rgba(228,87,46,.6)}100%{box-shadow:0 0 0 10px rgba(228,87,46,0)}}
.motion .bh-dock.bh-pop{animation:bh-pop .6s cubic-bezier(.3,1.6,.5,1)}
@keyframes bh-pop{0%{transform:scale(.6)}100%{transform:scale(1)}}
.bharath.bh-docking .bh-dock{opacity:.4}

/* entrance */
.bh-hero{position:fixed;left:12px;bottom:12px;z-index:61;display:flex;align-items:flex-end;gap:0;pointer-events:none}
.bh-hero > *{pointer-events:auto}
.bh-man{width:168px;height:auto;filter:drop-shadow(0 12px 18px rgba(0,0,0,.22));transform-origin:50% 100%}
.bh-bubble{position:relative;width:min(340px,calc(100vw - 200px));margin:0 0 120px -14px;padding:16px 16px 14px;border-radius:20px 20px 20px 6px;background:#fff;color:var(--ink,#1f261f);
  box-shadow:0 18px 44px rgba(20,40,20,.22);border:1px solid #f0e2c0}
.bh-bubble::before{content:"";position:absolute;left:-9px;bottom:16px;width:18px;height:18px;background:#fff;border-left:1px solid #f0e2c0;border-bottom:1px solid #f0e2c0;transform:rotate(45deg)}
.bh-bubble p{margin:0 22px 4px 0;font-size:.95rem;line-height:1.45}
.bh-bubble small{display:block;color:#8a5a00;font-weight:700;font-size:.78rem;margin-bottom:8px}
.bh-later{position:absolute;top:6px;right:8px;width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#6b736c;font-size:1.3rem;cursor:pointer}
.bh-later:hover{background:#f3f1ec}
.bh-hero-btns{display:flex;gap:8px;margin-top:10px}
.bh-hero-btns button{border:0;border-radius:999px;padding:8px 14px;font:inherit;font-weight:700;font-size:.85rem;cursor:pointer}
.bh-more{background:#0f3a22;color:#fff}
.bh-nope{background:#f3f1ec;color:#3c433e}
/* animation: walk in from the left, wave, bubble pops; leaves by shrinking into the dock */
.bh-hero .bh-man,.bh-hero .bh-bubble{opacity:0}
.bh-hero.in .bh-man,.bh-hero.in .bh-bubble{opacity:1}
.motion .bh-hero .bh-man{transform:translateX(-240px) rotate(-6deg);transition:transform .9s cubic-bezier(.2,.9,.2,1.15),opacity .4s}
.motion .bh-hero.in .bh-man{transform:none;animation:bh-hello 1.4s ease-in-out .9s 2}
.motion .bh-hero .bh-bubble{transform:scale(.6) translateY(20px);transform-origin:0 100%;transition:transform .45s cubic-bezier(.3,1.5,.5,1) .7s,opacity .3s .7s}
.motion .bh-hero.in .bh-bubble{transform:none}
.motion .bh-hero.out .bh-man,.motion .bh-hero.out .bh-bubble{transition:transform .6s cubic-bezier(.6,0,.4,1),opacity .6s;opacity:0;transform:translate(-30px,60px) scale(.25);transform-origin:0 100%}
@keyframes bh-hello{0%,100%{transform:rotate(0)}25%{transform:rotate(-4deg) translateY(-6px)}50%{transform:rotate(3deg)}75%{transform:rotate(-2deg) translateY(-3px)}}

/* product card (bubble and panel) */
.bh-item{display:grid;grid-template-columns:52px 1fr auto;gap:10px;align-items:center;margin-top:8px;padding:8px;border-radius:14px;background:#f8f6f0}
.bh-pic{display:grid;place-items:center;width:52px;height:52px;border-radius:12px;background:#fff;overflow:hidden;font-size:1.6rem;text-decoration:none}
.bh-pic img{width:100%;height:100%;object-fit:contain}
.bh-info{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.bh-name{font-weight:700;font-size:.88rem;color:inherit;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bh-name:hover{text-decoration:underline}
.bh-unit{font-size:.74rem;color:#6b736c}
.bh-why{font-size:.72rem;font-weight:700;color:#1d5a35}
.bh-price{font-size:.88rem;margin-top:2px}
.bh-price s{color:#8b918c;font-size:.78rem}
.bh-add{margin:0}
.bh-add button{border:0;border-radius:999px;padding:8px 12px;background:#f6c343;color:#13301d;font:inherit;font-weight:800;font-size:.82rem;cursor:pointer;white-space:nowrap}
.bh-add button:hover{background:#efb52c}
.bh-oos{font-size:.75rem;color:#8b918c}

/* chat panel */
.bh-panel{position:fixed;left:18px;bottom:84px;z-index:62;display:flex;flex-direction:column;width:min(380px,calc(100vw - 36px));height:min(560px,calc(100vh - 120px));
  border-radius:22px;background:#fff;box-shadow:0 24px 60px rgba(15,40,20,.28);overflow:hidden;border:1px solid #e6eadf}
.bh-panel[hidden]{display:none}
.motion .bh-panel:not([hidden]){animation:bh-open .3s cubic-bezier(.2,.9,.3,1.1)}
@keyframes bh-open{from{opacity:0;transform:translateY(16px) scale(.97);transform-origin:0 100%}to{opacity:1;transform:none}}
.bh-head{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;background:#0f3a22;color:#fff}
.bh-head img{width:44px;height:44px;border-radius:50%;background:#f6e9cf;border:2px solid #f6c343}
.bh-head div{flex:1;display:flex;flex-direction:column;line-height:1.2}
.bh-head span{font-size:.74rem;color:#bcd6c4}
.bh-x{width:36px;height:36px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:1.4rem;cursor:pointer}
.bh-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#fbfaf6}
.bh-msg{max-width:92%;padding:10px 12px;border-radius:16px;font-size:.92rem;line-height:1.45}
.bh-msg p{margin:0}
.bh-msg small{display:block;margin-top:4px;color:#8a5a00;font-weight:700;font-size:.76rem}
.bh-msg.bot{align-self:flex-start;background:#fff;border:1px solid #ece8de;border-bottom-left-radius:6px}
.bh-msg.me{align-self:flex-end;background:#0f3a22;color:#fff;border-bottom-right-radius:6px}
.bh-link{display:inline-block;margin-top:8px;font-weight:700;font-size:.85rem;color:#1d5a35}
.bh-wa{display:block}
.bh-typing{display:flex;gap:4px}
.bh-typing span{width:7px;height:7px;border-radius:50%;background:#9aa59d}
.motion .bh-typing span{animation:bh-dot 1s infinite}
.bh-typing span:nth-child(2){animation-delay:.15s}.bh-typing span:nth-child(3){animation-delay:.3s}
@keyframes bh-dot{0%,80%,100%{opacity:.3}40%{opacity:1}}
.bh-chips{display:flex;gap:6px;overflow-x:auto;padding:8px 12px;border-top:1px solid #efece4;scrollbar-width:none}
.bh-chip{flex:none;border:1px solid #d8e3d8;border-radius:999px;padding:6px 12px;background:#fff;color:#1d4a2a;font:inherit;font-size:.8rem;font-weight:700;cursor:pointer}
.bh-chip:hover{background:#eef6ef}
.bh-ask{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid #efece4}
.bh-ask input{flex:1;min-width:0;border:1px solid #d6dbd3;border-radius:999px;padding:10px 14px;font:inherit;font-size:.92rem}
.bh-ask button{width:44px;height:44px;border:0;border-radius:50%;background:#f6c343;color:#13301d;font-size:1rem;cursor:pointer}

/* phones: sit above the bottom bar; smaller Bharath */
@media (max-width:720px){
  .bharath{left:12px;bottom:calc(78px + env(safe-area-inset-bottom,0px))}
  .bh-dock{padding:4px}
  .bh-dock-label{display:none}
  .bh-dock img{width:44px;height:44px}
  .bh-dot{left:34px}
  .bh-hero{left:4px;bottom:calc(70px + env(safe-area-inset-bottom,0px))}
  .bh-man{width:108px}
  .bh-bubble{width:calc(100vw - 112px);margin:0 0 70px -10px;padding:12px 12px 10px}
  .bh-bubble p{font-size:.86rem}
  .bh-panel{left:8px;right:8px;width:auto;bottom:calc(76px + env(safe-area-inset-bottom,0px));height:min(70vh,560px)}
}
@media (prefers-reduced-motion:reduce){ .bh-hero .bh-man,.bh-hero .bh-bubble{transition:none!important;animation:none!important} }
.bharath.bh-hero-on .bh-dock{opacity:0;pointer-events:none}
.bh-dock{transition:transform .2s,box-shadow .2s,opacity .3s}

/* basket-goal pop-ups from the dock */
.bh-tip{margin:10px 0 0!important;padding:8px 10px;border-radius:12px;background:#fff4d8;color:#6a4300;font-size:.84rem!important;font-weight:700;line-height:1.35}
.bh-peek{position:absolute;left:0;bottom:66px;width:min(330px,calc(100vw - 36px));padding:14px 14px 12px;border-radius:20px 20px 20px 6px;background:#fff;color:var(--ink,#1f261f);
  box-shadow:0 18px 44px rgba(20,40,20,.24);border:1px solid #f0e2c0;opacity:0;transform:translateY(10px) scale(.96);transform-origin:0 100%;transition:opacity .25s,transform .3s cubic-bezier(.3,1.4,.5,1)}
.bh-peek.in{opacity:1;transform:none}
.bh-peek p{margin:0 26px 0 0;font-size:.92rem;line-height:1.45;font-weight:600}
.bh-peek-win{background:linear-gradient(180deg,#eaf7ee,#fff);border-color:#bfe2c9}
.bh-peek-lost{background:linear-gradient(180deg,#fff1ea,#fff);border-color:#f3c3ad}
.bh-peek-more{margin-top:10px;border:0;border-radius:999px;padding:7px 14px;background:#0f3a22;color:#fff;font:inherit;font-weight:700;font-size:.82rem;cursor:pointer}
.motion .bh-peek-win.in{animation:bh-cheer .7s cubic-bezier(.3,1.6,.5,1)}
@keyframes bh-cheer{0%{transform:scale(.8)}60%{transform:scale(1.04)}100%{transform:none}}
.bharath.bh-open .bh-peek{display:none}
@media (max-width:720px){ .bh-peek{bottom:58px;width:calc(100vw - 24px)} }
@media (prefers-reduced-motion:reduce){ .bh-peek{transition:none!important;animation:none!important} }
