/* fabridev-chat.css - Widget del Asistente Comercial FabriDev */
.fabri-chat-toggle {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
  cursor: pointer;
  z-index: 9999;
  border: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fabri-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.55);
}

.fabri-chat-toggle i {
  font-size: 24px;
}

.fabri-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
}

/* Chat Window */
.fabri-chat-window {
  position: fixed;
  bottom: 165px;
  right: 25px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 190px);
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s ease;
}

.fabri-chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.fabri-chat-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fabri-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fabri-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #0d9488;
  object-fit: cover;
}

.fabri-chat-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.fabri-chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #22c55e;
}

.fabri-chat-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

.fabri-chat-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.fabri-chat-close:hover {
  color: #fff;
}

/* Body / Messages */
.fabri-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #090d16;
}

.fabri-msg {
  max-width: 85%;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  border-radius: 14px;
  word-break: break-word;
}

.fabri-msg-bot {
  background: #1e293b;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-self: flex-start;
}

.fabri-msg-bot a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: underline;
}

.fabri-msg-user {
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.fabri-typing {
  font-style: italic;
  color: #94a3b8;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick Options */
.fabri-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.fabri-chip {
  background: rgba(13, 148, 136, 0.15);
  border: 1px solid rgba(13, 148, 136, 0.4);
  color: #2dd4bf;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.fabri-chip:hover {
  background: rgba(13, 148, 136, 0.35);
  color: #fff;
}

/* Footer / Input */
.fabri-chat-footer {
  padding: 12px;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

.fabri-chat-input {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  outline: none;
}

.fabri-chat-input:focus {
  border-color: #0d9488;
}

.fabri-chat-send {
  background: #0d9488;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fabri-chat-send:hover {
  background: #0f766e;
}

/* Welcome Popup Bubble (Apenas entra a la web) */
.fabri-welcome-bubble {
  position: fixed;
  bottom: 165px;
  right: 25px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(13, 148, 136, 0.4);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(13, 148, 136, 0.2);
  z-index: 9998;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px) scale(0.92);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

.fabri-welcome-bubble.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fabri-welcome-bubble:hover {
  border-color: #14b8a6;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.65), 0 0 25px rgba(20, 184, 166, 0.3);
  transform: translateY(-2px) scale(1.01);
}

.fabri-welcome-bubble::after {
  content: "";
  position: absolute;
  bottom: -9px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: #0f172a;
  border-right: 1px solid rgba(13, 148, 136, 0.4);
  border-bottom: 1px solid rgba(13, 148, 136, 0.4);
  transform: rotate(45deg);
}

.fabri-welcome-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
  transition: color 0.2s;
}

.fabri-welcome-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.fabri-welcome-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fabri-welcome-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #0d9488;
  object-fit: cover;
}

.fabri-welcome-author {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.fabri-welcome-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.fabri-welcome-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2dd4bf;
  font-size: 12.5px;
  font-weight: 700;
}
