/* ═══════════════════════════════════════════════════
   HELADÍN – Asistente Animado GAD Salcedo
   Poses reales recortadas del sprite sheet
═══════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --h-size: 120px;
  --h-z: 88888;
}

/* ── Contenedor ── */
#gad-asistente {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--h-z);   /* 88888 — debajo del FAB PWA (99990) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

/* ════════════════════════════
   BURBUJA DE DIÁLOGO
════════════════════════════ */
.gad-burbuja {
  pointer-events: all;
  background: #fff;
  border: 2.5px solid #0d3272;
  border-radius: 18px 18px 4px 18px;
  padding: 14px 16px 12px;
  max-width: 270px;
  min-width: 210px;
  box-shadow: 0 8px 32px rgba(10,31,68,.2), 0 2px 8px rgba(10,31,68,.1);
  opacity: 0;
  transform: scale(.82) translateY(12px);
  transform-origin: bottom right;
  transition: opacity .35s cubic-bezier(.34,1.56,.64,1),
              transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.gad-burbuja.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
/* Cola de la burbuja */
.gad-burbuja::after {
  content: '';
  position: absolute;
  bottom: -12px;
  right: 18px;
  border: 6px solid transparent;
  border-top-color: #0d3272;
}
.gad-burbuja::before {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 19px;
  border: 5px solid transparent;
  border-top-color: #fff;
  z-index: 1;
}

.gad-burbuja-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.gad-burbuja-nombre {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0d3272;
  display: flex;
  align-items: center;
  gap: 5px;
}
.gad-burbuja-nombre::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
  animation: heladinPulse 2s infinite;
}
@keyframes heladinPulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.gad-close-burbuja {
  background: none;
  border: none;
  color: #bbb;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .2s, transform .2s;
}
.gad-close-burbuja:hover { color: #e00; transform: scale(1.2); }

.gad-texto {
  font-size: 13px;
  color: #1e2d4a;
  line-height: 1.65;
  min-height: 18px;
}
.gad-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  background: #0d3272;
  margin-left: 2px;
  vertical-align: middle;
  animation: gadBlink .65s step-end infinite;
}
@keyframes gadBlink { 0%,100%{opacity:1} 50%{opacity:0} }

.gad-burbuja-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.gad-burbuja-btn {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid #1155b5;
  background: transparent;
  color: #1155b5;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  white-space: nowrap;
}
.gad-burbuja-btn:hover { background: #1155b5; color: #fff; transform: translateY(-1px); }
.gad-burbuja-btn.primary { background: #1155b5; color: #fff; }
.gad-burbuja-btn.primary:hover { background: #0a1f44; }

/* ════════════════════════════
   LA MASCOTA – Heladín
════════════════════════════ */
.gad-mascota-wrap {
  pointer-events: all;
  position: relative;
  width: var(--h-size);
  height: var(--h-size);
  cursor: pointer;
  align-self: flex-end;
  /* Animación de rebote */
  animation: heladinBounce 2.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(10,31,68,.28));
  transition: filter .3s;
}
.gad-mascota-wrap:hover {
  animation: heladinWiggle .45s ease-in-out infinite alternate;
  filter: drop-shadow(0 12px 24px rgba(10,31,68,.38));
}

@keyframes heladinBounce {
  0%,100% { transform: translateY(0) rotate(0deg); }
  30%      { transform: translateY(-10px) rotate(-2deg); }
  60%      { transform: translateY(-4px) rotate(1deg); }
}
@keyframes heladinWiggle {
  from { transform: translateY(-6px) rotate(-4deg) scale(1.06); }
  to   { transform: translateY(-10px) rotate(4deg) scale(1.1); }
}

/* Imagen de la pose actual */
.gad-mascota-img {
  width: var(--h-size);
  height: var(--h-size);
  object-fit: contain;
  object-position: bottom center;
  transition: opacity .25s ease;
  display: block;
}
/* Transición al cambiar de pose */
.gad-mascota-img.cambiando { opacity: 0; transform: scale(.9); }

/* Punto de notificación */
.gad-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 15px;
  height: 15px;
  background: var(--acento, #f0a500);
  border: 2.5px solid #fff;
  border-radius: 50%;
  animation: heladinPulse 1.4s ease-in-out infinite;
  display: none;
}
.gad-notif-dot.visible { display: block; }

/* Sombra en el suelo */
.gad-sombra {
  width: 55px;
  height: 9px;
  background: rgba(10,31,68,.12);
  border-radius: 50%;
  margin: -6px auto 0;
  pointer-events: none;
  animation: sombraH 2.6s ease-in-out infinite;
}
@keyframes sombraH {
  0%,100% { transform: scaleX(1);    opacity: .12; }
  30%      { transform: scaleX(.68); opacity: .06; }
}

/* Animación de entrada de Heladín */
@keyframes heladinEntrada {
  0%   { opacity:0; transform: translateY(60px) scale(.7); }
  60%  { transform: translateY(-8px) scale(1.05); }
  100% { opacity:1; transform: translateY(0) scale(1); }
}
.gad-mascota-wrap.entrando {
  animation: heladinEntrada .7s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* ════════════════════════════
   ESTADO – OCULTO / REAPERTURA
════════════════════════════ */
#gad-asistente.oculto { pointer-events: none; }

.gad-reabrir-btn {
  pointer-events: all;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #0d3272, #2979e8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(10,31,68,.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 88889;  /* debajo del FAB PWA */
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  padding: 0;
}
.gad-reabrir-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 24px rgba(10,31,68,.45);
}
.gad-reabrir-btn img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.gad-reabrir-btn.visible { display: flex; }

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 480px) {
  :root { --h-size: 90px; }
  #gad-asistente { bottom: 14px; right: 14px; }
  .gad-burbuja { max-width: 230px; min-width: 180px; }
  .gad-reabrir-btn { width: 46px; height: 46px; bottom: 14px; right: 14px; }
  .gad-reabrir-btn img { width: 38px; height: 38px; }
}

/* ════════════════════════════
   POSICIÓN IZQUIERDA
════════════════════════════ */
#gad-asistente[data-pos="bottom-left"] {
  right: auto;
  left: 24px;
}
#gad-asistente[data-pos="bottom-left"] .gad-burbuja {
  border-radius: 18px 18px 18px 4px;
}
#gad-asistente[data-pos="bottom-left"] .gad-burbuja::after {
  right: auto; left: 18px;
}
#gad-asistente[data-pos="bottom-left"] .gad-burbuja::before {
  right: auto; left: 19px;
}
