/* ===== Asistente Virtual RENTARTURISMO – chat.css (quirúrgico) ===== */

/* Botón flotante */
#rentarturismo-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #799E36;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 28px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

/* Contenedor principal (visible/oculto) */
#rentarturismo-chat-container {
  position: fixed;
  inset: auto 20px 90px auto;
  z-index: 9999;
}

#rentarturismo-chat-container.hidden {
  display: none;
}


/* Ventana del chat */
#rentarturismo-chat-container .chat-window {
  position: relative;
  width: 360px;
  max-width: 100vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* Cabecera */
#rentarturismo-chat-container .chat-header {
  position: relative;
  /* clave para anclar los botones */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#rentarturismo-chat-container .chat-logo {
  height: 30px;
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

/* Botones de cabecera (papelera, minimizar, cerrar) */
#rentarturismo-chat-container .chat-header button {
  appearance: none;
  background: transparent;
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  line-height: 1;
  font-size: 18px;
  cursor: pointer;
  opacity: .9;
  transition: opacity .2s ease;
  padding: 0;
  margin-left: 6px;
  border-radius: 6px;
}

#rentarturismo-chat-container .chat-header button:hover {
  opacity: 1;
}

/* Cuerpo */
#rentarturismo-chat-container .chat-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  background: #f9f9f9;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Entrada */
#rentarturismo-chat-container .chat-input {
  padding: 10px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: 20px;
}

#rentarturismo-chat-container .chat-input input[type="text"],
#rentarturismo-chat-container .chat-input input[type="email"] {
  width: 85%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 99px;
  outline: none;
}

#rentarturismo-chat-container .chat-input button {
  background: #799E36;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

/* Mensajes */
#rentarturismo-chat-container .chat-message {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 85%;
  line-height: 1.4;
  font-size: 14px;
  word-wrap: break-word;
}

#rentarturismo-chat-container .chat-message.usuario {
  margin-left: auto;
  color: #fff;
  text-align: right;
  background-color: var(--user-color, #fc7e08);
}

#rentarturismo-chat-container .chat-message.asistente {
  margin-right: auto;
  background: #e0e0e0;
  color: #222;
}

/* --------- Contenido Markdown dentro del bubble del asistente --------- */
#rentarturismo-chat-container .chat-message.asistente p {
  margin: 6px 0;
}

#rentarturismo-chat-container .chat-message.asistente ul,
#rentarturismo-chat-container .chat-message.asistente ol {
  margin: 6px 0 6px 18px;
  padding-left: 18px;
  list-style-position: outside;
}

#rentarturismo-chat-container .chat-message.asistente li {
  margin: 4px 0;
}

#rentarturismo-chat-container .chat-message.asistente h1,
#rentarturismo-chat-container .chat-message.asistente h2,
#rentarturismo-chat-container .chat-message.asistente h3,
#rentarturismo-chat-container .chat-message.asistente h4 {
  margin: 8px 0 4px;
  font-weight: 700;
  line-height: 1.2;
}

#rentarturismo-chat-container .chat-message.asistente h1 {
  font-size: 18px;
}

#rentarturismo-chat-container .chat-message.asistente h2 {
  font-size: 17px;
}

#rentarturismo-chat-container .chat-message.asistente h3 {
  font-size: 16px;
}

#rentarturismo-chat-container .chat-message.asistente h4 {
  font-size: 15px;
}

#rentarturismo-chat-container .chat-message.asistente a {
  color: #185abc;
  text-decoration: underline;
}

#rentarturismo-chat-container .chat-message.asistente code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  background: #f3f3f3;
  padding: 1px 4px;
  border-radius: 4px;
}

#rentarturismo-chat-container .chat-message.asistente pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  background: #f3f3f3;
  padding: 8px;
  border-radius: 8px;
  overflow: auto;
  margin: 6px 0;
}

/* === Ajustes móviles === */
@media (max-width: 768px) {

  /* Ventana grande y cómoda */
  #rentarturismo-chat-container .chat-window {
    width: 94vw;
    height: 86vh;
    max-height: none;
    right: 3vw;
    bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 14px;
  }

  /* Cabecera: mayor área táctil y anclaje perfecto */
  #rentarturismo-chat-container .chat-header {
    padding: 12px 14px;
  }

  #rentarturismo-chat-container .chat-header button {
    width: 44px;
    height: 44px;
    font-size: 20px;
    margin-left: 4px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Garantiza que la 'X' se pulse exactamente donde se ve */
  #rentarturismo-chat-container #close-chat {
    position: relative;
    z-index: 2;
  }

  #rentarturismo-chat-container .chat-message {
    max-width: 95%;
  }

  #rentarturismo-chat-container .chat-header span {
    font-size: 14px;
  }
}

/* =========================================================
   BLOQUE AÑADIDO – Mejora de legibilidad y UX (reversible)
   ========================================================= */

/* 1) Tipografía/aire en burbuja del asistente */
#rentarturismo-chat-container .chat-window {
  --rt-line-height: 1.5;
}

#rentarturismo-chat-container .chat-message.asistente {
  line-height: var(--rt-line-height);
}

/* Párrafos con más aire */
#rentarturismo-chat-container .chat-message.asistente p {
  margin: 8px 0;
}

/* 2) Listas: numeración estable y separación (base) */
#rentarturismo-chat-container .chat-message.asistente ol {
  list-style-type: decimal;
  list-style-position: outside;
  margin: 8px 0 10px 1.2em;
  padding-left: 1.2em;
}

#rentarturismo-chat-container .chat-message.asistente ul {
  list-style-position: outside;
  margin: 8px 0 10px 1.2em;
  padding-left: 1.2em;
}

#rentarturismo-chat-container .chat-message.asistente li {
  margin-bottom: 6px;
}

/* 3) Kickoff: “Tu nombre” y “Tu correo” en columna */
#rentarturismo-chat-container .chat-input {
  flex-wrap: wrap;
  align-items: stretch;
}

#chat-name,
#chat-email {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

#rentarturismo-chat-container .chat-input button {
  flex: 0 0 auto;
}

/* === Override fino: reducir sangría de listas en el bubble === */
#rentarturismo-chat-container .chat-message.asistente ol,
#rentarturismo-chat-container .chat-message.asistente ul {
  margin-left: .6em;
  /* antes ~1.2em */
  padding-left: 1em;
  /* antes ~1.2em */
  list-style-position: outside;
}

/* Sublistas más compactas (ol/ul dentro de un li) */
#rentarturismo-chat-container .chat-message.asistente li>ol,
#rentarturismo-chat-container .chat-message.asistente li>ul {
  margin-left: .4em;
  padding-left: .8em;
}

/* Números alineados (si el navegador lo soporta) */
#rentarturismo-chat-container .chat-message.asistente ol li::marker {
  font-variant-numeric: tabular-nums;
}

/* ===== Fin del bloque añadido ===== */


/* Se aplica solo en pantallas típicas de móviles (menores o iguales a 767px) */


/* Modificación de vista para movil, ajusta el tamaño para ocupar toda la pantalla del dispositivo y aprovecharla */

@media (max-width: 767px) {

  /* Contenedor principal (visible/oculto) */
  #rentarturismo-chat-container {
    width: 100vw;
    position: fixed;
    top: 50%;
    left: 50%;
    /* El transform mueve el elemento hacia atrás la mitad de su propio tamaño */
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    /* Centra horizontalmente */
    align-items: center;
    /* Centra verticalmente */
    height: 100dvh;
    /* Ocupa toda la altura de la pantalla */
    width: 100%;
  }


  #rentarturismo-chat-container .chat-window {
    position: initial;
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
    overflow: hidden;
    font-family: Arial, sans-serif;
  }


  /* Evita ese efecto de zoom cuando se accede a una caja de texto, ya sea un input o un textarea */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }

  #bubble-notification {
    max-width: 80vw;
  }
}


#bubble-notification {
  position: fixed;
  inset: auto 20px 90px auto;
  z-index: 9999;
  padding: 10px;
  border-radius: 10px;
  background-color: #fff;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.show {
  display: block;
  animation:
    entrance 0.5s ease forwards,
    pulse .5s infinite alternate
  ;
  cursor: pointer;
  
}

/* Clase para activar la salida */
.hide {
  animation: exit 0.5s ease forwards;
}

@keyframes entrance {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes exit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes pulse {
  0%{
    transform: rotateZ(0deg);
  }

  25%{
    transform: rotateZ(2deg);
  }

  50%{
    transform: rotateZ(-2deg);
  }

  100%{
    transform: rotateZ(0deg);
  }
}