/* One Merci Studio — chatbot flotante */

.om-chat { position: fixed; right: 22px; bottom: 22px; z-index: 60; font-family: "Poppins", system-ui, sans-serif; }
.om-chat * { box-sizing: border-box; }

/* burbuja */
.om-burbuja {
  position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--grad, linear-gradient(120deg, #0063F3, #7A3FE0)); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 18px 40px -12px rgba(24, 0, 173, .7), 0 0 0 6px rgba(255, 255, 255, .7);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.om-burbuja:hover { transform: translateY(-3px) scale(1.04); }
.om-burbuja svg { width: 28px; height: 28px; transition: transform .35s, opacity .25s; position: absolute; }
.om-burbuja .ic-cerrar { opacity: 0; transform: rotate(-90deg) scale(.6); }
.om-chat.abierto .om-burbuja .ic-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.om-chat.abierto .om-burbuja .ic-cerrar { opacity: 1; transform: none; }
.om-punto {
  position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: #22C55E; box-shadow: 0 0 0 3px #fff;
}
.om-chat.abierto .om-punto, .om-chat.visto .om-punto { display: none; }

.om-saludo {
  position: absolute; right: 78px; bottom: 8px; width: max-content; max-width: 240px;
  background: #fff; color: #1F2233; font-size: 14px; line-height: 1.45; padding: 12px 16px; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 18px 40px -16px rgba(24, 0, 173, .45), 0 0 0 1px #E1E3EC;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .4s, transform .4s;
}
.om-saludo b { color: #0063F3; }
.om-chat.saludando .om-saludo { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.om-chat.abierto .om-saludo { display: none; }

/* panel */
.om-panel {
  position: absolute; right: 0; bottom: 84px; width: 380px; height: min(620px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(11, 8, 40, .55), 0 0 0 1px rgba(24, 0, 173, .08);
  opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  visibility: hidden; transition: opacity .35s, transform .35s cubic-bezier(.2, .7, .2, 1), visibility .35s;
}
.om-chat.abierto .om-panel { opacity: 1; transform: none; visibility: visible; }

.om-cab {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; color: #fff;
  background: linear-gradient(140deg, #0B3FB5 0%, #1800AD 50%, #6A2FD0 100%);
}
.om-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.om-avatar img { width: 26px; height: auto; }
.om-cab-txt { flex: 1; min-width: 0; }
.om-cab-txt b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.om-cab-txt span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .8; }
.om-cab-txt span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.om-cab-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; transition: background .25s;
}
.om-cab-btn:hover { background: rgba(255, 255, 255, .24); }
.om-cab-btn svg { width: 18px; height: 18px; }

.om-wa {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px 14px;
  font-size: 13.5px; font-weight: 600; color: #128C4A; background: #EAFBF1; text-decoration: none;
  border-bottom: 1px solid #D6F3E2; transition: background .25s;
}
.om-wa:hover { background: #DDF7E8; }
.om-wa svg { width: 18px; height: 18px; }

.om-mensajes { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: #F7F8FB; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.om-msg { max-width: 86%; font-size: 14.5px; line-height: 1.55; padding: 10px 14px; border-radius: 18px; word-wrap: break-word; animation: om-entra .3s ease; }
@keyframes om-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.om-msg.bot { align-self: flex-start; background: #fff; color: #1F2233; border-bottom-left-radius: 6px; box-shadow: 0 0 0 1px #E8EAF2; }
.om-msg.yo { align-self: flex-end; background: linear-gradient(120deg, #0063F3, #7A3FE0); color: #fff; border-bottom-right-radius: 6px; }
.om-msg a { color: #0063F3; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.om-msg.yo a { color: #fff; }
.om-msg ul { margin: 6px 0; padding-left: 18px; }
.om-msg li { margin: 2px 0; }
.om-msg.aviso { align-self: center; max-width: 94%; text-align: center; font-size: 13px; background: #FFF6E5; color: #7A4B00; box-shadow: 0 0 0 1px #FBE3B5; border-radius: 14px; }

.om-escribiendo { display: inline-flex; gap: 4px; padding: 14px 16px; }
.om-escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: #A7B0C8; animation: om-salto 1.2s infinite; }
.om-escribiendo i:nth-child(2) { animation-delay: .15s; }
.om-escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes om-salto { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.om-sugerencias { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 12px; background: #F7F8FB; }
.om-sugerencias button {
  border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: #0063F3;
  background: #fff; padding: 8px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px #D5E1FB; transition: background .2s, box-shadow .2s;
}
.om-sugerencias button:hover { background: #EEF2FF; box-shadow: inset 0 0 0 1.5px #0063F3; }

.om-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid #ECEEF4; background: #fff; }
.om-form textarea {
  flex: 1; resize: none; font: inherit; font-size: 14.5px; line-height: 1.45; color: #1F2233;
  max-height: 110px; min-height: 44px; padding: 11px 14px; border-radius: 14px; border: 1.5px solid #E1E3EC; background: #F7F8FB;
  transition: border-color .2s, background .2s;
}
.om-form textarea:focus { outline: none; border-color: #0063F3; background: #fff; }
.om-enviar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(120deg, #0063F3, #7A3FE0); color: #fff; transition: transform .2s, opacity .2s;
}
.om-enviar:hover { transform: scale(1.06); }
.om-enviar:disabled { opacity: .45; cursor: default; transform: none; }
.om-enviar svg { width: 19px; height: 19px; margin-left: 2px; }
.om-pie { font-size: 11px; color: #9AA0B0; text-align: center; padding: 0 12px 10px; background: #fff; }

@media (max-width: 560px) {
  .om-chat { right: 16px; bottom: 16px; }
  .om-burbuja { width: 58px; height: 58px; }
  .om-panel {
    position: fixed; inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; bottom: 0;
  }
  .om-chat.abierto .om-burbuja { display: none; }
  .om-saludo { right: 70px; max-width: 200px; }
  body.om-chat-abierto { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .om-msg, .om-escribiendo i { animation: none; }
}
