/* ============================================================
   GENICO TECH SOLUTIONS — CHATBOT WIDGET
   Floating launcher + chat panel with product / about / contact replies
   ============================================================ */

/* ---------- Launcher button ---------- */
.cb-launcher {
  position: fixed; bottom: 26px; right: 26px; z-index: 1000;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 1.6rem; display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(10,42,102,0.4); transition: transform 0.3s;
  animation: cbBounce 3s ease-in-out infinite;
}
.cb-launcher:hover { transform: scale(1.08) rotate(6deg); }
@keyframes cbBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.cb-launcher .cb-dot {
  position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: #00e676; border: 2px solid #fff; animation: blink 1.6s infinite;
}
@keyframes blink { 50% { opacity: 0.4; } }

/* ---------- Chat panel ---------- */
.cb-panel {
  position: fixed; bottom: 100px; right: 26px; z-index: 1000;
  width: 370px; max-width: calc(100vw - 36px); height: 540px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(10,42,102,0.35);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(30px) scale(0.96);
  transform-origin: bottom right; transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  border: 1px solid var(--border);
}
.cb-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* header */
.cb-head { background: var(--grad-dark); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.cb-head .cb-ava { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.15); display: grid; place-items: center; font-size: 1.3rem; }
.cb-head h4 { color: #fff; font-size: 1rem; margin: 0; }
.cb-head small { color: #bcd0f5; font-size: 0.74rem; display: flex; align-items: center; gap: 5px; }
.cb-head small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #00e676; display: inline-block; }
.cb-head .cb-close { margin-left: auto; background: rgba(255,255,255,0.12); border: none; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1rem; transition: background 0.2s; }
.cb-head .cb-close:hover { background: rgba(255,255,255,0.28); }

/* messages */
.cb-body { flex: 1; overflow-y: auto; padding: 18px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 12px; }
.cb-body::-webkit-scrollbar { width: 6px; }
.cb-body::-webkit-scrollbar-thumb { background: #c3d4f0; border-radius: 10px; }

.cb-msg { max-width: 85%; padding: 11px 15px; border-radius: 16px; font-size: 0.88rem; line-height: 1.55; animation: msgIn 0.35s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.cb-msg.bot { background: #fff; color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; align-self: flex-start; box-shadow: 0 2px 8px rgba(10,42,102,0.06); }
.cb-msg.user { background: var(--grad); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.cb-msg strong { color: inherit; }
.cb-msg.bot strong { color: var(--blue-dark); }
.cb-msg .cb-mini-specs { margin-top: 8px; font-size: 0.82rem; }
.cb-msg .cb-mini-specs div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.cb-msg .cb-mini-specs div:last-child { border-bottom: none; }
.cb-msg .cb-mini-specs span:first-child { color: var(--text-soft); }
.cb-msg .cb-prod-img { width: 100%; height: 120px; object-fit: contain; background: var(--bg-soft); border-radius: 10px; margin-bottom: 8px; padding: 6px; }
.cb-msg .cb-detail-link { display: inline-block; margin-top: 10px; background: var(--blue-dark); color: #fff; padding: 7px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.cb-msg .cb-detail-link:hover { background: var(--blue); }
.cb-msg .cb-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cb-msg .cb-contact-actions .cb-detail-link { margin-top: 0; }
.cb-msg .cb-whatsapp-link { background: #128c7e; }
.cb-msg .cb-whatsapp-link:hover { background: #075e54; }

/* typing indicator */
.cb-typing { align-self: flex-start; background: #fff; border: 1px solid var(--border); padding: 12px 16px; border-radius: 16px; border-bottom-left-radius: 5px; display: flex; gap: 4px; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: typing 1.2s infinite; }
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* quick reply chips */
.cb-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 14px; background: #fff; border-top: 1px solid var(--border); }
.cb-quick button {
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--blue-dark);
  padding: 7px 13px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.cb-quick button:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* input */
.cb-input { display: flex; gap: 8px; padding: 12px 14px; background: #fff; border-top: 1px solid var(--border); }
.cb-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 24px; padding: 11px 16px; font-size: 0.88rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cb-input input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,216,0.12); }
.cb-input button { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--grad); color: #fff; cursor: pointer; font-size: 1rem; flex-shrink: 0; transition: transform 0.2s; }
.cb-input button:hover { transform: scale(1.08); }

@media (max-width: 480px) {
  .cb-panel { right: 12px; left: 12px; width: auto; bottom: 90px; }
  .cb-launcher { bottom: 18px; right: 18px; }
}
