/* Chat propio del sitio (reemplaza al widget "SophIA" de Vambe, 2026-07-26).
   Paleta de marca: rojo #ff0000/negro/blanco, Montserrat + Open Sans. */
#medChat {
  position: fixed; right: 18px; bottom: 92px; z-index: 9950;
  width: 360px; max-width: calc(100vw - 24px); height: min(560px, 78vh);
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: "Open Sans", "Segoe UI", sans-serif;
  opacity: 0; transform: translateY(16px) scale(.97); pointer-events: none;
  transition: opacity .2s ease, transform .22s cubic-bezier(.34,1.56,.64,1);
}
#medChat.abierto { opacity: 1; transform: none; pointer-events: auto; }

#medChat .mc-head { background: linear-gradient(135deg,#ff3030,#c00000); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-family: Montserrat, sans-serif; }
#medChat .mc-head img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: cover; flex: 0 0 auto; }
#medChat .mc-head .mc-tit { flex: 1; min-width: 0; }
#medChat .mc-head .mc-tit b { display: block; font-size: .92rem; }
#medChat .mc-head .mc-tit span { display: block; font-size: .72rem; opacity: .85; }
#medChat .mc-cerrar { background: rgba(255,255,255,.2); border: 0; color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 auto; }
#medChat .mc-cerrar:hover { background: rgba(255,255,255,.35); }

#medChat .mc-gate { flex: 1; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: #faf9f8; overflow-y: auto; }
#medChat .mc-gate-txt { margin: 0 0 4px; font-size: .88rem; color: #333; }
#medChat .mc-gate input { border: 1px solid #ddd; border-radius: 10px; padding: 10px 13px; font-size: .87rem; font-family: inherit; width: 100%; box-sizing: border-box; }
#medChat .mc-gate input:focus { outline: none; border-color: #ff0000; }
#medChat .mc-gate-error { color: #c00000; font-size: .78rem; margin: 0; }
#medChat .mc-gate-btn { background: #ff0000; color: #fff; border: 0; border-radius: 999px; padding: 11px; font-size: .88rem; font-weight: 700; font-family: Montserrat, sans-serif; cursor: pointer; margin-top: 4px; }
#medChat .mc-gate-btn:hover { background: #c00000; }

#medChat .mc-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: #faf9f8; }
#medChat .mc-m { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: .87rem; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
#medChat .mc-bot { align-self: flex-start; background: #fff; border: 1px solid #eee; border-bottom-left-radius: 4px; color: #222; }
#medChat .mc-cliente { align-self: flex-end; background: #ff0000; color: #fff; border-bottom-right-radius: 4px; }
#medChat .mc-m a { color: inherit; text-decoration: underline; }

#medChat .mc-typing { align-self: flex-start; display: flex; gap: 4px; padding: 10px 14px; }
#medChat .mc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #bbb; display: inline-block; animation: mcTyping 1.1s infinite ease-in-out; }
#medChat .mc-typing span:nth-child(2) { animation-delay: .15s; }
#medChat .mc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mcTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

#medChat .mc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; background: #fff; }
#medChat .mc-form input { flex: 1; border: 1px solid #ddd; border-radius: 999px; padding: 9px 14px; font-size: .87rem; font-family: inherit; min-width: 0; }
#medChat .mc-form input:focus { outline: none; border-color: #ff0000; }
#medChat .mc-form button { background: #ff0000; color: #fff; border: 0; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: 0 0 auto; display: grid; place-items: center; }
#medChat .mc-form button:hover { background: #c00000; }
#medChat .mc-form button:disabled { opacity: .5; cursor: default; }

@media (max-width: 575.98px) {
  #medChat { right: 10px; left: 10px; bottom: 82px; width: auto; height: min(72vh, 560px); }
}
