/* ══════════════════════════════════════════════════════
   FAB — Floating Action Button
══════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 800;

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;

  background: linear-gradient(135deg, #d4af37 0%, #a88c26 100%);
  color: #070708;
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  font-weight: 700;

  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(212,175,55,.35);
  cursor: pointer;
  border: none;
  transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
}
.fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(212,175,55,.45);
}
.fab--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.85);
}

.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(212,175,55,.4);
  animation: fabPulse 2.5s infinite;
  pointer-events: none;
}
@keyframes fabPulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ══════════════════════════════════════════════════════
   CHATBOT PANEL
══════════════════════════════════════════════════════ */
.chatbot {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 850;

  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100svh - 40px));

  display: flex;
  flex-direction: column;

  background: #0f1011;
  border: 1px solid rgba(212,175,55,.15);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(212,175,55,.06);

  opacity: 0;
  transform: translateY(20px) scale(.96);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  overflow: hidden;
}
.chatbot.is-open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* Header */
.chatbot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #181a1b;
  border-bottom: 1px solid rgba(212,175,55,.1);
  flex-shrink: 0;
}
.chatbot__headinfo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chatbot__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #a88c26);
  color: #070708;
  font-weight: 900;
  font-size: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chatbot__logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(212,175,55,0.4));
}
.chatbot__head strong {
  display: block;
  font-size: 15px;
  color: #f5f5f5;
}
.chatbot__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #22c55e;
}
.chatbot__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #222426;
  color: #8a8e96;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  transition: color .2s, background .2s;
}
.chatbot__close:hover { background: #2e3032; color: #f5f5f5; }

/* Messages area */
.chatbot__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chatbot__body::-webkit-scrollbar { width: 4px; }
.chatbot__body::-webkit-scrollbar-track { background: transparent; }
.chatbot__body::-webkit-scrollbar-thumb { background: rgba(212,175,55,.2); border-radius: 4px; }

/* Message bubbles */
.chat-msg {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: msgPop .25s ease;
}
@keyframes msgPop {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: none; }
}
.chat-msg--bot {
  background: #222426;
  border: 1px solid rgba(212,175,55,.1);
  color: #f5f5f5;
  align-self: flex-start;
  border-radius: 4px 16px 16px 16px;
}
.chat-msg--user {
  background: linear-gradient(135deg, #d4af37, #a88c26);
  color: #070708;
  font-weight: 600;
  align-self: flex-end;
  border-radius: 16px 4px 16px 16px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 15px;
  background: #222426;
  border: 1px solid rgba(212,175,55,.1);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
  align-self: flex-start;
}
.chat-typing span {
  width: 6px; height: 6px;
  background: #8a8e96;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* Quick replies */
.chatbot__quick {
  padding: 0 16px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chatbot__quick[hidden] { display: none; }
.qr-btn {
  border: 1px solid #d4af37;
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #d4af37;
  background: rgba(212,175,55,.07);
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  transition: background .2s;
}
.qr-btn:hover { background: rgba(212,175,55,.15); }

/* Input form */
.chatbot__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(212,175,55,.1);
  background: #181a1b;
  flex-shrink: 0;
}
.chatbot__input {
  flex: 1;
  background: #222426;
  border: 1px solid rgba(212,175,55,.15);
  border-radius: 12px;
  padding: 10px 14px;
  color: #f5f5f5;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  direction: rtl;
}
.chatbot__input:focus { border-color: #d4af37; }
.chatbot__input::placeholder { color: #555; }
.chatbot__send {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d4af37, #a88c26);
  color: #070708;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: filter .2s, transform .2s;
}
.chatbot__send:hover { filter: brightness(1.1); transform: scale(1.05); }
.chatbot__send:disabled { opacity: .5; cursor: default; transform: none; }

/* Legal link */
.chatbot__legal {
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: #555;
  flex-shrink: 0;
}
.chatbot__legal a { color: #d4af37; }

/* Mobile: full-screen panel */
@media (max-width: 440px) {
  .chatbot {
    bottom: 0; left: 0;
    width: 100%;
    height: 100svh;
    border-radius: 0;
  }
  .fab { bottom: 20px; left: 16px; }
}
