/* ── NovaShop storefront live chat ───────────────────────────────────── */

.nova-live-chat {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 20px;
  z-index: 1088;
  font-size: 0.9rem;
  pointer-events: none;
}

.nova-live-chat * {
  pointer-events: auto;
}

@media (max-width: 767.98px) {
  .nova-live-chat {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 12px;
  }
}

.nova-live-chat__fab {
  position: relative;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1e293b 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nova-live-chat__fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
}

.nova-live-chat__fab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.nova-live-chat__fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-secondary);
  opacity: 0;
  animation: nova-live-chat-pulse 2.5s ease-out infinite;
}

@keyframes nova-live-chat-pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.nova-live-chat--open .nova-live-chat__fab-pulse {
  display: none;
}

.nova-live-chat__panel {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100dvh - 160px));
  max-height: calc(100dvh - 160px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1088;
  pointer-events: auto;
}

.nova-live-chat--open .nova-live-chat__panel {
  display: flex !important;
  animation: nova-live-chat-slide 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767.98px) {
  .nova-live-chat__panel {
    inset-inline-end: 12px;
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    height: min(520px, calc(100dvh - 200px));
    max-height: calc(100dvh - 200px);
  }
}

@keyframes nova-live-chat-slide {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nova-live-chat__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #334155 100%);
  color: #fff;
}

.nova-live-chat__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}

.nova-live-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nova-live-chat__meta {
  flex: 1;
  min-width: 0;
}

.nova-live-chat__title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nova-live-chat__status {
  font-size: 0.72rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nova-live-chat__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

.nova-live-chat--closed-hours .nova-live-chat__dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25);
}

.nova-live-chat__minimize {
  color: #fff !important;
  opacity: 0.85;
  border: none;
  background: rgba(255, 255, 255, 0.1) !important;
}

.nova-live-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}

.nova-live-chat__bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.nova-live-chat__bubble--bot,
.nova-live-chat__bubble--agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-end-start-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.nova-live-chat__bubble--agent {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.nova-live-chat__bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a5f 100%);
  color: #fff;
  border-end-end-radius: 4px;
}

.nova-live-chat__bubble--typing {
  align-self: flex-start;
  padding: 0.75rem 1rem;
}

.nova-live-chat__typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: #94a3b8;
  animation: nova-live-chat-dot 1.2s infinite ease-in-out;
}

.nova-live-chat__typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.nova-live-chat__typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes nova-live-chat-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.nova-live-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.75rem 0.5rem;
}

.nova-live-chat__chip {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nova-live-chat__chip:hover {
  border-color: var(--color-secondary);
  background: rgba(212, 175, 55, 0.08);
}

.nova-live-chat__composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.nova-live-chat__composer .form-control {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  font-size: 0.88rem;
}

.nova-live-chat__composer .form-control:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.nova-live-chat__send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-secondary) !important;
  border: none !important;
  color: var(--color-primary) !important;
}

.nova-live-chat__send:disabled {
  opacity: 0.5;
}

.nova-live-chat--open .nova-live-chat__fab-icon--open { display: none !important; }
.nova-live-chat--open .nova-live-chat__fab-icon--close { display: block !important; }

.nova-live-chat--agent .nova-live-chat__header {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%) !important;
}

.nova-live-chat__agent-panel {
  padding: 0.5rem 0.75rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #f8fafc;
}

.nova-live-chat__agent-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.nova-live-chat__agent-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.nova-live-chat__agent-btn:hover {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.06);
  color: #0f766e;
}

.nova-live-chat__agent-btn .bi-whatsapp {
  color: #25d366;
  font-size: 1.1rem;
}
