/* FCAR Chatbot — estilos del widget (scoped con .fcar-cb-*) */
#fcar-cb-root {
  --fcar-accent: #e30613;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#fcar-cb-root, #fcar-cb-root * {
  box-sizing: border-box;
  text-shadow: none !important;       /* evita el texto borroso heredado del tema */
  -webkit-text-stroke: 0 !important;
  letter-spacing: normal;
}

.fcar-cb-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 99998;
  border: 0; cursor: pointer; border-radius: 999px;
  background: var(--fcar-accent); color: #fff;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.45);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 15px;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: transform .15s ease, box-shadow .15s ease, padding .2s ease, width .2s ease;
}
.fcar-cb-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -8px rgba(0,0,0,.5); }
.fcar-cb-launcher__icon { display: flex; }
.fcar-cb-launcher__text { white-space: nowrap; }
/* Abierto → se contrae a círculo */
.fcar-cb-launcher.is-open { padding: 0; width: 56px; height: 56px; justify-content: center; }
.fcar-cb-launcher.is-open .fcar-cb-launcher__text { display: none; }

.fcar-cb-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 99999;
  width: 370px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

.fcar-cb-header {
  background: #1f1f1f; color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.fcar-cb-header__bot { display: flex; align-items: center; gap: 10px; }
.fcar-cb-header__bot small { display: block; color: #7ddc8a; font-size: 11px; }
.fcar-cb-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--fcar-accent);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.fcar-cb-header__actions { display: flex; align-items: center; gap: 2px; }
.fcar-cb-restart { background: none; border: 0; color: rgba(255,255,255,.7); font-size: 19px; line-height: 1; cursor: pointer; padding: 4px 6px; }
.fcar-cb-restart:hover { color: #fff; transform: rotate(-45deg); transition: transform .2s; }
.fcar-cb-close { background: none; border: 0; color: rgba(255,255,255,.7); font-size: 26px; line-height: 1; cursor: pointer; }
.fcar-cb-close:hover { color: #fff; }

/* Indicador "escribiendo…" */
.fcar-cb-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.fcar-cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #c2c2c2; animation: fcar-cb-blink 1.2s infinite both; }
.fcar-cb-typing span:nth-child(2) { animation-delay: .2s; }
.fcar-cb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes fcar-cb-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.fcar-cb-msgs {
  flex: 1; overflow-y: auto; padding: 16px;
  background: #f4f5f7; display: flex; flex-direction: column; gap: 10px;
}
.fcar-cb-row { display: flex; }
.fcar-cb-row--bot { justify-content: flex-start; }
.fcar-cb-row--user { justify-content: flex-end; }
.fcar-cb-bubble {
  max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.fcar-cb-bubble--bot { background: #fff; color: #1f1f1f; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.fcar-cb-bubble--user { background: var(--fcar-accent); color: #fff; border-bottom-right-radius: 4px; }
.fcar-cb-link { display: inline-block; margin-top: 6px; color: var(--fcar-accent); font-weight: 700; text-decoration: none; }
.fcar-cb-bubble--bot .fcar-cb-link { color: var(--fcar-accent); }

.fcar-cb-input { padding: 12px; background: #fff; border-top: 1px solid #ececec; }
.fcar-cb-opts { display: flex; flex-direction: column; gap: 8px; }
.fcar-cb-opt {
  text-align: left; background: #fff; border: 1.5px solid var(--fcar-accent);
  color: var(--fcar-accent); font-weight: 600; font-size: 14px;
  padding: 10px 14px; border-radius: 12px; cursor: pointer; transition: background .12s, color .12s;
}
.fcar-cb-opt:hover { background: var(--fcar-accent); color: #fff; }

.fcar-cb-form { display: flex; gap: 8px; }
.fcar-cb-field {
  flex: 1; border: 1.5px solid #d8d8d8; border-radius: 12px; padding: 11px 14px; font-size: 14px; outline: none;
}
.fcar-cb-field:focus { border-color: var(--fcar-accent); }
.fcar-cb-send {
  border: 0; background: var(--fcar-accent); color: #fff; width: 46px; border-radius: 12px;
  font-size: 16px; cursor: pointer;
}
.fcar-cb-flash { margin-top: 8px; color: #c0392b; font-size: 13px; }

@media (max-width: 480px) {
  .fcar-cb-panel { right: 8px; left: 8px; width: auto; bottom: 86px; }
  .fcar-cb-launcher { right: 16px; bottom: 16px; padding: 0; width: 56px; height: 56px; justify-content: center; }
  .fcar-cb-launcher__text { display: none; }
}
