/* ============================================================
   chat.css — Widget Eli, asesora virtual Ilios Vounó
   Liquid Glass · Cobre & Bronce
   ============================================================ */

/* Tokens de color cobre/bronce */
:root {
  --copper-main:   #c47843;
  --copper-light:  #e8a882;
  --copper-dark:   #8b4a20;
  --copper-glow:   rgba(196, 120, 67, 0.55);
  --copper-border: rgba(196, 120, 67, 0.22);
  --copper-tint:   rgba(196, 120, 67, 0.08);
}

#eli-chat {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9998;
  font-family: var(--font-body, 'Cormorant Garamond', Georgia, serif);
}

/* ── Toggle button ── */
.eli-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--copper-dark), var(--copper-main), var(--copper-light));
  border: 1px solid rgba(232, 168, 130, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 24px rgba(139, 74, 32, 0.5),
    0 0 0 1px rgba(232, 168, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-left: auto;
}
.eli-toggle:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 36px rgba(196, 120, 67, 0.7),
    0 0 0 1px rgba(232, 168, 130, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.eli-toggle svg {
  width: 26px;
  height: 26px;
  fill: #0f0805;
}

/* ── Panel — Liquid Glass ── */
.eli-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  height: 490px;

  /* Liquid Glass base */
  background: rgba(14, 8, 4, 0.52);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);

  border: 1px solid var(--copper-border);
  border-radius: 18px;

  box-shadow:
    0 12px 56px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(196, 120, 67, 0.06),
    inset 0 1px 0 rgba(232, 168, 130, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.03);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Brillo superior tipo glass */
.eli-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 168, 130, 0.35), transparent);
  pointer-events: none;
  z-index: 1;
}

.eli-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
.eli-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  background: rgba(196, 120, 67, 0.06);
  border-bottom: 1px solid rgba(196, 120, 67, 0.12);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.eli-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--copper-dark), var(--copper-main));
  border: 1px solid rgba(232, 168, 130, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.eli-header-info { flex: 1; min-width: 0; }
.eli-header-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0e8d0;
  letter-spacing: 0.03em;
}
.eli-header-sub {
  font-size: 0.68rem;
  color: rgba(232, 168, 130, 0.55);
  letter-spacing: 0.02em;
  margin-top: 1px;
}
.eli-header-status {
  font-size: 0.7rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.eli-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  flex-shrink: 0;
}
.eli-close-btn {
  background: none;
  border: none;
  color: rgba(232, 168, 130, 0.35);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 17px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.eli-close-btn:hover { color: var(--copper-light); }

/* ── Messages ── */
.eli-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}
.eli-messages::-webkit-scrollbar { width: 3px; }
.eli-messages::-webkit-scrollbar-track { background: transparent; }
.eli-messages::-webkit-scrollbar-thumb {
  background: rgba(196, 120, 67, 0.25);
  border-radius: 2px;
}

/* Bubbles */
.eli-bubble {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 0.8rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}
.eli-bubble--eli {
  background: rgba(196, 120, 67, 0.08);
  border: 1px solid rgba(196, 120, 67, 0.2);
  color: #f0e4d4;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.eli-bubble--user {
  background: rgba(196, 120, 67, 0.16);
  border: 1px solid rgba(196, 120, 67, 0.32);
  color: #f5ece0;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Botón agregar al carrito dentro de burbuja */
.eli-cart-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(196, 120, 67, 0.4);
  background: rgba(196, 120, 67, 0.12);
  color: var(--copper-light);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  width: 100%;
  justify-content: center;
}
.eli-cart-btn:hover {
  background: rgba(196, 120, 67, 0.25);
  border-color: rgba(196, 120, 67, 0.65);
  transform: translateY(-1px);
}
.eli-cart-btn:disabled {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
  cursor: default;
  transform: none;
}

/* Typing indicator */
.eli-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 10px 13px;
  background: rgba(196, 120, 67, 0.06);
  border: 1px solid rgba(196, 120, 67, 0.16);
  border-radius: 13px;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.eli-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(196, 120, 67, 0.75);
  animation: eliDot 1.3s infinite;
}
.eli-typing span:nth-child(2) { animation-delay: 0.2s; }
.eli-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eliDot {
  0%, 60%, 100% { opacity: 0.25; transform: scale(0.8); }
  30%            { opacity: 1;    transform: scale(1.1); }
}

/* ── Input area ── */
.eli-input-area {
  padding: 10px 12px;
  border-top: 1px solid rgba(196, 120, 67, 0.12);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 1;
}
.eli-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 120, 67, 0.18);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 0.8rem;
  color: #f0e4d4;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  min-height: 38px;
  max-height: 80px;
  overflow-y: auto;
}
.eli-input::placeholder { color: rgba(232, 168, 130, 0.28); }
.eli-input:focus { border-color: rgba(196, 120, 67, 0.5); }

.eli-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--copper-dark), var(--copper-main));
  border: 1px solid rgba(232, 168, 130, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(139, 74, 32, 0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.eli-send-btn:hover  {
  opacity: 0.9;
  transform: scale(1.06);
  box-shadow: 0 4px 18px rgba(196, 120, 67, 0.55), inset 0 1px 0 rgba(255,255,255,0.15);
}
.eli-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.eli-send-btn svg {
  width: 15px;
  height: 15px;
  fill: #fff;
}

/* ── Mobile: panel casi full screen ── */
@media (max-width: 480px) {
  #eli-chat {
    right: 12px;
    bottom: 14px;
  }

  .eli-toggle {
    width: 52px;
    height: 52px;
  }

  .eli-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 92svh;
    height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
  }

  #eli-chat {
    position: fixed;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  .eli-panel {
    width: calc(100vw - 32px);
    right: -4px;
    height: 440px;
  }
}
