/* ═══════════════════════════════════════════════════════════════════════════
   Deli Chat — Bubble flotante para Go Deli (web.html)
   Paleta: púrpura #7C3AED / naranja #FF6B35 / blanco / grises
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bubble button (esquina inferior derecha) ── */
.deli-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}
.deli-toggle-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  padding: 0;
}
.deli-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(124,58,237,0.45);
}
.deli-toggle-btn img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.deli-badge {
  position: absolute; top: -2px; right: -2px;
  background: #FF6B35; color: #fff;
  font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Chat panel ── */
.deli-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  animation: deliSlideUp 0.25s ease-out;
}
@keyframes deliSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.deli-header {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.deli-header img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}
.deli-header-info { flex: 1; }
.deli-name {
  font-size: 15px; font-weight: 800;
}
.deli-status {
  font-size: 11px; opacity: 0.75;
}
.deli-close-btn {
  background: none; border: none;
  color: #fff; font-size: 22px;
  cursor: pointer; opacity: 0.8;
  padding: 4px 8px; line-height: 1;
}
.deli-close-btn:hover { opacity: 1; }

/* ── Messages ── */
.deli-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  background: #F8F4FF;
  scroll-behavior: smooth;
}
.deli-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: deliFadeIn 0.2s ease-out;
}
@keyframes deliFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.deli-msg-user {
  align-self: flex-end;
  background: #7C3AED;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.deli-msg-assistant {
  align-self: flex-start;
  background: #fff;
  color: #1A1A2E;
  border: 1px solid #E5E0F0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.deli-msg-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #E5E0F0;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  display: flex; gap: 4px; align-items: center;
}
.deli-typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #C4B5E0;
  animation: deliBounce 1.2s infinite;
}
.deli-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.deli-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes deliBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Suggestions chips ── */
.deli-suggestions {
  padding: 8px 16px;
  display: flex; flex-wrap: wrap;
  gap: 6px;
  background: #fff;
  border-top: 1px solid #F0ECF8;
  flex-shrink: 0;
  overflow-x: auto;
}
.deli-chip {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid #D8CCF0;
  background: #F8F4FF;
  color: #7C3AED;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.deli-chip:hover {
  background: #EDE4FF;
  border-color: #B89EF5;
}

/* ── Input area ── */
.deli-input-area {
  display: flex; gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid #E5E0F0;
  flex-shrink: 0;
}
.deli-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #E5E0F0;
  border-radius: 20px;
  font-size: 14px; outline: none;
  background: #F8F4FF;
  transition: border-color 0.15s;
}
.deli-input-area input:focus {
  border-color: #7C3AED;
}
.deli-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff; font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.deli-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(124,58,237,0.3);
}
.deli-send-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
  transform: none;
}

/* ── Responsive: mobile ── */
@media (max-width: 480px) {
  .deli-panel {
    width: calc(100vw - 16px);
    right: 8px; bottom: 80px;
    height: calc(100vh - 160px);
    max-height: none;
    border-radius: 20px 20px 8px 8px;
  }
  .deli-bubble { bottom: 16px; right: 16px; }
}

/* ── Product/Store cards ── */
.deli-cards {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px 0;
  scroll-behavior: smooth;
}
.deli-card {
  min-width: 140px; max-width: 140px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E5E0F0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  overflow: hidden;
  flex-shrink: 0;
}
.deli-card-img {
  width: 100%; height: 80px;
  background: #F8F4FF;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.deli-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.deli-card-emoji {
  font-size: 32px;
}
.deli-card-info {
  padding: 6px 8px;
}
.deli-card-name {
  font-size: 11px; font-weight: 700;
  color: #1A1A2E;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.deli-card-price {
  font-size: 12px; font-weight: 900;
  color: #FF6B35;
  display: block; margin-top: 2px;
}
.deli-card-store {
  font-size: 10px; color: #6B7280;
  display: block; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deli-card-rating {
  font-size: 10px; font-weight: 700; color: #1A1A2E;
  display: block; margin-top: 1px;
}
