/* ChatBot Pollo - Widget Flotante */
:root {
  --chat-primary: #c0392b;
  --chat-primary-dark: #a93226;
  --chat-bg: #fff;
}
.pollo-chat-btn {
  position: fixed;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary), #e67e22);
  color: #fff;
  border: none;
  box-shadow: 0 8px 28px rgba(192,57,43,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  z-index: 9999;
  transition: transform .2s, box-shadow .2s;
  animation: pollo-pulse 2.2s infinite;
}
.pollo-chat-btn:hover { transform: scale(1.07); box-shadow: 0 12px 36px rgba(192,57,43,.55); }
.pollo-chat-btn.pos-right { right: 22px; bottom: 22px; }
.pollo-chat-btn.pos-left { left: 22px; bottom: 22px; }
.pollo-chat-btn .badge-notif {
  position: absolute;
  top: -2px; right: -2px;
  background: #f1c40f;
  color: #1a1a2e;
  font-size: 12px;
  font-weight: 800;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.pollo-chat-preview {
  position: fixed;
  max-width: 280px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  font-size: 13px;
  line-height: 1.4;
  z-index: 9998;
  border: 1px solid #f0f0f0;
  cursor: pointer;
  animation: pollo-slideIn .4s ease;
}
.pollo-chat-preview.pos-right { right: 92px; bottom: 28px; }
.pollo-chat-preview.pos-left { left: 92px; bottom: 28px; }
.pollo-chat-preview::after {
  content: '';
  position: absolute;
  bottom: 18px;
  width: 12px; height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 6px rgba(0,0,0,.06);
}
.pollo-chat-preview.pos-right::after { right: -6px; }
.pollo-chat-preview.pos-left::after { left: -6px; }
.pollo-chat-preview .close-preview {
  position: absolute; top: 4px; right: 8px;
  background: none; border: none;
  font-size: 14px; color: #aaa; cursor: pointer;
}

.pollo-chat-window {
  position: fixed;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transform: translateY(20px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: all .28s cubic-bezier(.25,.46,.45,.94);
}
.pollo-chat-window.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.pollo-chat-window.pos-right { right: 22px; bottom: 92px; }
.pollo-chat-window.pos-left { left: 22px; bottom: 92px; }

.pollo-chat-header {
  background: linear-gradient(135deg, var(--chat-primary), #e67e22);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pollo-chat-header .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.pollo-chat-header .avatar img { width: 100%; height: 100%; object-fit: cover; }
.pollo-chat-header .info { flex: 1; min-width: 0; }
.pollo-chat-header .info .title { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; line-height: 1; }
.pollo-chat-header .info .subtitle { font-size: 11px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pollo-chat-header .btn-close-chat {
  background: rgba(255,255,255,.18);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.pollo-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pollo-chat-body::-webkit-scrollbar { width: 6px; }
.pollo-chat-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.msg-row { display: flex; gap: 8px; max-width: 88%; }
.msg-row.bot { align-self: flex-start; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary), #e67e22);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.msg-bubble {
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.msg-row.bot .msg-bubble {
  background: #fff;
  border-radius: 16px 16px 16px 4px;
  color: #333;
  border: 1px solid #eee;
}
.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, var(--chat-primary), #e74c3c);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.msg-time { font-size: 10px; opacity: .6; margin-top: 4px; }

.catalog-block {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
}
.catalog-block .cat-header {
  background: linear-gradient(135deg, #fff8f0, #fff);
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 700;
  font-size: 12px;
  color: var(--chat-primary);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.linea-item { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; }
.linea-item:last-child { border-bottom: none; }
.linea-item .linea-name { font-weight: 700; font-size: 13px; color: #1a1a2e; display:flex; align-items:center; gap:6px; }
.linea-item .linea-desc { font-size: 11px; color: #777; margin: 2px 0 6px; }
.prod-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prod-chip {
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: #444;
  display: flex; align-items: center; gap: 4px;
}
.prod-chip i { color: var(--chat-primary); font-size: 10px; }

.contact-card {
  background: linear-gradient(135deg, #fff, #fff8f0);
  border: 1.5px solid #f1c40f;
  border-radius: 12px;
  padding: 12px;
  margin-top: 4px;
}
.contact-card .contact-name { font-weight: 800; font-size: 13px; color: #1a1a2e; }
.contact-card .contact-row { display: flex; align-items:center; gap:8px; font-size:12px; margin-top:6px; color:#444; }
.contact-card .contact-row i { width:16px; text-align:center; color: var(--chat-primary); }
.btn-wa {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  margin-top: 10px;
  width: 100%;
  transition: background .2s;
}
.btn-wa:hover { background: #1ebe57; color: #fff; }
.btn-outline-pollo {
  display: inline-flex;
  align-items: center; gap:6px;
  border: 1.5px solid var(--chat-primary);
  color: var(--chat-primary);
  background:#fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.btn-outline-pollo:hover { background: var(--chat-primary); color:#fff; }

.quick-replies { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.qr-btn {
  background:#fff;
  border:1.5px solid var(--chat-primary);
  color:var(--chat-primary);
  border-radius:20px;
  padding:6px 12px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition: all .2s;
}
.qr-btn:hover { background: var(--chat-primary); color:#fff; }

.typing { display:flex; gap:4px; padding:8px 12px; }
.typing span { width:6px; height:6px; background:#ccc; border-radius:50%; animation: pollo-bounce .9s infinite alternate; }
.typing span:nth-child(2){ animation-delay:.2s } .typing span:nth-child(3){ animation-delay:.4s }

.pollo-chat-input {
  display:flex;
  gap:8px;
  padding:10px 12px;
  background:#fff;
  border-top:1px solid #eee;
  align-items:center;
}
.pollo-chat-input input {
  flex:1;
  border:1.5px solid #e9ecef;
  border-radius:24px;
  padding:9px 14px;
  font-size:13px;
  outline:none;
}
.pollo-chat-input input:focus { border-color: var(--chat-primary); }
.pollo-chat-input button {
  width:38px; height:38px;
  border-radius:50%;
  background: linear-gradient(135deg, var(--chat-primary), #e67e22);
  color:#fff;
  border:none;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
@keyframes pollo-pulse { 0%,100%{ box-shadow:0 8px 28px rgba(192,57,43,.45)} 50%{ box-shadow:0 8px 36px rgba(192,57,43,.65)} }
@keyframes pollo-bounce { from { transform: translateY(0); opacity:.5 } to { transform: translateY(-4px); opacity:1 } }
@keyframes pollo-slideIn { from { opacity:0; transform: translateY(10px)} to {opacity:1; transform:translateY(0)} }

@media (max-width:480px){
  .pollo-chat-window{ width: calc(100vw - 16px); right:8px !important; left:8px !important; bottom:80px; height:68vh; }
  .pollo-chat-preview{ max-width: calc(100vw - 100px); }
}
