/* ─── FLOATING WHATSAPP + CHATBOT (OMS Enterprise) ───
   Adapted from the Amscaler marketing site's chat widget, re-themed to the
   OMS purple/cyan brand. */
.fw-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.fw-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 8px 24px rgba(16,24,40,0.22);
  transition: transform .2s ease, box-shadow .2s ease; text-decoration: none;
}
.fw-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(16,24,40,0.28); }
.fw-btn svg { width: 28px; height: 28px; }
.fw-whatsapp { background: #25d366; }
.fw-whatsapp svg { fill: #fff; }
.fw-chat { background: linear-gradient(120deg, #4F46E5, #06B6D4); position: relative; }
.fw-chat svg { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fw-chat .fw-badge {
  position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #ef4444; border: 2px solid #fff;
}
.fw-tip {
  position: absolute; right: 68px; white-space: nowrap; background: #101828; color: #fff;
  font: 500 13px/1 "Segoe UI", Arial, sans-serif; padding: 8px 12px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.fw-item { position: relative; display: flex; align-items: center; }
.fw-item:hover .fw-tip { opacity: 1; }

/* Chat panel */
.cb-panel {
  position: fixed; right: 20px; bottom: 152px; z-index: 9991;
  width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 180px);
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(16,24,40,0.25);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.cb-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.cb-head {
  background: linear-gradient(120deg, #4F46E5, #06B6D4); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.cb-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
  font-weight: 800; color: #4F46E5; font-size: 14px;
}
.cb-title { flex: 1; min-width: 0; }
.cb-title strong { display: block; font-size: 15px; }
.cb-title span { font-size: 12px; opacity: .9; }
.cb-close {
  background: rgba(255,255,255,.18); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
}
.cb-close:hover { background: rgba(255,255,255,.3); }
.cb-body { flex: 1; overflow-y: auto; padding: 16px; background: #F7F8FC; display: flex; flex-direction: column; gap: 10px; }
.cb-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-line; word-wrap: break-word; }
.cb-msg a { color: inherit; text-decoration: underline; }
.cb-bot { background: #fff; color: #0F1B33; border: 1px solid #E5E7EB; border-bottom-left-radius: 4px; align-self: flex-start; }
.cb-user { background: #4F46E5; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.cb-typing { display: inline-flex; gap: 4px; }
.cb-typing i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: cbDot 1s infinite; }
.cb-typing i:nth-child(2) { animation-delay: .15s; }
.cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cbDot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.cb-chip {
  background: #fff; color: #4F46E5; border: 1px solid #4F46E5;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.cb-chip:hover { background: #EEF2FF; }
.cb-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #E5E7EB; background: #fff; }
.cb-input { flex: 1; border: 1px solid #E5E7EB; border-radius: 999px; padding: 10px 14px; font: 14px "Segoe UI", Arial, sans-serif; outline: none; }
.cb-input:focus { border-color: #4F46E5; }
.cb-send { width: 40px; height: 40px; border-radius: 50%; border: none; background: #4F46E5; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cb-send svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Stay out of the way of the mobile nav panel */
body.nav-locked .fw-stack, body.nav-locked .cb-panel { display: none; }

@media (max-width: 480px) {
  .fw-stack { right: 14px; bottom: 14px; }
  .fw-btn { width: 52px; height: 52px; }
  .cb-panel { right: 16px; left: 16px; width: auto; bottom: 140px; }
  .fw-tip { display: none; }
}
