/* =========================================================================
   PEPI — MASCOTE + WIDGET DE CHAT
   ========================================================================= */

.pepi-mascot { width: 100%; height: 100%; display: block; overflow: visible; }

.ai-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 84px; height: 84px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 9998;
  padding: 0;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.35));
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-fab:hover { transform: scale(1.08); }
.ai-fab:active { transform: scale(0.95); }

.ai-fab::before {
  content: "";
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, rgba(79,195,247,0.45) 0%, rgba(79,195,247,0) 70%);
  border-radius: 50%;
  animation: pepiGlow 2.5s ease-in-out infinite;
  z-index: -1;
}

.ai-fab .pepi-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  border: 3px solid #0A1628;
  border-radius: 50%;
  animation: pepiBadgePulse 1.5s ease-in-out infinite;
  z-index: 2;
}

.pepi-body-wrap {
  animation: pepiFloat 3.5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.pepi-eye-lid { transform-origin: center; transform: scaleY(0); animation: pepiBlink 4.5s ease-in-out infinite; }
.pepi-eye-lid.left { animation-delay: 0.05s; }

.pepi-pupil { transition: transform 100ms ease-out; }

.pepi-mouth {
  animation: pepiSmile 5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.pepi-shine { animation: pepiShine 3s ease-in-out infinite; transform-origin: center; }

@keyframes pepiFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}

@keyframes pepiGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.12); }
}

@keyframes pepiBlink {
  0%, 92%, 100% { transform: scaleY(0); }
  94%, 98%      { transform: scaleY(1); }
}

@keyframes pepiBadgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.2); opacity: 0.8; }
}

@keyframes pepiSmile {
  0%, 100% { transform: scaleX(1); }
  50%      { transform: scaleX(1.15); }
}

@keyframes pepiShine {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.ai-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(6,16,30,0.6);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 9998;
}
.ai-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.ai-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: linear-gradient(180deg, #0A1628 0%, #06101E 100%);
  border-left: 1px solid rgba(79,195,247,0.20);
  box-shadow: -24px 0 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  transform: translateX(105%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.30, 1);
  z-index: 9999;
}
.ai-drawer.is-open { transform: translateX(0); }

.ai-header {
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(43,150,229,0.18), rgba(43,150,229,0));
  border-bottom: 1px solid rgba(197,214,226,0.10);
  position: relative;
}

.ai-avatar {
  width: 56px; height: 56px;
  position: relative;
  display: grid; place-items: center;
}
.ai-avatar::before {
  content: "";
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(79,195,247,0.30) 0%, transparent 70%);
  border-radius: 50%;
  animation: pepiGlow 2.5s ease-in-out infinite;
}

.ai-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.ai-status {
  margin: 0;
  font-size: 11px;
  color: #4ADE80;
  display: flex; align-items: center; gap: 4px;
}
.ai-status::before {
  content: "";
  width: 6px; height: 6px;
  background: #4ADE80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ADE80;
  animation: pepiBadgePulse 2s ease-in-out infinite;
}

.ai-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(197,214,226,0.15);
  background: rgba(10,22,40,0.6);
  color: #C5D6E2;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 200ms;
}
.ai-close:hover { color: #4FC3F7; border-color: rgba(79,195,247,0.40); }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}

.ai-msg { display: flex; animation: msgIn 300ms cubic-bezier(0.16, 1, 0.30, 1); }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.assistant { justify-content: flex-start; }

.ai-msg .bubble {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.ai-msg.assistant .bubble {
  background: rgba(19,40,74,0.7);
  border: 1px solid rgba(79,195,247,0.18);
  color: #E8EEF4;
  border-bottom-left-radius: 4px;
}
.ai-msg.user .bubble {
  background: linear-gradient(135deg, #5BB8F0, #2B96E5);
  color: #fff; font-weight: 500;
  border-bottom-right-radius: 4px;
}

.ai-msg .bubble a {
  color: #4FC3F7; text-decoration: none; font-weight: 600;
}
.ai-msg .bubble a:hover { text-decoration: underline; }

.ai-msg .bubble .product-hint {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(79,195,247,0.10);
  border: 1px solid rgba(79,195,247,0.30);
  border-radius: 10px;
  color: #4FC3F7;
  text-decoration: none;
  font-size: 13px;
  transition: all 200ms;
}
.ai-msg .bubble .product-hint:hover {
  background: rgba(79,195,247,0.18);
  text-decoration: none;
  transform: translateX(2px);
}
.ai-msg .bubble code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #5BB8F0;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-typing { padding: 12px 16px !important; }
.ai-typing span {
  display: inline-block;
  width: 8px; height: 8px;
  background: #4FC3F7;
  border-radius: 50%;
  margin: 0 2px;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

.ai-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid rgba(197,214,226,0.08);
}
.ai-suggestion-chip {
  padding: 6px 12px;
  background: rgba(79,195,247,0.10);
  border: 1px solid rgba(79,195,247,0.25);
  border-radius: 999px;
  color: #4FC3F7;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms;
}
.ai-suggestion-chip:hover {
  background: rgba(79,195,247,0.20);
  border-color: rgba(79,195,247,0.45);
  transform: translateY(-1px);
}

.ai-input-row {
  display: flex; gap: 8px;
  padding: 12px 16px;
  background: rgba(6,16,30,0.6);
  border-top: 1px solid rgba(197,214,226,0.08);
}
.ai-input {
  flex: 1;
  padding: 11px 14px;
  background: rgba(19,40,74,0.6);
  border: 1px solid rgba(197,214,226,0.18);
  border-radius: 999px;
  color: #E8EEF4;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 200ms;
}
.ai-input::placeholder { color: rgba(127,163,194,0.6); }
.ai-input:focus {
  border-color: #4FC3F7;
  background: rgba(19,40,74,0.9);
  box-shadow: 0 0 0 3px rgba(79,195,247,0.12);
}
.ai-send {
  width: 42px; height: 42px;
  border-radius: 50%; border: none;
  background: linear-gradient(135deg, #5BB8F0, #2B96E5);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: all 200ms;
  box-shadow: 0 4px 12px rgba(43,150,229,0.40);
}
.ai-send:hover { transform: scale(1.08); box-shadow: 0 6px 16px rgba(43,150,229,0.55); }
.ai-send:active { transform: scale(0.95); }

.ai-footer-disclaimer {
  padding: 8px 16px 10px;
  text-align: center;
  font-size: 10px;
  color: rgba(127,163,194,0.7);
  background: rgba(6,16,30,0.4);
}

@media (max-width: 480px) {
  .ai-fab { width: 72px; height: 72px; bottom: 16px; right: 16px; }
}
