/* Buby, asistente de Grupo Berni (pnet-asistente-berni.php). Colores de la web:
   azul #1747d6, azul oscuro #0e2f8f, verde de las burbujas #61ce70. */
.pasis {
  --pasis-azul: #1747d6;
  --pasis-azul-osc: #0e2f8f;
  --pasis-verde: #61ce70;
  --pasis-tinta: #15181f;
  --pasis-fondo: #f4f6fa;
  --pasis-abajo: 160px; /* el script lo ajusta encima del botón de WhatsApp */
  --pasis-derecha: 24px;
  position: fixed;
  right: var(--pasis-derecha);
  bottom: var(--pasis-abajo);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
  pointer-events: none;
}
.pasis > * {
  pointer-events: auto;
}
.pasis[hidden],
.pasis__ventana[hidden],
.pasis__saludo[hidden],
.pasis [hidden] {
  display: none !important;
}
.pasis-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── El personaje ───────────────────────────────────────── */
.pasis .bubi {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pasis .ch-blanco,
.pasis .ch-boca--grande {
  fill: #fff;
}
.pasis .ch-brillo {
  fill: #fff;
  opacity: 0.75;
}
.pasis .ch-burbujita {
  fill: rgb(97 206 112 / 0.85);
  stroke: #fff;
  stroke-width: 1.6;
}
.pasis .ch-ceja,
.pasis .ch-feliz,
.pasis .ch-boca--sonrisa,
.pasis .ch-boca--duda {
  fill: none;
  stroke: #fff;
  stroke-width: 2.8;
  stroke-linecap: round;
}
.pasis .ch-boca--o {
  fill: #0c1322;
  stroke: #fff;
  stroke-width: 2.4;
}
/* Todo gira y escala sobre su propio centro */
.pasis .ch-parpado,
.pasis .ch-feliz,
.pasis .ch-ceja,
.pasis .ch-boca,
.pasis .ch-burbujita {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
}
.pasis .ch-feliz,
.pasis .ch-boca--grande,
.pasis .ch-boca--o,
.pasis .ch-boca--duda {
  opacity: 0;
}
.pasis .ch-boca--grande,
.pasis .ch-boca--o {
  transform: scale(0.4);
}
.pasis .bubi.parpadea .ch-parpado {
  transform: scaleY(0.08);
  transition-duration: 0.08s;
}
/* Feliz y guiño */
.pasis .bubi[data-gesto='feliz'] .ch-parpado,
.pasis .bubi[data-gesto='guino'] .ch-ojo--der .ch-parpado {
  transform: scaleY(0.05);
  opacity: 0;
}
.pasis .bubi[data-gesto='feliz'] .ch-feliz,
.pasis .bubi[data-gesto='guino'] .ch-ojo--der .ch-feliz {
  opacity: 1;
}
.pasis .bubi:is([data-gesto='feliz'], [data-gesto='guino']) .ch-boca--sonrisa {
  opacity: 0;
}
.pasis .bubi:is([data-gesto='feliz'], [data-gesto='guino']) .ch-boca--grande {
  opacity: 1;
  transform: none;
}
.pasis .bubi[data-gesto='feliz'] .ch-ceja {
  transform: translateY(-2.5px);
}
.pasis .bubi[data-gesto='guino'] .ch-ceja--izq {
  transform: translateY(-3px) rotate(-6deg);
}
.pasis .bubi[data-gesto='guino'] .ch-ceja--der {
  transform: translateY(1.5px) rotate(8deg);
}
/* Sorpresa */
.pasis .bubi[data-gesto='sorpresa'] .ch-parpado {
  transform: scale(1.14);
}
.pasis .bubi[data-gesto='sorpresa'] .ch-ceja {
  transform: translateY(-4.5px);
}
.pasis .bubi[data-gesto='sorpresa'] .ch-boca--sonrisa {
  opacity: 0;
}
.pasis .bubi[data-gesto='sorpresa'] .ch-boca--o {
  opacity: 1;
  transform: none;
}
/* Duda */
.pasis .bubi[data-gesto='duda'] .ch-ceja--izq {
  transform: translateY(-4px) rotate(-12deg);
}
.pasis .bubi[data-gesto='duda'] .ch-ceja--der {
  transform: translateY(1.5px) rotate(6deg);
}
.pasis .bubi[data-gesto='duda'] .ch-boca--sonrisa {
  opacity: 0;
}
.pasis .bubi[data-gesto='duda'] .ch-boca--duda {
  opacity: 1;
}
.pasis .bubi.atento:not([data-gesto]) .ch-ceja {
  transform: translateY(-2px);
}
/* Habla */
.pasis .bubi[data-gesto='habla'] .ch-boca--sonrisa {
  opacity: 0;
}
.pasis .bubi[data-gesto='habla'] .ch-boca--o {
  opacity: 1;
  transform: none;
}

/* ── Botón ──────────────────────────────────────────────── */
.pasis .pasis__boton {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  filter: drop-shadow(0 6px 14px rgb(23 71 214 / 0.4));
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pasis__boton:hover,
.pasis__boton:focus-visible {
  transform: scale(1.08);
  background: none;
}
.pasis__boton:focus-visible,
.pasis__cerrar:focus-visible,
.pasis__opciones button:focus-visible,
.pasis__chat a:focus-visible {
  outline: 3px solid var(--pasis-verde);
  outline-offset: 3px;
}
.pasis__personaje {
  display: block;
  width: 100%;
  height: 100%;
}
.pasis__saludo {
  max-width: 220px;
  margin: 0 6px 0 0;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: #fff;
  color: var(--pasis-tinta);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgb(12 19 34 / 0.22);
}

/* ── Ventana ────────────────────────────────────────────── */
.pasis__ventana {
  display: flex;
  flex-direction: column;
  width: min(360px, var(--pasis-ancho, calc(100vw - 32px)));
  max-height: min(560px, calc(100dvh - var(--pasis-abajo) - 110px));
  overflow: hidden;
  border: 1px solid rgb(14 47 143 / 0.12);
  border-radius: 22px;
  background: #fff;
  color: var(--pasis-tinta);
  box-shadow: 0 24px 60px rgb(12 19 34 / 0.28);
  transform-origin: bottom right;
}
.pasis__cabeza {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, var(--pasis-azul), var(--pasis-azul-osc));
  color: #fff;
}
.pasis__cara {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
}
.pasis__nombre {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}
.pasis__cargo {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.3;
  color: #fff;
  opacity: 0.9;
}
.pasis .pasis__cerrar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  cursor: pointer;
}
.pasis__cerrar:hover,
.pasis__cerrar:focus-visible {
  background: rgb(255 255 255 / 0.3);
  color: #fff;
}
.pasis__chat {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.pasis__chat .msj {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}
.pasis__chat .msj p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.pasis__chat .msj p + p,
.pasis__chat .msj p + ul,
.pasis__chat .msj ul + p {
  margin-top: 8px;
}
.pasis__chat .msj--bubi {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: var(--pasis-fondo);
  color: var(--pasis-tinta);
}
.pasis__chat .msj--tu {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--pasis-azul);
  color: #fff;
  font-weight: 600;
}
.pasis__chat a {
  color: var(--pasis-azul);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pasis__chat .pasis__cita {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed rgb(14 47 143 / 0.25);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-style: italic;
}
.pasis__chat .pasis__acciones {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pasis__chat .pasis__accion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--pasis-azul);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.pasis__chat .pasis__accion:hover {
  background: var(--pasis-azul-osc);
  color: #fff;
}
.pasis__chat .pasis__accion--wa {
  background: #127a3a;
}
.pasis__chat .pasis__accion--wa:hover {
  background: #0d5c2b;
}
.pasis__chat .pasis__accion--sec {
  border: 2px solid var(--pasis-azul);
  background: #fff;
  color: var(--pasis-azul);
}
.pasis__chat .pasis__accion--sec:hover {
  background: var(--pasis-fondo);
  color: var(--pasis-azul-osc);
}
.pasis__chat .pasis__lista {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
}
.pasis__chat .pasis__horario {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}
.pasis__chat .escribe {
  display: inline-flex;
  gap: 5px;
  align-self: flex-start;
  padding: 13px 15px;
  border-radius: 16px 16px 16px 4px;
  background: var(--pasis-fondo);
}
.pasis__chat .escribe i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(21 24 31 / 0.45);
}
.pasis__opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgb(14 47 143 / 0.1);
  background: #fff;
}
.pasis__opciones:empty {
  display: none;
}
.pasis__opciones button {
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  border: 1.5px solid var(--pasis-azul);
  border-radius: 999px;
  background: #fff;
  color: var(--pasis-azul);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Hello Elementor pinta de rosa (#c36) los botones con :focus y :hover */
.pasis .pasis__opciones button:focus:not(:focus-visible):not(:hover) {
  background: #fff;
  color: var(--pasis-azul);
}
.pasis .pasis__boton:focus,
.pasis .pasis__boton:hover {
  border: 0;
  background: none;
}
.pasis .pasis__cerrar:focus:not(:focus-visible) {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}
.pasis .pasis__opciones button:hover,
.pasis .pasis__opciones button:focus-visible {
  background: var(--pasis-azul);
  color: #fff;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .pasis {
    --pasis-derecha: 16px;
  }
  .pasis .pasis__boton {
    width: 56px;
    height: 56px;
  }
}

/* ── Movimiento ─────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .pasis__boton {
    animation: pasis-entra 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  }
  .pasis__boton[data-entrado] {
    animation: none;
  }
  .pasis__personaje {
    animation: bubi-flota 3.4s 0.7s ease-in-out infinite;
  }
  .pasis .bubi--boton .ch-burbujita {
    animation: bubi-burbujita 4.2s ease-in-out infinite;
  }
  .pasis__boton[data-cuerpo='salta'] {
    animation: bubi-salta 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .pasis__boton[data-cuerpo='ladea'] {
    animation: bubi-ladea 1.3s ease-in-out;
  }
  .pasis .bubi[data-gesto='habla'] .ch-boca--o {
    animation: bubi-habla 0.32s ease-in-out infinite alternate;
  }
  .pasis__ventana:not([hidden]) {
    animation: pasis-abre 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  }
  .pasis__saludo:not([hidden]) {
    animation: pasis-bocadillo 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .pasis__chat .msj {
    animation: pasis-msj 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .pasis__opciones button {
    animation: pasis-msj 0.4s calc(var(--i, 0) * 0.06s) cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .pasis__chat .escribe i {
    animation: pasis-punto 1s ease-in-out infinite;
  }
  .pasis__chat .escribe i:nth-child(2) {
    animation-delay: 0.15s;
  }
  .pasis__chat .escribe i:nth-child(3) {
    animation-delay: 0.3s;
  }
}
@keyframes pasis-entra {
  from {
    opacity: 0;
    scale: 0.3;
  }
}
@keyframes bubi-flota {
  50% {
    translate: 0 -4px;
  }
}
/* La burbujita sube y vuelve, como si se soltara */
@keyframes bubi-burbujita {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(3px, -5px) scale(0.85);
  }
}
@keyframes bubi-salta {
  0% {
    translate: 0 0;
    scale: 1 1;
  }
  15% {
    translate: 0 2px;
    scale: 1.12 0.88;
  }
  45% {
    translate: 0 -20px;
    scale: 0.92 1.1;
  }
  75% {
    translate: 0 0;
    scale: 1.1 0.9;
  }
  100% {
    translate: 0 0;
    scale: 1 1;
  }
}
@keyframes bubi-ladea {
  25%,
  70% {
    rotate: -14deg;
  }
}
@keyframes bubi-habla {
  from {
    transform: scaleY(0.45);
  }
  to {
    transform: scaleY(1.1);
  }
}
@keyframes pasis-abre {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
}
@keyframes pasis-bocadillo {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.85);
  }
}
@keyframes pasis-msj {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes pasis-punto {
  0%,
  60%,
  100% {
    transform: none;
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ── Buscador ───────────────────────────────────────────── */
.pasis .pasis__buscar {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgb(14 47 143 / 0.1);
  background: var(--pasis-fondo);
}
.pasis .pasis__buscar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid rgb(14 47 143 / 0.25);
  border-radius: 999px;
  background: #fff;
  color: var(--pasis-tinta);
  font: inherit;
  font-size: 16px; /* con menos, el iPhone amplía la página al escribir */
  line-height: 1.2;
  box-shadow: none;
}
.pasis .pasis__buscar input::placeholder {
  color: #5f6673;
  opacity: 1;
}
.pasis .pasis__buscar input:focus {
  border-color: var(--pasis-azul);
  outline: 3px solid rgb(97 206 112 / 0.6);
  outline-offset: 1px;
}
.pasis .pasis__buscar button,
.pasis .pasis__buscar button:hover,
.pasis .pasis__buscar button:focus {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pasis-azul);
  color: #fff;
  cursor: pointer;
}
.pasis .pasis__buscar button:hover {
  background: var(--pasis-azul-osc);
}
.pasis .pasis__buscar button:focus-visible {
  outline: 3px solid var(--pasis-verde);
  outline-offset: 2px;
}

/* ── Móvil: abajo a la izquierda, a la altura de WhatsApp ── */
.pasis.pasis--izq {
  --pasis-abajo: 72px;
  right: auto;
  left: 16px;
  align-items: flex-start;
}
.pasis.pasis--izq .pasis__ventana {
  transform-origin: bottom left;
}
.pasis.pasis--izq .pasis__saludo {
  margin: 0 0 0 6px;
  border-radius: 16px 16px 16px 4px;
}
