/* ============================================================
   HOC BIOSEGURIDAD — hoc-chatbot.css  v2
   HOC-AI · Robot icon · Premium dark UI · bottom-right
   NO CSS VARIABLES — safe for PrestaShop / cPanel
   ============================================================ */

/* ── BUBBLE ─────────────────────────────────────────────── */
#hoc-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0cb0cc 0%, #089ab5 100%);
  border: none;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  z-index: 99990;
  box-shadow: 0 6px 28px rgba(12,176,204,0.55), 0 2px 8px rgba(0,0,0,0.18);
  -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  -webkit-animation: bubble-in 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
  animation: bubble-in 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@-webkit-keyframes bubble-in {
  from { -webkit-transform: scale(0) rotate(-30deg); transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { -webkit-transform: scale(1) rotate(0deg);  transform: scale(1) rotate(0deg);  opacity: 1; }
}
@keyframes bubble-in {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

#hoc-chat-bubble:hover {
  -webkit-transform: scale(1.1) translateY(-2px);
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 40px rgba(12,176,204,0.65), 0 4px 12px rgba(0,0,0,0.2);
}
#hoc-chat-bubble.open {
  background: linear-gradient(135deg, #1a2a2e 0%, #0e1a1c 100%);
  -webkit-transform: scale(1);
  transform: scale(1);
}
#hoc-chat-bubble.open:hover {
  -webkit-transform: scale(1.06) translateY(-2px);
  transform: scale(1.06) translateY(-2px);
}

/* Robot SVG icon */
#hoc-chat-bubble svg {
  width: 30px;
  height: 30px;
  color: #ffffff;
  -webkit-transition: opacity 0.2s, -webkit-transform 0.3s;
  transition: opacity 0.2s, transform 0.3s;
}
.hoc-bubble-icon-close { display: none !important; }
#hoc-chat-bubble.open .hoc-bubble-icon-chat  { display: none !important; }
#hoc-chat-bubble.open .hoc-bubble-icon-close { display: block !important; }
#hoc-chat-bubble.open .hoc-bubble-icon-close {
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}

/* Pulsing ring */
#hoc-chat-bubble::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(12,176,204,0.5);
  -webkit-animation: pulse-ring 2.8s ease-out infinite;
  animation: pulse-ring 2.8s ease-out infinite;
}
@-webkit-keyframes pulse-ring {
  0%   { -webkit-transform: scale(1); transform: scale(1); opacity: 0.9; }
  70%  { -webkit-transform: scale(1.35); transform: scale(1.35); opacity: 0; }
  100% { -webkit-transform: scale(1.35); transform: scale(1.35); opacity: 0; }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.9; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
#hoc-chat-bubble.open::before { display: none; }

/* Second outer glow ring */
#hoc-chat-bubble::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(12,176,204,0.25);
  -webkit-animation: pulse-ring 2.8s ease-out infinite 0.6s;
  animation: pulse-ring 2.8s ease-out infinite 0.6s;
}
#hoc-chat-bubble.open::after { display: none; }

/* Badge */
#hoc-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #EB9797;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  border: 2px solid #ffffff;
  -webkit-animation: badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
  animation: badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 8px rgba(235,151,151,0.5);
}
@-webkit-keyframes badge-pop {
  from { -webkit-transform: scale(0); transform: scale(0); }
  to   { -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── CHAT WINDOW ─────────────────────────────────────────── */
#hoc-chat-window {
  position: fixed;
  bottom: 106px;
  right: 28px;
  width: 390px;
  height: 580px;
  background: #ffffff;
  border: 1px solid rgba(12,176,204,0.22);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(14,26,28,0.3),
    0 8px 24px rgba(12,176,204,0.18),
    0 1px 0 rgba(255,255,255,0.8) inset;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  z-index: 99989;
  overflow: hidden;
  -webkit-transform: scale(0.85) translateY(24px);
  transform: scale(0.85) translateY(24px);
  -webkit-transform-origin: bottom right;
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  -webkit-transition: -webkit-transform 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.28s ease;
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.28s ease;
}
#hoc-chat-window.open {
  -webkit-transform: scale(1) translateY(0);
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ─────────────────────────────────────────────── */
.hoc-chat-header {
  background: linear-gradient(135deg, #0e1a1c 0%, #162428 100%);
  padding: 16px 18px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(12,176,204,0.15);
  position: relative;
  overflow: hidden;
}

/* Subtle circuit-board pattern overlay */
.hoc-chat-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(12,176,204,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12,176,204,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

/* Robot avatar — animated eyes */
.hoc-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0cb0cc 0%, #089ab5 100%);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  position: relative;
  margin-right: 12px;
  box-shadow: 0 4px 16px rgba(12,176,204,0.4);
}

/* Robot face drawn in CSS */
.hoc-chat-avatar-robot {
  position: relative;
  width: 28px;
  height: 28px;
}
/* Robot head */
.hoc-chat-avatar-robot::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 6px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 5px;
}
/* Robot antenna */
.hoc-chat-avatar-robot::after {
  content: '';
  position: absolute;
  top: -4px; left: 50%; 
  width: 3px; height: 6px;
  background: rgba(255,255,255,0.7);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  border-radius: 2px 2px 0 0;
}

/* Eye left */
.hoc-robot-eye-left,
.hoc-robot-eye-right {
  position: absolute;
  width: 5px; height: 5px;
  background: #c9fcff;
  border-radius: 50%;
  top: 9px;
  box-shadow: 0 0 6px #c9fcff;
  -webkit-animation: robot-blink 4s ease-in-out infinite;
  animation: robot-blink 4s ease-in-out infinite;
}
.hoc-robot-eye-left  { left: 6px; }
.hoc-robot-eye-right { right: 6px; -webkit-animation-delay: 0.15s; animation-delay: 0.15s; }

@-webkit-keyframes robot-blink {
  0%,96%,100% { -webkit-transform: scaleY(1); transform: scaleY(1); }
  98%         { -webkit-transform: scaleY(0.1); transform: scaleY(0.1); }
}
@keyframes robot-blink {
  0%,96%,100% { transform: scaleY(1); }
  98%         { transform: scaleY(0.1); }
}

/* Robot mouth */
.hoc-robot-mouth {
  position: absolute;
  bottom: 8px; left: 6px; right: 6px;
  height: 3px;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}

.hoc-chat-status-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0e1a1c;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  -webkit-animation: online-pulse 2.5s ease-in-out infinite;
  animation: online-pulse 2.5s ease-in-out infinite;
}
@-webkit-keyframes online-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(34,197,94,0.6); }
  50%     { box-shadow: 0 0 12px rgba(34,197,94,0.9); }
}
@keyframes online-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(34,197,94,0.6); }
  50%     { box-shadow: 0 0 12px rgba(34,197,94,0.9); }
}

.hoc-chat-header-info { -webkit-flex: 1; flex: 1; }

.hoc-chat-name {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.hoc-chat-ai-badge {
  display: inline-block;
  background: rgba(12,176,204,0.25);
  border: 1px solid rgba(12,176,204,0.4);
  color: #c9fcff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.hoc-chat-status {
  font-size: 11px;
  color: rgba(201,252,255,0.55);
  margin-top: 3px;
}

.hoc-chat-header-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  width: 32px; height: 32px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  -webkit-transition: background 0.2s, color 0.2s, -webkit-transform 0.2s;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  font-size: 17px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  margin-left: 8px;
}
.hoc-chat-header-close:hover {
  background: rgba(235,151,151,0.2);
  border-color: rgba(235,151,151,0.3);
  color: #EB9797;
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
}

/* ── TICKER ─────────────────────────────────────────────── */
.hoc-chat-ticker {
  background: #0e1a1c;
  border-top: 1px solid rgba(12,176,204,0.12);
  border-bottom: 1px solid rgba(12,176,204,0.12);
  padding: 7px 16px;
  font-size: 11px;
  color: rgba(201,252,255,0.6);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  overflow: hidden;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.hoc-chat-ticker-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #EB9797;
  margin-right: 10px;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  border: 1px solid rgba(235,151,151,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(235,151,151,0.08);
}
.hoc-chat-ticker-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #EB9797;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  margin-right: 8px;
  -webkit-animation: pulse-dot 2s infinite;
  animation: pulse-dot 2s infinite;
}
@-webkit-keyframes pulse-dot {
  0%,100% { opacity: 1; -webkit-transform: scale(1); transform: scale(1); }
  50%     { opacity: 0.5; -webkit-transform: scale(1.4); transform: scale(1.4); }
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: 0.5; transform: scale(1.4); }
}
.hoc-chat-ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-transition: opacity 0.4s;
  transition: opacity 0.4s;
}

/* ── MESSAGES ───────────────────────────────────────────── */
.hoc-chat-messages {
  -webkit-flex: 1;
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  background: #f4f7f8;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(12,176,204,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(235,151,151,0.04) 0%, transparent 50%);
  scroll-behavior: smooth;
}
/* Custom scrollbar */
.hoc-chat-messages::-webkit-scrollbar { width: 4px; }
.hoc-chat-messages::-webkit-scrollbar-track { background: transparent; }
.hoc-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(12,176,204,0.25);
  border-radius: 4px;
}

.hoc-msg {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  margin-bottom: 10px;
  -webkit-animation: msg-in 0.35s cubic-bezier(0.34,1.2,0.64,1);
  animation: msg-in 0.35s cubic-bezier(0.34,1.2,0.64,1);
}
@-webkit-keyframes msg-in {
  from { opacity: 0; -webkit-transform: translateY(10px) scale(0.97); transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hoc-msg.user {
  -webkit-flex-direction: row-reverse;
  flex-direction: row-reverse;
}

/* Message avatars */
.hoc-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  font-size: 13px;
  margin-bottom: 2px;
}
.hoc-msg.bot .hoc-msg-avatar {
  background: linear-gradient(135deg, #0cb0cc 0%, #089ab5 100%);
  margin-right: 8px;
  box-shadow: 0 2px 8px rgba(12,176,204,0.35);
}
.hoc-msg.user .hoc-msg-avatar {
  background: linear-gradient(135deg, #EB9797 0%, #c96060 100%);
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(235,151,151,0.35);
}
.hoc-msg-avatar svg { width: 16px; height: 16px; color: #ffffff; }

/* Message bubbles */
.hoc-msg-bubble {
  max-width: 75%;
  padding: 11px 15px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
}
.hoc-msg.bot .hoc-msg-bubble {
  background: #ffffff;
  color: #0e1a1c;
  border: 1px solid rgba(12,176,204,0.18);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 12px rgba(14,26,28,0.06);
}
.hoc-msg.user .hoc-msg-bubble {
  background: linear-gradient(135deg, #0cb0cc 0%, #089ab5 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 16px rgba(12,176,204,0.35);
}

/* Typing indicator */
.hoc-typing .hoc-msg-bubble {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  padding: 14px 18px;
  min-width: 64px;
}
.hoc-typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #0cb0cc;
  margin: 0 3px;
  -webkit-animation: typing-bounce 1.3s ease-in-out infinite;
  animation: typing-bounce 1.3s ease-in-out infinite;
}
.hoc-typing-dot:nth-child(2) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s; }
.hoc-typing-dot:nth-child(3) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s; background: rgba(12,176,204,0.4); }
@-webkit-keyframes typing-bounce {
  0%,60%,100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.5; }
  30%         { -webkit-transform: translateY(-6px); transform: translateY(-6px); opacity: 1; }
}
@keyframes typing-bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.5; }
  30%         { transform: translateY(-6px); opacity: 1; }
}

/* WhatsApp button */
.hoc-chat-wa-btn {
  display: -webkit-inline-flex;
  display: inline-flex;
  -webkit-align-items: center;
  align-items: center;
  background: #25D366;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 100px;
  text-decoration: none;
  margin-top: 10px;
  -webkit-transition: background 0.2s, -webkit-transform 0.2s;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 4px 14px rgba(37,211,102,0.4);
}
.hoc-chat-wa-btn:hover {
  background: #1fb855;
  -webkit-transform: translateY(-1px);
  transform: translateY(-1px);
}
.hoc-chat-wa-btn svg { width: 15px; height: 15px; margin-right: 8px; }

/* Quick reply chips */
.hoc-chat-chips {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-top: 10px;
}
.hoc-chip {
  background: rgba(12,176,204,0.08);
  border: 1px solid rgba(12,176,204,0.3);
  color: #0891a8;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 100px;
  cursor: pointer;
  margin: 4px 4px 0 0;
  -webkit-transition: background 0.2s, border-color 0.2s, -webkit-transform 0.15s;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}
.hoc-chip:hover {
  background: rgba(12,176,204,0.18);
  border-color: #0cb0cc;
  -webkit-transform: translateY(-1px);
  transform: translateY(-1px);
}

/* ── INPUT AREA ─────────────────────────────────────────── */
.hoc-chat-input-wrap {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid rgba(12,176,204,0.12);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: flex-end;
  align-items: flex-end;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
#hoc-chat-input {
  -webkit-flex: 1;
  flex: 1;
  background: #f4f7f8;
  border: 1.5px solid rgba(12,176,204,0.2);
  border-radius: 14px;
  padding: 11px 15px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #0e1a1c;
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 44px;
  line-height: 1.5;
  -webkit-transition: border-color 0.2s, box-shadow 0.2s;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-right: 10px;
}
#hoc-chat-input:focus {
  border-color: #0cb0cc;
  box-shadow: 0 0 0 3px rgba(12,176,204,0.12);
}
#hoc-chat-input::placeholder { color: rgba(74,96,104,0.45); }

#hoc-chat-send {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0cb0cc 0%, #089ab5 100%);
  border: none;
  cursor: pointer;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-transition: background 0.2s, -webkit-transform 0.15s, box-shadow 0.2s;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(12,176,204,0.4);
}
#hoc-chat-send:hover {
  background: linear-gradient(135deg, #0891a8 0%, #077a8f 100%);
  box-shadow: 0 6px 20px rgba(12,176,204,0.5);
}
#hoc-chat-send:active {
  -webkit-transform: scale(0.92);
  transform: scale(0.92);
}
#hoc-chat-send svg { width: 19px; height: 19px; color: white; }

/* ── FOOTER ─────────────────────────────────────────────── */
.hoc-chat-footer {
  padding: 6px 16px 10px;
  font-size: 10.5px;
  color: rgba(74,96,104,0.5);
  text-align: center;
  background: #ffffff;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(12,176,204,0.07);
  letter-spacing: 0.03em;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  #hoc-chat-window {
    width: 100vw;
    height: 88vh;
    bottom: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    -webkit-transform-origin: bottom center;
    transform-origin: bottom center;
  }
  #hoc-chat-bubble {
    bottom: 18px;
    right: 18px;
  }
}