/* ──────────────────────────────────────────────
   MENDEZ ASSIST — Floating sales chatbot
   Brand: #6abc21 (green) · #035200 (dark green) · #FDFBF7 (cream)
   ────────────────────────────────────────────── */

#mha-bot, #mha-bot * { box-sizing: border-box; }

#mha-bot {
  --mha-green: #6abc21;
  --mha-green-d: #035200;
  --mha-cream: #FDFBF7;
  --mha-dark: #021a00;
  --mha-radius: 16px;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
}

/* ── Floating launcher button (icon-only) ── */
.mha-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  background: linear-gradient(135deg, var(--mha-green-d) 0%, var(--mha-green) 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(106, 188, 33, 0.45), 0 2px 6px rgba(3, 82, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.mha-launcher:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 36px rgba(106, 188, 33, 0.55); }
.mha-launcher .mha-launcher-ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.mha-launcher::after {
  content: '';
  position: absolute; top: 4px; right: 4px;
  width: 12px; height: 12px;
  background: #00e070;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--mha-green-d);
  animation: mha-pulse 1.8s infinite;
}
.mha-launcher.mha-hidden { display: none; }

@keyframes mha-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Proactive bubble ── */
.mha-nudge {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  max-width: 280px;
  background: var(--mha-cream);
  color: var(--mha-dark);
  padding: 12px 14px;
  border-radius: 14px 14px 4px 14px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
  border: 1px solid rgba(106,188,33,0.3);
  cursor: pointer;
  animation: mha-nudge-in 0.4s ease-out both;
}
.mha-nudge .mha-nudge-x {
  position: absolute; top: 4px; right: 6px;
  background: none; border: none; cursor: pointer; padding: 4px;
  color: rgba(0,0,0,0.4); font-size: 14px; line-height: 1;
}
@keyframes mha-nudge-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Panel ── */
.mha-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 48px);
  background: var(--mha-cream);
  border-radius: var(--mha-radius);
  box-shadow: 0 30px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9991;
  animation: mha-pop 0.25s ease-out;
}
.mha-panel.mha-open { display: flex; }
@keyframes mha-pop { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Header */
.mha-header {
  background: linear-gradient(135deg, var(--mha-green-d) 0%, #054d00 100%);
  color: var(--mha-cream);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.mha-header .mha-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--mha-green);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 14px;
  position: relative;
}
.mha-header .mha-avatar::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; background: #00e070; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--mha-green-d);
}
.mha-header .mha-title { font-weight: 800; font-size: 14px; line-height: 1.2; }
.mha-header .mha-sub { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.mha-header .mha-close {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); font-size: 22px; line-height: 1; padding: 4px 8px;
}
.mha-header .mha-close:hover { color: #fff; }

/* Messages */
.mha-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--mha-cream);
}
.mha-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: mha-msg-in 0.2s ease-out;
}
@keyframes mha-msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.mha-msg.user {
  align-self: flex-end;
  background: var(--mha-green-d);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.mha-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: var(--mha-dark);
  border: 1px solid rgba(0,0,0,0.06);
  border-bottom-left-radius: 4px;
}
.mha-msg.system {
  align-self: center;
  background: rgba(106,188,33,0.12);
  color: var(--mha-green-d);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

/* Typing dots */
.mha-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 12px 16px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: inline-flex; gap: 4px;
}
.mha-typing span {
  width: 6px; height: 6px;
  background: var(--mha-green);
  border-radius: 50%;
  animation: mha-bounce 1s infinite;
}
.mha-typing span:nth-child(2) { animation-delay: 0.15s; }
.mha-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mha-bounce { 0%,80%,100% { transform: scale(0.6); opacity: 0.6; } 40% { transform: scale(1); opacity: 1; } }

/* Quick action chips */
.mha-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 0;
  background: var(--mha-cream);
}
.mha-chip {
  background: #fff;
  border: 1px solid rgba(106,188,33,0.4);
  color: var(--mha-green-d);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.mha-chip:hover { background: var(--mha-green); color: #fff; border-color: var(--mha-green); }

/* Lead form */
.mha-leadform {
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.mha-leadform.mha-hidden { display: none; }
.mha-leadform p {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mha-green-d);
}
.mha-leadform input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  color: var(--mha-dark);
}
.mha-leadform input:focus { border-color: var(--mha-green); }
.mha-leadform button {
  background: var(--mha-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mha-leadform button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Composer */
.mha-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.mha-composer input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  color: var(--mha-dark);
}
.mha-composer input:focus { border-color: var(--mha-green); }
.mha-composer button {
  background: var(--mha-green);
  color: #fff;
  border: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.mha-composer button:hover { background: var(--mha-green-d); }
.mha-composer button:disabled { opacity: 0.5; cursor: not-allowed; }

.mha-footer-note {
  text-align: center;
  font-size: 10px;
  color: rgba(0,0,0,0.35);
  padding: 4px 0 8px;
  background: #fff;
}

/* Mobile fullscreen */
@media (max-width: 480px) {
  #mha-bot { bottom: 16px; right: 16px; }
  .mha-panel {
    bottom: 0; right: 0; left: 0; top: 0;
    width: 100%; height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .mha-launcher { padding: 11px 16px 11px 12px; font-size: 12px; }
  .mha-nudge { max-width: 240px; font-size: 12.5px; }
}
