/* Nut noi "Tu van nhanh" + khung tu van (includes/quick-advisor-widget.php) */
.qa-btn { position: relative; background: linear-gradient(135deg, #7c3aed, #db2777); border: 1px solid rgba(255,255,255,.7); cursor: pointer; padding: 0; animation: qaPulse 2.6s ease-in-out 3; }
@keyframes qaPulse { 0%,100% { box-shadow: 0 10px 24px rgba(124,58,237,.25); } 50% { box-shadow: 0 0 0 9px rgba(219,39,119,.18), 0 10px 24px rgba(124,58,237,.3); } }
.qa-btn svg { width: 24px !important; height: 24px !important; }
.qa-btn .qa-ico-x { display: none; }
.qa-btn[aria-expanded="true"] .qa-ico-chat { display: none; }
.qa-btn[aria-expanded="true"] .qa-ico-x { display: block; }
@media (max-width: 768px) { .qa-btn { width: 50px !important; height: 50px !important; } }
.qa-tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: #111827; color: #fff; font-size: .78rem; font-weight: 600; padding: .35rem .6rem; border-radius: .5rem; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .25s; }
.qa-tip::after { content: ''; position: absolute; left: 100%; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left-color: #111827; }
.qa-tip.show { opacity: 1; }

.qa-panel { position: fixed; right: 16px; bottom: 80px; width: 390px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 100px)); background: #fff; border-radius: 1rem; box-shadow: 0 24px 60px rgba(15,23,42,.28); z-index: 10000; display: flex; flex-direction: column; overflow: hidden; font-size: .9rem; color: #1f2937; }
.qa-panel[hidden] { display: none; }
.qa-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; }
.qa-ava { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex: 0 0 auto; }
.qa-title { font-weight: 700; line-height: 1.2; }
.qa-sub { font-size: .75rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-x { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; }
.qa-tabs { display: flex; border-bottom: 1px solid #e5e7eb; background: #faf5ff; }
.qa-tabs button { flex: 1; border: 0; background: transparent; padding: .55rem; font-weight: 600; font-size: .88rem; color: #6b7280; border-bottom: 2px solid transparent; }
.qa-tabs button.on { color: #7c3aed; border-bottom-color: #7c3aed; background: #fff; }
.qa-body { flex: 1 1 auto; overflow-y: auto; padding: .7rem .8rem; overscroll-behavior: contain; }
.qa-q { font-weight: 700; font-size: .82rem; margin: .55rem 0 .3rem; color: #374151; }
.qa-q:first-child { margin-top: 0; }
.qa-q small { font-weight: 400; color: #9ca3af; }
.qa-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.qa-chips button { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: .25rem .65rem; font-size: .8rem; color: #374151; }
.qa-chips button.on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.qa-res { margin-top: .8rem; border-top: 1px dashed #e5e7eb; padding-top: .6rem; }
.qa-res-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; margin-bottom: .4rem; }
.qa-card { display: flex; gap: .55rem; padding: .45rem; border: 1px solid #eef0f3; border-radius: .6rem; margin-bottom: .4rem; text-decoration: none; color: inherit; background: #fff; }
.qa-card:hover { border-color: #c4b5fd; }
.qa-card img { width: 62px; height: 62px; object-fit: cover; border-radius: .45rem; flex: 0 0 auto; background: #f3f4f6; }
.qa-card .nm { font-weight: 600; font-size: .84rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qa-card .pr { color: #dc2626; font-weight: 700; font-size: .86rem; }
.qa-card .fit { font-size: .7rem; font-weight: 700; color: #fff; background: #16a34a; border-radius: 999px; padding: 0 .45rem; margin-left: .25rem; }
.qa-card .fit.mid { background: #d97706; }
.qa-card .why { font-size: .74rem; color: #15803d; margin-top: .1rem; }
.qa-all { display: block; text-align: center; font-weight: 600; font-size: .84rem; padding: .45rem; border-radius: .6rem; background: #f5f3ff; color: #6d28d9; text-decoration: none; }
.qa-empty { text-align: center; color: #6b7280; font-size: .84rem; padding: .6rem 0; }

.qa-msgs { display: flex; flex-direction: column; gap: .45rem; }
.qa-m { max-width: 88%; padding: .5rem .7rem; border-radius: .9rem; line-height: 1.45; word-wrap: break-word; font-size: .87rem; }
.qa-m.u { align-self: flex-end; background: #7c3aed; color: #fff; border-bottom-right-radius: .25rem; }
.qa-m.a { align-self: flex-start; background: #f3f4f6; border-bottom-left-radius: .25rem; }
.qa-m.a a { color: #6d28d9; font-weight: 600; word-break: break-all; }
.qa-m.err { background: #fef2f2; color: #991b1b; }
.qa-m ul { margin: .2rem 0; padding-left: 1.1rem; }
.qa-typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; margin-right: 3px; animation: qaDot 1s infinite; }
.qa-typing span:nth-child(2) { animation-delay: .15s; } .qa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes qaDot { 0%,80%,100% { opacity: .3; } 40% { opacity: 1; } }
.qa-sugs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.qa-sugs button { border: 1px solid #ddd6fe; background: #faf5ff; color: #6d28d9; border-radius: 999px; padding: .25rem .65rem; font-size: .78rem; }
.qa-input { display: flex; gap: .4rem; padding: .55rem .7rem; border-top: 1px solid #e5e7eb; }
.qa-input[hidden], .qa-note[hidden] { display: none; }
.qa-input input { flex: 1; border: 1px solid #d1d5db; border-radius: 999px; padding: .45rem .8rem; font-size: 16px; min-width: 0; }
.qa-input input:focus { outline: 2px solid #c4b5fd; border-color: #a78bfa; }
.qa-input button { border: 0; width: 40px; height: 40px; border-radius: 50%; background: #7c3aed; color: #fff; flex: 0 0 auto; }
.qa-input button:disabled { opacity: .5; }
.qa-contacts { display: flex; gap: .4rem; padding: .55rem .7rem .7rem; border-top: 1px solid #e5e7eb; background: #fafafa; }
.qa-ct { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .3rem; border-radius: .7rem; color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; white-space: nowrap; }
.qa-ct:hover { color: #fff; filter: brightness(1.07); }
.qa-ct.call { background: linear-gradient(135deg, #16a34a, #22c55e); }
.qa-ct.zalo { background: linear-gradient(135deg, #0a6cff, #27a6ff); }
.qa-ct.zalo b { background: #fff; color: #0a6cff; border-radius: 50%; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
.qa-ct.fb { background: linear-gradient(135deg, #0866ff, #a334fa); }
.qa-note { font-size: .68rem; color: #9ca3af; padding: 0 .8rem .5rem; line-height: 1.3; }

@media (max-width: 576px) {
  .qa-panel { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 88vh; height: 88dvh; border-radius: 1rem 1rem 0 0; }
  .qa-panel:not([hidden]) ~ .qa-btn, body.qa-open .qa-btn { display: none !important; }
  .qa-tip { font-size: .72rem; }
}
