#tpbot-root{--tpc:#D32F2F;--tpc-dk:#AC0807;--tpc-flower:#993333;font-family:"Bai Jamjuree",-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
#tpbot-root *{box-sizing:border-box}
/* Launcher "nút biết nói" (GĐ1): pill có avatar + nhãn "Tư vấn ngay" + chấm sống + badge. */
#tpbot-root .tpc-launcher{position:fixed;right:157px;bottom:20px;height:60px;padding:0 18px 0 10px;border-radius:999px;background:var(--tpc);color:#fff;display:flex;align-items:center;gap:10px;cursor:pointer;border:0;box-shadow:0 10px 26px rgba(0,0,0,.28);z-index:99998;font-family:inherit}
#tpbot-root .tpc-launcher:hover{filter:brightness(1.06)}
#tpbot-root .tpc-lava{position:relative;width:40px;height:40px;border-radius:50%;background:#fff;border:2px solid #fff;display:grid;place-items:center;flex:0 0 auto}
#tpbot-root .tpc-lava svg{width:30px;height:30px;display:block;color:var(--tpc-flower-launcher,var(--tpc-flower,#993333))} /* hoa mai (currentColor) → #993333; nếu thiếu color sẽ trắng trên đĩa trắng = tàng hình */
#tpbot-root .tpc-ldot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:#37d67a;border:2px solid #fff}
#tpbot-root .tpc-llabel{font-weight:700;font-size:15px;white-space:nowrap}
#tpbot-root .tpc-lbadge{position:absolute;top:-6px;right:-4px;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#fff;color:var(--tpc);font-size:12px;font-weight:800;display:grid;place-items:center;border:2px solid var(--tpc)}
#tpbot-root .tpc-lbadge[hidden]{display:none} /* GĐ1: badge ẩn mặc định (display:grid ở trên đè [hidden] của UA nếu không có dòng này). */
#tpbot-root .tpc-launcher.tpc-pulse{animation:tpcpulse 1.2s ease-out 2}
@keyframes tpcpulse{0%{box-shadow:0 10px 26px rgba(0,0,0,.28),0 0 0 0 rgba(211,47,47,.55)}100%{box-shadow:0 10px 26px rgba(0,0,0,.28),0 0 0 18px rgba(211,47,47,0)}}
@media(prefers-reduced-motion:reduce){#tpbot-root .tpc-launcher.tpc-pulse{animation:none}}
/* Biến thể B (nút cũ) cho A/B — tròn, chỉ emoji 💬 */
#tpbot-root .tpc-launcher.tpc-v-old{width:60px;height:60px;padding:0;border-radius:50%;display:grid;place-items:center;font-size:26px}
#tpbot-root .tpc-panel{position:fixed;right:20px;bottom:90px;width:370px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 120px);background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 18px 50px rgba(20,10,10,.22);display:none;flex-direction:column;z-index:99999}
#tpbot-root .tpc-panel.open{display:flex}
#tpbot-root .tpc-hd{background:linear-gradient(135deg,var(--tpc),var(--tpc-dk));color:#fff;padding:13px 14px;display:flex;align-items:center;gap:10px}
#tpbot-root .tpc-ava{width:40px;height:40px;border-radius:50%;background:#fff;color:var(--tpc);font-weight:800;display:grid;place-items:center;font-size:14px;flex:0 0 auto}
#tpbot-root .tpc-ava svg{width:24px;height:24px;display:block;color:var(--tpc-flower)} /* logo hoa mai — màu khoá #993333, không trôi theo --tpc */
#tpbot-root .tpc-hd .t{font-weight:700;font-size:14.5px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tpbot-root .tpc-hd .s{font-size:11.5px;opacity:.92;display:flex;align-items:center;gap:6px;margin-top:2px;min-width:0}
#tpbot-root .tpc-hd-info{min-width:0;flex:1 1 auto} /* mở khoá ellipsis trong flex + chống tên dài đè nút */
#tpbot-root .tpc-hd .s .tpc-dot{flex:0 0 auto} /* khoá chấm xanh "đang online" không bị bóp mất màu */
#tpbot-root .tpc-hd-status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tpbot-root .tpc-x{margin-left:6px;background:transparent;border:0;color:#fff;font-size:22px;line-height:1;cursor:pointer;opacity:.9}
#tpbot-root .tpc-cart-btn{margin-left:auto;position:relative;background:rgba(255,255,255,.16);border:0;color:#fff;font-size:16px;line-height:1;cursor:pointer;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto}
#tpbot-root .tpc-cart-btn:hover{background:rgba(255,255,255,.28)}
#tpbot-root .tpc-new{background:rgba(255,255,255,.16);border:0;color:#fff;cursor:pointer;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto}
#tpbot-root .tpc-new:hover{background:rgba(255,255,255,.28)}
#tpbot-root .tpc-new svg{width:16px;height:16px;display:block}
#tpbot-root .tpc-cart-count{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:0 4px;border-radius:9px;background:#fff;color:var(--tpc);font-size:10px;font-weight:800;display:grid;place-items:center;line-height:1}
#tpbot-root .tpc-dot{width:8px;height:8px;border-radius:50%;background:#37d67a;box-shadow:0 0 0 3px rgba(55,214,122,.25)}
#tpbot-root .tpc-body{flex:1;overflow-y:auto;padding:14px 12px;background:#fafbfc}
#tpbot-root .tpc-msg{display:flex;margin-bottom:10px}
#tpbot-root .tpc-msg .b{max-width:82%;padding:9px 12px;border-radius:14px;font-size:14px;line-height:1.5;word-wrap:break-word;overflow-wrap:anywhere}
#tpbot-root .tpc-bot .b{background:#f1f2f4;border:1px solid #e6e8eb;border-bottom-left-radius:4px;color:#1c1c1e}
#tpbot-root .tpc-me{justify-content:flex-end}
#tpbot-root .tpc-me .b{background:var(--tpc);color:#fff;border-bottom-right-radius:4px}
#tpbot-root .tpc-price{color:var(--tpc);font-weight:700}
#tpbot-root .tpc-link{color:var(--tpc);font-weight:600;text-decoration:underline;cursor:pointer}
#tpbot-root .tpc-link:hover{color:var(--tpc-dk)}
#tpbot-root .tpc-cards{display:flex;flex-direction:column;gap:8px;margin:0 0 12px}
#tpbot-root .tpc-card{display:flex;gap:10px;align-items:flex-start;background:#fff;border:1px solid #eceef1;border-radius:12px;padding:8px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
#tpbot-root .tpc-card:hover{border-color:var(--tpc);box-shadow:0 3px 10px rgba(211,47,47,.15)}
#tpbot-root .tpc-card-imglink{flex:0 0 auto;line-height:0}
#tpbot-root .tpc-card-img{width:64px;height:64px;border-radius:8px;object-fit:cover;background:#f3f4f6;display:block}
#tpbot-root .tpc-card-body{display:flex;flex-direction:column;min-width:0;flex:1;gap:2px}
#tpbot-root .tpc-card-name{font-size:13px;font-weight:600;color:#1c1c1e;line-height:1.3;text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#tpbot-root .tpc-card-name:hover{color:var(--tpc)}
#tpbot-root .tpc-card-price{color:var(--tpc);font-weight:700;font-size:14px}
#tpbot-root .tpc-card-actions{display:flex;align-items:center;gap:8px;margin-top:5px;flex-wrap:wrap}
#tpbot-root .tpc-card-detail{font-size:12px;color:#6b7280;text-decoration:none;font-weight:600;white-space:nowrap}
#tpbot-root .tpc-card-detail:hover{color:var(--tpc)}
#tpbot-root .tpc-card-cart{font-family:inherit;font-size:12px;font-weight:700;color:#fff;background:var(--tpc);border:0;border-radius:999px;padding:6px 12px;cursor:pointer;white-space:nowrap;text-decoration:none;display:inline-block;line-height:1.2}
#tpbot-root .tpc-card-cart:hover{background:var(--tpc-dk)}
#tpbot-root .tpc-card-cart:disabled{opacity:.7;cursor:default}
#tpbot-root .tpc-chips{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 10px}
#tpbot-root .tpc-chip{font-size:13px;background:#fff;border:1px solid var(--tpc);color:var(--tpc);border-radius:999px;padding:6px 11px;cursor:pointer;font-family:inherit}
#tpbot-root .tpc-chip:hover{background:#fff4f4}
#tpbot-root .tpc-typing .b{display:inline-flex;gap:4px}
#tpbot-root .tpc-typing i{width:7px;height:7px;border-radius:50%;background:#c2c2c8;animation:tpcbl 1s infinite}
#tpbot-root .tpc-typing i:nth-child(2){animation-delay:.15s}
#tpbot-root .tpc-typing i:nth-child(3){animation-delay:.3s}
@keyframes tpcbl{0%,80%{opacity:.3}40%{opacity:1}}
#tpbot-root .tpc-ft{border-top:1px solid #e6e8eb;padding:9px;display:flex;gap:7px;background:#fff}
#tpbot-root .tpc-ft input{flex:1;border:1px solid #e6e8eb;border-radius:999px;padding:10px 13px;font-size:14px;outline:none;font-family:inherit}
#tpbot-root .tpc-ft input:focus{border-color:var(--tpc)}
#tpbot-root .tpc-send{width:40px;height:40px;border:0;border-radius:50%;background:var(--tpc);color:#fff;cursor:pointer;font-size:16px;flex:0 0 auto}
/* Bộ chọn số lượng (A2) — dùng cả trên thẻ và trong giỏ */
#tpbot-root .tpc-qty{display:inline-flex;align-items:center;border:1px solid #dfe2e6;border-radius:999px;overflow:hidden;background:#fff}
#tpbot-root .tpc-qty button{width:24px;height:24px;border:0;background:#f3f4f6;color:#333;font-size:15px;line-height:1;cursor:pointer;font-family:inherit}
#tpbot-root .tpc-qty button:hover{background:#e9ebee;color:var(--tpc)}
#tpbot-root .tpc-qty b{min-width:22px;text-align:center;font-size:12.5px;font-weight:700}
#tpbot-root .tpc-card-qty{margin-right:2px}
/* Khung giỏ hàng trong chat (A3) */
#tpbot-root .tpc-cartview{background:#fff;border:1px solid #eceef1;border-radius:14px;padding:10px;margin:0 0 12px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
#tpbot-root .tpc-cart-title{font-weight:800;color:var(--tpc);font-size:14px;margin:0 0 8px}
#tpbot-root .tpc-cart-empty{font-size:13px;color:#6b7280;padding:6px 0}
#tpbot-root .tpc-ci{display:flex;gap:9px;align-items:flex-start;padding:8px 0;border-top:1px solid #f0f1f3}
#tpbot-root .tpc-ci:first-of-type{border-top:0}
#tpbot-root .tpc-ci-imglink{flex:0 0 auto;line-height:0}
#tpbot-root .tpc-ci-img{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#f3f4f6;display:block}
#tpbot-root .tpc-ci-body{flex:1;min-width:0}
#tpbot-root .tpc-ci-name{font-size:12.5px;font-weight:600;color:#1c1c1e;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:5px}
#tpbot-root .tpc-ci-row{display:flex;align-items:center;gap:8px}
#tpbot-root .tpc-ci-total{margin-left:auto;color:var(--tpc);font-weight:700;font-size:13px;white-space:nowrap}
#tpbot-root .tpc-ci-remove{width:22px;height:22px;border:0;background:transparent;color:#b0b3b8;font-size:18px;line-height:1;cursor:pointer;flex:0 0 auto}
#tpbot-root .tpc-ci-remove:hover{color:var(--tpc)}
#tpbot-root .tpc-cart-foot{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #eceef1;margin-top:6px;padding-top:9px;font-size:13px}
#tpbot-root .tpc-cart-total{color:var(--tpc);font-weight:800;font-size:16px}
#tpbot-root .tpc-cart-actions{display:flex;gap:8px;margin-top:10px}
#tpbot-root .tpc-cart-checkout{flex:1;text-align:center;background:var(--tpc);color:#fff;font-weight:700;font-size:13.5px;padding:9px 12px;border-radius:999px;text-decoration:none}
#tpbot-root .tpc-cart-checkout:hover{background:var(--tpc-dk)}
#tpbot-root .tpc-cart-viewfull{flex:0 0 auto;text-align:center;background:#fff;border:1px solid #dfe2e6;color:#374151;font-weight:600;font-size:12.5px;padding:9px 12px;border-radius:999px;text-decoration:none}
#tpbot-root .tpc-cart-viewfull:hover{border-color:var(--tpc);color:var(--tpc)}
/* Khi drawer Giỏ hàng của theme đang mở: ẩn cả chatbot lẫn nút "Liên hệ" nổi của theme (.contact-wrapper)
   để không che nút Thanh toán / Xem giỏ hàng. Áp dụng cả desktop lẫn mobile. */
body.tpbot-cart-open #tpbot-root,
body.tpbot-cart-open .contact-wrapper{display:none !important}
@media(max-width:600px){
  #tpbot-root .tpc-launcher{right:20px;bottom:120px;height:52px;width:52px;padding:0;justify-content:center;gap:0}
  #tpbot-root .tpc-llabel{display:none}
  #tpbot-root .tpc-lava{width:36px;height:36px}
  #tpbot-root .tpc-lava svg{width:26px;height:26px}
  #tpbot-root .tpc-launcher.tpc-v-old{width:52px;height:52px;font-size:22px}
  .contact-wrapper{bottom:64px !important}
  #tpbot-root .tpc-panel{left:8px;right:8px;width:auto;bottom:84px;max-height:calc(100vh - 100px)}
  #tpbot-root .tpc-ft input{font-size:16px}
}
