/* ===== Unique Digital Shop Bot — dark theme ===== */
:root{
  --bg:#0A0E15; --bg2:#111827; --card:#141b2d; --line:rgba(255,107,0,.16);
  --orange:#FF6B00; --orange-d:#d45500; --txt:#f3f4f6; --muted:#9ca3af;
  --bot-bubble:#161d31; --radius:18px;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--txt);
  font-family:'Inter',system-ui,sans-serif;
  display:flex; justify-content:center;
}
.chat-shell{
  width:100%; max-width:520px; height:100dvh; display:flex; flex-direction:column;
  background:
    radial-gradient(600px 300px at 80% -60px, rgba(255,107,0,.10), transparent 60%),
    radial-gradient(500px 260px at 10% 110%, rgba(255,107,0,.06), transparent 60%),
    var(--bg);
  border-left:1px solid rgba(255,255,255,.05); border-right:1px solid rgba(255,255,255,.05);
}
/* Header */
.chat-header{
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:rgba(10,14,21,.92); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5;
}
.bot-avatar{
  width:44px; height:44px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-family:'Sora',sans-serif; font-weight:800; color:#fff;
  background:linear-gradient(135deg,var(--orange),#ff8c3a);
  box-shadow:0 0 18px rgba(255,107,0,.45);
}
.bot-meta{flex:1; min-width:0}
.bot-name{font-family:'Sora',sans-serif; font-weight:700; font-size:15px}
.verified{color:var(--orange); font-size:13px}
.bot-status{font-size:12px; color:var(--muted); display:flex; align-items:center; gap:6px}
.bot-status .dot{width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 8px #22c55e; animation:pulse 2s infinite}
@keyframes pulse{50%{opacity:.5}}
.hdr-wa{
  width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:#fff; background:rgba(255,107,0,.14); border:1px solid var(--line); text-decoration:none;
}
.promo-strip{
  font-size:11.5px; color:#ffd9b8; text-align:center; padding:7px 10px;
  background:rgba(255,107,0,.08); border-bottom:1px solid var(--line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* Messages */
.chat-body{flex:1; overflow-y:auto; padding:16px 12px 8px; display:flex; flex-direction:column; gap:10px; scroll-behavior:smooth}
.msg{max-width:86%; display:flex; flex-direction:column; gap:4px; animation:rise .25s ease}
@keyframes rise{from{opacity:0; transform:translateY(8px)}}
.msg.bot{align-self:flex-start}
.msg.user{align-self:flex-end; align-items:flex-end}
.bubble{
  padding:10px 14px; border-radius:var(--radius); font-size:14px; line-height:1.55;
  word-wrap:break-word; white-space:pre-wrap;
}
.msg.bot .bubble{background:var(--bot-bubble); border:1px solid rgba(255,255,255,.06); border-bottom-left-radius:6px}
.msg.user .bubble{background:linear-gradient(135deg,var(--orange),#ff8c3a); color:#fff; border-bottom-right-radius:6px; font-weight:500}
.bubble b{font-weight:700}
.msg-time{font-size:10px; color:var(--muted)}
/* Typing indicator */
.typing{display:inline-flex; gap:5px; padding:12px 16px}
.typing span{width:7px; height:7px; border-radius:50%; background:#8b93a7; animation:tp 1.1s infinite}
.typing span:nth-child(2){animation-delay:.18s}.typing span:nth-child(3){animation-delay:.36s}
@keyframes tp{0%,60%,100%{transform:none; opacity:.5}30%{transform:translateY(-5px); opacity:1}}
/* Product cards in chat */
.pcard{
  background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px;
  display:flex; gap:12px; align-items:center; margin-top:6px; width:100%;
}
.pcard img{width:56px; height:56px; object-fit:contain; border-radius:12px; background:#0d1322; padding:6px; flex:none}
.p-logo{width:56px; height:56px; object-fit:contain; border-radius:12px; background:#0d1322; padding:6px; flex:none; max-width:56px; max-height:56px}
.pcard .pi{flex:1; min-width:0}
.pcard .pn{font-family:'Sora',sans-serif; font-weight:600; font-size:13.5px; margin:0 0 2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.pcard .pp{color:var(--orange); font-weight:700; font-size:14px}
.pcard .pp s{color:var(--muted); font-weight:400; font-size:12px; margin-left:6px}
.pbadge{font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:#0A0E15; background:#ffd166; border-radius:20px; padding:2px 8px; display:inline-block; margin-top:3px}
.pbadge.new{background:#22c55e; color:#fff}
.pcard .pbtns{display:flex; gap:6px; margin-top:8px}
.btn-sm{
  border:1px solid var(--line); background:rgba(255,107,0,.12); color:#ffb37a;
  font-size:12px; font-weight:600; padding:6px 12px; border-radius:20px; cursor:pointer; font-family:'Inter',sans-serif;
}
.btn-sm.solid{background:linear-gradient(135deg,var(--orange),#ff8c3a); color:#fff; border:none}
.btn-sm:active{transform:scale(.96)}
/* Detail card */
.detail{background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px; margin-top:6px; width:100%}
.detail .dhead{display:flex; gap:12px; align-items:center; margin-bottom:8px}
.detail img{width:64px; height:64px; object-fit:contain; border-radius:14px; background:#0d1322; padding:8px}
.detail h4{margin:0 0 2px; font-family:'Sora',sans-serif; font-size:15px}
.detail .dprice{color:var(--orange); font-weight:700; font-size:16px}
.detail .dprice s{color:var(--muted); font-size:13px; font-weight:400; margin-left:6px}
.detail p.ddesc{font-size:13px; color:#c9d1e0; line-height:1.6; margin:8px 0}
.detail .dmeta{font-size:12px; color:var(--muted); margin-bottom:10px}
/* Quick replies */
.quick-wrap{padding:8px 12px 4px; background:transparent}
.quick-replies{display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; scrollbar-width:none}
.quick-replies::-webkit-scrollbar{display:none}
.qr{
  flex:none; border:1px solid var(--line); background:rgba(255,107,0,.10); color:#ffc89a;
  font-size:13px; font-weight:600; padding:8px 14px; border-radius:20px; cursor:pointer; font-family:'Inter',sans-serif;
  transition:transform .12s;
}
.qr:active{transform:scale(.95)}
.qr.primary{background:linear-gradient(135deg,var(--orange),#ff8c3a); color:#fff; border:none}
/* Input */
.chat-input{
  display:flex; gap:8px; padding:10px 12px calc(12px + env(safe-area-inset-bottom));
  background:rgba(10,14,21,.95); border-top:1px solid var(--line);
}
.chat-input input{
  flex:1; background:var(--bot-bubble); border:1px solid rgba(255,255,255,.08); color:var(--txt);
  border-radius:24px; padding:12px 16px; font-size:14px; outline:none; font-family:'Inter',sans-serif;
}
.chat-input input:focus{border-color:var(--orange)}
.chat-input button{
  width:46px; height:46px; border-radius:50%; border:none; cursor:pointer; flex:none;
  background:linear-gradient(135deg,var(--orange),#ff8c3a); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 14px rgba(255,107,0,.4);
}
.chat-input button:active{transform:scale(.93)}
/* Order summary */
.osum{background:rgba(255,107,0,.07); border:1px dashed var(--orange); border-radius:12px; padding:10px 12px; font-size:13px; margin-top:6px; width:100%}
.osum .row{display:flex; justify-content:space-between; padding:3px 0}
.osum .total{border-top:1px solid var(--line); margin-top:6px; padding-top:8px; font-weight:700; color:var(--orange); font-size:15px}
/* Admin */
.admin-wrap{max-width:900px; margin:0 auto; padding:20px 14px; width:100%}
.admin-wrap h1{font-family:'Sora',sans-serif}
.atable{width:100%; border-collapse:collapse; font-size:13px; margin-top:14px}
.atable th,.atable td{padding:10px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top}
.atable th{color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.5px}
.st{padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700}
.st.pending{background:rgba(255,193,7,.15); color:#ffc107}
.st.completed{background:rgba(34,197,94,.15); color:#22c55e}
.st.cancelled{background:rgba(239,68,68,.15); color:#ef4444}
@media (max-width:480px){ .bubble{font-size:13.5px} .pcard img{width:48px; height:48px} .p-logo{width:48px; height:48px; max-width:48px; max-height:48px} }
