/* =======================================================
   HATI · AI Chatbot Widget
   ======================================================= */
.chatbot {
  position: fixed;
  right: 90px;
  bottom: 20px;
  z-index: 60;
  font-family: var(--f-sans);
}
.chatbot__launcher {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-800));
  color: var(--ink-900);
  padding: 12px 20px 12px 12px;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(212,164,55,.35), inset 0 1px 0 rgba(255,255,255,.4);
  border: 1px solid var(--gold-500);
  transition: all .3s var(--ease);
  cursor: pointer;
}
.chatbot__launcher:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(212,164,55,.45); }
.chatbot__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink-900); color: var(--gold-500);
  display: grid; place-items: center;
  font-family: var(--f-serif); font-weight: 700;
  position: relative;
}
.chatbot__avatar::after {
  content: '';
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--gold-600);
}
.chatbot__launcher-text { display: flex; flex-direction: column; line-height: 1.1; }
.chatbot__launcher-text small { font-size: .7rem; opacity: .75; }
.chatbot__launcher-text strong { font-size: .92rem; font-weight: 700; }

/* Panel */
.chatbot__panel {
  position: fixed;
  right: 20px; bottom: 100px;
  width: min(380px, calc(100vw - 40px));
  height: min(580px, calc(100vh - 140px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  display: none; flex-direction: column;
  overflow: hidden;
  z-index: 65;
  border: 1px solid var(--line);
}
.chatbot.is-open .chatbot__panel { display: flex; animation: popin .25s var(--ease); }
@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.chatbot__head {
  background: linear-gradient(135deg, var(--ink-900), var(--red-800));
  color: var(--gold-400);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--gold-700);
}
.chatbot__head-ava {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--ink-900);
  display: grid; place-items: center;
  font-family: var(--f-serif); font-weight: 700;
}
.chatbot__head-info h5 { margin: 0; font-family: var(--f-serif); color: var(--gold-400); }
.chatbot__head-info span { font-size: .76rem; opacity: .75; display: flex; align-items: center; gap: 6px; }
.chatbot__head-info span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.chatbot__head-close {
  margin-left: auto;
  color: var(--gold-400); opacity: .7;
  background: rgba(255,255,255,.08);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.2rem;
}
.chatbot__head-close:hover { opacity: 1; background: rgba(255,255,255,.14); }

.chatbot__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(212,164,55,.08), transparent 50%),
    var(--cream);
}
.msg { display: flex; gap: 10px; margin-bottom: 16px; animation: slideIn .25s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } }
.msg__ava {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--ink-900);
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; font-family: var(--f-serif);
  flex: 0 0 32px;
}
.msg--me .msg__ava { background: var(--ink-900); color: var(--gold-400); }
.msg__bubble {
  background: #fff;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  max-width: 78%;
  font-size: .92rem;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  color: var(--ink-800);
}
.msg--me { flex-direction: row-reverse; }
.msg--me .msg__bubble {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  color: var(--ink-900); font-weight: 500;
  border-radius: 18px 18px 4px 18px;
}
.msg__bubble b { color: var(--red-700); }
.msg--me .msg__bubble b { color: var(--ink-900); }

.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px 42px; }
.quick-reply {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--gold-600);
  color: var(--ink-900);
  border-radius: 999px;
  font-size: .82rem; font-weight: 500;
  transition: all .2s var(--ease);
}
.quick-reply:hover { background: var(--gold-600); color: var(--ink-900); transform: translateY(-1px); }

.product-card-bot {
  display: flex; gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  margin-top: 6px;
}
.product-card-bot__img {
  width: 70px; height: 70px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-100), var(--champ));
  display: grid; place-items: center;
  flex: 0 0 70px;
}
.product-card-bot__info { flex: 1; font-size: .82rem; }
.product-card-bot__info b { display: block; color: var(--ink-900); margin-bottom: 4px; font-size: .85rem; }
.product-card-bot__price { color: var(--red-700); font-weight: 700; }

.typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-600); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.chatbot__input {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  display: flex; gap: 8px; align-items: center;
}
.chatbot__input input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s var(--ease);
}
.chatbot__input input:focus { border-color: var(--gold-600); background: #fff; }
.chatbot__send {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  color: var(--ink-900);
  display: grid; place-items: center;
  transition: all .2s var(--ease);
}
.chatbot__send:hover { transform: scale(1.08); }
.chatbot__footer-note {
  padding: 6px 14px;
  font-size: .72rem;
  color: var(--ink-500);
  text-align: center;
  background: var(--cream);
  border-top: 1px solid var(--line);
}
.chatbot__footer-note b { color: var(--red-700); }

@media (max-width: 480px) {
  .chatbot { right: 76px; bottom: 16px; }
  .chatbot__launcher-text { display: none; }
  .chatbot__launcher { padding: 10px; }
  .chatbot__panel { right: 10px; bottom: 80px; width: calc(100vw - 20px); height: calc(100vh - 100px); }
}
