/* Vita Chat — floating AI shopping assistant
   Brand: AJ For AI light blue + gold. Vita = friendly blue blob. */

#vita-chat-root {
  --vita-blue: #4aa3df;
  --vita-blue-dark: #2f7fc0;
  --vita-gold: #f5b942;
  --vita-ink: #1c2b3a;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating action button */
#vita-chat-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--vita-gold);
  background: linear-gradient(135deg, var(--vita-blue), var(--vita-blue-dark));
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 6px 20px rgba(47, 127, 192, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease;
}
#vita-chat-fab:hover { transform: scale(1.08); }
#vita-chat-fab:active { cursor: grabbing; }

/* Vita blob avatar (pure CSS) */
.vita-blob {
  width: 40px;
  height: 34px;
  background: radial-gradient(circle at 35% 30%, #8ec9f2, var(--vita-blue) 70%);
  border-radius: 48% 52% 55% 45% / 58% 60% 40% 42%;
  position: relative;
  display: inline-block;
}
.vita-face::before,
.vita-face::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 6px;
  height: 8px;
  background: #16324a;
  border-radius: 50%;
}
.vita-face::before { left: 10px; }
.vita-face::after { right: 10px; }
.vita-face {
  position: absolute;
  inset: 0;
}
.vita-face::before { box-shadow: none; }
/* smile */
.vita-blob .vita-face {
  background:
    radial-gradient(ellipse 8px 4px at 50% 72%, transparent 60%, #16324a 61%, #16324a 75%, transparent 76%);
  border-radius: inherit;
}
.vita-blob-sm { width: 34px; height: 30px; }

/* Chat panel */
#vita-chat-panel {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 44px rgba(20, 50, 80, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e3edf5;
}
#vita-chat-panel[hidden] { display: none; }

.vita-header {
  background: linear-gradient(135deg, var(--vita-blue), var(--vita-blue-dark));
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vita-title { flex: 1; line-height: 1.25; }
.vita-title strong { font-size: 16px; }
.vita-title span { display: block; font-size: 12px; opacity: 0.9; }
.vita-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #7CFC9A;
  border-radius: 50%;
  margin-right: 4px;
}
#vita-chat-close {
  background: none; border: none; color: #fff;
  font-size: 26px; cursor: pointer; line-height: 1; padding: 4px 8px;
}

#vita-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7fafd;
}
.vita-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--vita-ink);
  word-wrap: break-word;
}
.vita-msg.bot {
  background: #fff;
  border: 1px solid #e3edf5;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(20, 50, 80, 0.08);
}
.vita-msg.user {
  background: var(--vita-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.vita-typing { font-style: italic; opacity: 0.7; }

/* Product cards */
.vita-card {
  background: #fff;
  border: 1px solid var(--vita-gold);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: stretch;
  box-shadow: 0 2px 8px rgba(245, 185, 66, 0.18);
}
.vita-card img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef3f8;
  flex-shrink: 0;
}
.vita-card-info { flex: 1; min-width: 0; }
.vita-card-name { font-size: 13px; font-weight: 600; color: var(--vita-ink); margin-bottom: 2px; }
.vita-card-price { font-size: 13px; color: var(--vita-blue-dark); font-weight: 700; margin-bottom: 6px; }
.vita-card-price del { color: #999; font-weight: 400; margin-right: 6px; }
.vita-add {
  background: var(--vita-gold);
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #5a3d00;
  cursor: pointer;
  white-space: nowrap;
}
.vita-add:hover { filter: brightness(0.95); }
.vita-add:disabled { opacity: 0.6; cursor: default; }
.vita-view {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--vita-blue-dark);
}

/* Quick replies */
#vita-chat-quick {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #f7fafd;
  border-top: 1px solid #eef2f6;
}
.vita-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--vita-blue);
  background: #fff;
  color: var(--vita-blue-dark);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.vita-chip:hover { background: #e8f3fc; }

/* Input */
#vita-chat-form {
  display: flex;
  border-top: 1px solid #eef2f6;
  padding: 10px;
  gap: 8px;
  background: #fff;
}
#vita-chat-input {
  flex: 1;
  border: 1.5px solid #dbe7f2;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}
#vita-chat-input:focus { border-color: var(--vita-blue); }
#vita-chat-form button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--vita-blue);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.vita-foot {
  font-size: 10.5px;
  color: #8a9bab;
  text-align: center;
  padding: 6px;
  background: #fff;
}

/* Mobile */
@media (max-width: 480px) {
  #vita-chat-root { bottom: 16px; right: 16px; }
  #vita-chat-panel { width: calc(100vw - 32px); bottom: 76px; }
}
