/* ==========================================================================
   MEMIA chatbot — soft pink / lavender / white.  Everything is scoped to #memia-root
   so it cannot affect the existing Memice layout.
   ========================================================================== */
#memia-root{
  --mm-pink:#ff7ab8; --mm-pink-2:#ff9ccb; --mm-pink-soft:#ffe9f4;
  --mm-lav:#a98cf0;  --mm-lav-2:#c9b6ff; --mm-lav-soft:#f3edff;
  --mm-ink:#3a2a55;  --mm-muted:#8a7aa6; --mm-line:#eadffb; --mm-white:#fff;
  --mm-shadow:0 18px 50px rgba(120,80,190,.28);
  font-family:var(--font-body,'DM Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif);
  font-size:14px; line-height:1.5; color:var(--mm-ink); letter-spacing:0;
}
#memia-root *,#memia-root *::before,#memia-root *::after{box-sizing:border-box;}
#memia-root button{font-family:inherit;cursor:pointer;}
#memia-root a{text-decoration:none;}
#memia-root font{font:inherit;color:inherit;background:transparent !important;box-shadow:none !important;border:0 !important;padding:0 !important;margin:0 !important;vertical-align:baseline !important;}

/* ---------- floating launcher ---------- */
#memia-root .mm-launcher{
  position:fixed; right:20px; bottom:20px; z-index:1060;
  width:68px; height:68px; padding:0; border:0; border-radius:50%;
  background:linear-gradient(135deg,var(--mm-pink-2),var(--mm-lav));
  box-shadow:0 10px 28px rgba(150,100,220,.45), 0 0 0 4px rgba(255,255,255,.9);
  display:flex; align-items:center; justify-content:center;
  transition:transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  animation:mmFloat 3.6s ease-in-out infinite;
}
#memia-root .mm-launcher:hover{transform:scale(1.07);}
#memia-root .mm-launcher:focus-visible{outline:3px solid var(--mm-lav);outline-offset:3px;}
#memia-root .mm-launcher img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;}
#memia-root .mm-launcher .mm-dot{
  position:absolute; right:3px; bottom:3px; width:15px; height:15px; border-radius:50%;
  background:#35d07f; border:3px solid #fff;
}
#memia-root .mm-launcher .mm-badge{
  position:absolute; top:-2px; right:-2px; min-width:20px; height:20px; padding:0 5px; border-radius:10px;
  background:#ff4d94; color:#fff; font-size:11px; font-weight:700; display:none; align-items:center; justify-content:center; border:2px solid #fff;
}
#memia-root .mm-launcher.mm-has-badge .mm-badge{display:flex;}
#memia-root .mm-launcher::after{
  content:''; position:absolute; inset:-6px; border-radius:50%; border:2px solid var(--mm-pink-2); opacity:0;
  animation:mmPulse 2.8s ease-out infinite;
}
#memia-root.mm-open .mm-launcher{opacity:0; pointer-events:none; transform:scale(.6);}
#memia-root .mm-hello{
  position:fixed; right:98px; bottom:34px; z-index:1060; max-width:230px;
  background:#fff; color:var(--mm-ink); border:1px solid var(--mm-line); border-radius:16px 16px 4px 16px;
  padding:9px 13px; font-size:13px; font-weight:500; box-shadow:0 8px 24px rgba(120,80,190,.2);
  display:none; animation:mmPop .35s ease;
}
#memia-root .mm-hello.mm-show{display:block;}
#memia-root .mm-hello button{
  position:absolute; top:-8px; right:-8px; width:20px; height:20px; border-radius:50%; border:1px solid var(--mm-line);
  background:#fff; color:var(--mm-muted); font-size:12px; line-height:1; padding:0;
}

/* ---------- chat window ---------- */
#memia-root .mm-window{
  position:fixed; right:20px; bottom:20px; z-index:1061;
  width:380px; max-width:calc(100vw - 24px); height:620px; max-height:calc(100vh - 40px); max-height:calc(100dvh - 40px);
  display:none; flex-direction:column; overflow:hidden;
  background:#fff; border-radius:22px; box-shadow:var(--mm-shadow); border:1px solid var(--mm-line);
  transform-origin:bottom right;
}
#memia-root.mm-open .mm-window{display:flex; animation:mmOpen .28s cubic-bezier(.2,.8,.2,1);}
#memia-root.mm-min .mm-window{height:auto; max-height:none;}
#memia-root.mm-min .mm-body,#memia-root.mm-min .mm-chips,#memia-root.mm-min .mm-composer,#memia-root.mm-min .mm-foot{display:none;}

#memia-root .mm-head{
  display:flex; align-items:center; gap:11px; padding:13px 14px;
  background:linear-gradient(120deg,#ff8cc4 0%,#c3a6ff 100%); color:#fff; flex:0 0 auto;
}
#memia-root .mm-head .mm-ava{
  position:relative; width:46px; height:46px; flex:0 0 46px; border-radius:50%; border:2px solid rgba(255,255,255,.9); background:#fff;
}
#memia-root .mm-head .mm-ava img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;}
#memia-root .mm-head .mm-ava i{position:absolute;right:-1px;bottom:-1px;width:12px;height:12px;border-radius:50%;background:#35d07f;border:2px solid #fff;}
#memia-root .mm-head .mm-who{flex:1;min-width:0;}
#memia-root .mm-head .mm-name{font-size:17px;font-weight:700;line-height:1.15;color:#fff;margin:0;font-family:inherit;}
#memia-root .mm-head .mm-tag{font-size:11.5px;opacity:.95;line-height:1.25;color:#fff;}
#memia-root .mm-head .mm-status{font-size:11px;font-weight:600;color:#fff;display:flex;align-items:center;gap:5px;margin-top:2px;}
#memia-root .mm-head .mm-status::before{content:'';width:7px;height:7px;border-radius:50%;background:#7dffb8;box-shadow:0 0 0 3px rgba(125,255,184,.3);}
#memia-root .mm-tools{display:flex;gap:4px;flex:0 0 auto;}
#memia-root .mm-tools button{
  width:32px;height:32px;border-radius:50%;border:0;background:rgba(255,255,255,.22);color:#fff;
  display:flex;align-items:center;justify-content:center;padding:0;transition:background .15s;
}
#memia-root .mm-tools button:hover{background:rgba(255,255,255,.4);}
#memia-root .mm-tools svg{width:16px;height:16px;stroke:#fff;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}

#memia-root .mm-body{
  flex:1 1 auto; overflow-y:auto; padding:16px 14px 6px; background:
    radial-gradient(circle at 15% 0%,var(--mm-pink-soft) 0,transparent 45%),
    radial-gradient(circle at 100% 30%,var(--mm-lav-soft) 0,transparent 50%), #fff;
  scroll-behavior:smooth; overscroll-behavior:contain;
}
#memia-root .mm-body::-webkit-scrollbar{width:6px;} #memia-root .mm-body::-webkit-scrollbar-thumb{background:var(--mm-lav-2);border-radius:6px;}

#memia-root .mm-row{display:flex;gap:8px;margin-bottom:12px;align-items:flex-end;animation:mmPop .25s ease;}
#memia-root .mm-row.mm-user{justify-content:flex-end;}
#memia-root .mm-mini{width:30px;height:30px;flex:0 0 30px;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 8px rgba(150,100,220,.3);object-fit:cover;background:#fff;}
#memia-root .mm-col{max-width:calc(100% - 42px);min-width:0;display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
#memia-root .mm-user .mm-col{align-items:flex-end;max-width:85%;}
#memia-root .mm-bub{
  padding:10px 13px; border-radius:18px 18px 18px 5px; background:#fff; color:var(--mm-ink);
  border:1px solid var(--mm-line); box-shadow:0 3px 10px rgba(150,100,220,.1); word-wrap:break-word; overflow-wrap:anywhere;
}
#memia-root .mm-user .mm-bub{
  background:linear-gradient(135deg,var(--mm-pink),var(--mm-lav)); color:#fff; border:0; border-radius:18px 18px 5px 18px;
  box-shadow:0 4px 14px rgba(255,122,184,.35);
}
#memia-root .mm-bub b{font-weight:700;}
#memia-root .mm-time{font-size:10.5px;color:var(--mm-muted);padding:0 4px;}

/* typing indicator */
#memia-root .mm-typing{display:flex;gap:4px;padding:13px 15px;}
#memia-root .mm-typing span{width:7px;height:7px;border-radius:50%;background:var(--mm-lav);animation:mmBounce 1.1s infinite ease-in-out;}
#memia-root .mm-typing span:nth-child(2){animation-delay:.15s;background:var(--mm-pink);}
#memia-root .mm-typing span:nth-child(3){animation-delay:.3s;}

/* listing cards */
#memia-root .mm-cards{display:flex;flex-direction:column;gap:8px;width:100%;}
#memia-root .mm-card{
  display:flex;gap:10px;background:#fff;border:1px solid var(--mm-line);border-radius:16px;padding:8px;
  box-shadow:0 3px 12px rgba(150,100,220,.12);transition:transform .15s,box-shadow .15s;
}
#memia-root .mm-card:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(150,100,220,.2);}
#memia-root .mm-card .mm-img{width:78px;height:78px;flex:0 0 78px;border-radius:12px;background:linear-gradient(135deg,var(--mm-pink-soft),var(--mm-lav-soft));object-fit:cover;display:block;}
#memia-root .mm-card .mm-info{flex:1;min-width:0;display:flex;flex-direction:column;}
#memia-root .mm-card .mm-svc{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--mm-lav);}
#memia-root .mm-card .mm-ttl{font-size:13.5px;font-weight:700;color:var(--mm-ink);line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
#memia-root .mm-card .mm-loc{font-size:11.5px;color:var(--mm-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#memia-root .mm-card .mm-price{font-size:13px;font-weight:700;color:#e0408a;margin-top:1px;}
#memia-root .mm-card .mm-meta{font-size:11px;color:var(--mm-muted);}
#memia-root .mm-card .mm-btn{
  margin-top:auto;align-self:flex-start;border:0;border-radius:20px;padding:4px 12px;font-size:12px;font-weight:600;color:#fff;
  background:linear-gradient(135deg,var(--mm-pink),var(--mm-lav));
}
#memia-root .mm-card .mm-btn:hover{filter:brightness(1.06);}

/* action buttons + chips */
#memia-root .mm-acts{display:flex;flex-wrap:wrap;gap:6px;}
#memia-root .mm-act{
  border:1.5px solid var(--mm-lav-2);background:#fff;color:#6c4fd0;border-radius:20px;padding:6px 13px;font-size:12.5px;font-weight:600;
  transition:all .15s;display:inline-block;
}
#memia-root .mm-act:hover{background:var(--mm-lav);color:#fff;border-color:var(--mm-lav);}
/* vertical selection list (welcome categories → sub-categories) */
#memia-root .mm-opts{display:flex;flex-direction:column;gap:7px;width:100%;min-width:230px;}
#memia-root .mm-opt{
  display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;
  min-height:42px;padding:9px 14px;border:1.5px solid #ffc2df;background:var(--mm-pink-soft);color:#c22a77;border-radius:14px;
  font-size:13.5px;font-weight:600;line-height:1.3;transition:all .15s;
}
#memia-root .mm-opt .mm-opt-t{flex:1;min-width:0;overflow-wrap:anywhere;}
#memia-root .mm-opt .mm-opt-go{font-style:normal;font-size:20px;line-height:1;opacity:.7;}
#memia-root .mm-opt:hover,#memia-root .mm-opt:focus-visible{background:var(--mm-pink);color:#fff;border-color:var(--mm-pink);outline:none;}
#memia-root .mm-opt-back{background:#fff;border-color:var(--mm-lav-2);color:#6c4fd0;}
#memia-root .mm-opt-back:hover,#memia-root .mm-opt-back:focus-visible{background:var(--mm-lav);border-color:var(--mm-lav);color:#fff;}
@media (max-width:575px){#memia-root .mm-opt{min-height:46px;font-size:14px;}}

#memia-root .mm-chips{flex:0 0 auto;display:flex;gap:7px;padding:8px 12px 4px;overflow-x:auto;scrollbar-width:none;background:#fff;border-top:1px solid #f4eefc;}
#memia-root .mm-chips::-webkit-scrollbar{display:none;}
#memia-root .mm-chips:empty{display:none;}
#memia-root .mm-chip{
  flex:0 0 auto;white-space:nowrap;border:1.5px solid #ffc2df;background:var(--mm-pink-soft);color:#c22a77;border-radius:18px;
  padding:6px 12px;font-size:12.5px;font-weight:600;transition:all .15s;
}
#memia-root .mm-chip:hover{background:var(--mm-pink);color:#fff;border-color:var(--mm-pink);}

#memia-root .mm-composer{flex:0 0 auto;display:flex;gap:8px;padding:10px 12px;background:#fff;align-items:center;}
#memia-root .mm-input{
  flex:1;min-width:0;height:42px;border:1.5px solid var(--mm-line);border-radius:22px;padding:0 16px;font-size:14px;color:var(--mm-ink);
  background:#faf7ff;outline:none;font-family:inherit;transition:border-color .15s,box-shadow .15s;
}
#memia-root .mm-input:focus{border-color:var(--mm-lav);box-shadow:0 0 0 3px rgba(169,140,240,.2);background:#fff;}
#memia-root .mm-input::placeholder{color:#b3a5cc;}
#memia-root .mm-send{
  width:42px;height:42px;flex:0 0 42px;border:0;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;padding:0;
  background:linear-gradient(135deg,var(--mm-pink),var(--mm-lav));box-shadow:0 4px 12px rgba(255,122,184,.4);transition:transform .15s,opacity .15s;
}
#memia-root .mm-send:hover{transform:scale(1.06);} #memia-root .mm-send:disabled{opacity:.5;transform:none;cursor:default;}
#memia-root .mm-send svg{width:18px;height:18px;fill:#fff;}
#memia-root .mm-foot{flex:0 0 auto;text-align:center;font-size:10.5px;color:var(--mm-muted);padding:0 12px 9px;background:#fff;}

#memia-root .mm-confirm{
  position:absolute;inset:0;background:rgba(58,42,85,.45);display:none;align-items:center;justify-content:center;padding:24px;z-index:5;
}
#memia-root .mm-confirm.mm-show{display:flex;}
#memia-root .mm-confirm .mm-box{background:#fff;border-radius:18px;padding:20px;text-align:center;max-width:290px;box-shadow:var(--mm-shadow);}
#memia-root .mm-confirm p{margin:0 0 14px;font-weight:600;}
#memia-root .mm-confirm .mm-pair{display:flex;gap:8px;justify-content:center;}
#memia-root .mm-confirm button{border:0;border-radius:20px;padding:8px 18px;font-weight:700;font-size:13px;}
#memia-root .mm-confirm .mm-yes{background:linear-gradient(135deg,var(--mm-pink),var(--mm-lav));color:#fff;}
#memia-root .mm-confirm .mm-no{background:var(--mm-lav-soft);color:#6c4fd0;}

#memia-root .mm-opt-wait{display:none !important;}
#memia-root .mm-opts{overflow:hidden;}
#memia-root .mm-opt-in{animation:mmOptIn .42s cubic-bezier(.22,.8,.3,1) both;}
@keyframes mmOptIn{from{opacity:0;transform:translateX(90px);}to{opacity:1;transform:none;}}
@keyframes mmFloat{0%,100%{transform:translateY(0);}50%{transform:translateY(-4px);}}
@keyframes mmPulse{0%{transform:scale(.95);opacity:.7;}70%,100%{transform:scale(1.3);opacity:0;}}
@keyframes mmPop{from{opacity:0;transform:translateY(8px) scale(.98);}to{opacity:1;transform:none;}}
@keyframes mmOpen{from{opacity:0;transform:translateY(16px) scale(.92);}to{opacity:1;transform:none;}}
@keyframes mmBounce{0%,60%,100%{transform:translateY(0);opacity:.6;}30%{transform:translateY(-6px);opacity:1;}}

/* keep clear of existing site UI */
body.mobile-menu-open #memia-root .mm-launcher,body.mobile-menu-open #memia-root .mm-hello{display:none;}
body.memia-on #toastContainer{bottom:96px !important;}

/* tablets */
@media (max-width:991px){
  #memia-root .mm-window{width:370px;height:min(600px,calc(100dvh - 40px));}
}
/* phones: bottom sheet */
@media (max-width:575px){
  #memia-root .mm-launcher{right:14px;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:58px;height:58px;}
  #memia-root .mm-hello{right:82px;bottom:calc(26px + env(safe-area-inset-bottom,0px));max-width:190px;font-size:12.5px;}
  #memia-root .mm-window{
    right:0;left:0;bottom:0;width:100%;max-width:100%;height:calc(100dvh - 56px);max-height:calc(100dvh - 56px);
    border-radius:22px 22px 0 0;padding-bottom:env(safe-area-inset-bottom,0px);
  }
  #memia-root.mm-min .mm-window{height:auto;}
  #memia-root .mm-input{font-size:16px;} /* stops iOS zoom on focus */
  body.memia-on #toastContainer{bottom:84px !important;}
}
@media (prefers-reduced-motion:reduce){
  #memia-root *,#memia-root *::before,#memia-root *::after{animation:none !important;transition:none !important;}
}
@media print{#memia-root{display:none !important;}}
