/* EL CHOLAITO DE LA PORTADA (14-nov-2026): el compañero de abajo a la izquierda.
 * El dibujo y lo que hace están en js/cholaito.js. Va debajo del menú (z 40) y del botón
 * de WhatsApp (z 35), que está a la derecha. */

.cholaito {
  position: fixed; left: 8px; bottom: 4px; z-index: 34; width: 96px;
  pointer-events: none; transition: transform .4s cubic-bezier(.3, 1.3, .5, 1), opacity .3s;
}
.cholaito > * { pointer-events: auto; }
.ch-mueve { position: relative; transform-origin: 50% 92%; will-change: transform; }
.cholaito.espera .ch-mueve { transform: translateX(-240px); }
.ch-toque {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; border-radius: 30px;
}
.ch-fig, .ch-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-dibujo { overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.ch-sombra {
  position: absolute; left: 14%; right: 14%; bottom: 0; height: 9px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); filter: blur(3px); pointer-events: none !important; transition: opacity .25s;
}

/* el globo de lo que dice */
.ch-globo {
  position: absolute; left: 80%; bottom: 78%; width: max-content; max-width: min(260px, calc(100vw - 104px));
  background: #fff; color: var(--tinta, #1b1512); border: 2.5px solid var(--tinta, #1b1512);
  border-radius: 18px 18px 18px 4px; padding: 11px 36px 12px 14px;
  font-size: 15px; line-height: 1.35; font-weight: 600; text-align: left;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .45); transform-origin: 0 100%;
}
.ch-globo[hidden] { display: none; }
.ch-globo.entra { animation: ch-globo .38s cubic-bezier(.3, 1.6, .5, 1); }
.ch-globo.sale { animation: ch-globo-sale .22s ease forwards; }
@keyframes ch-globo { from { transform: scale(.4) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ch-globo-sale { to { transform: scale(.7) translateY(6px); opacity: 0; } }
.ch-globo-x {
  position: absolute; top: 3px; right: 3px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: none; color: #8a7d72; font-size: 22px; line-height: 1; display: grid; place-items: center;
}
.ch-globo-x:hover { background: #f1ebe3; color: var(--tinta, #1b1512); }
.ch-globo-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ch-globo-acciones:empty { display: none; }
.ch-globo-boton {
  background: var(--rojo, #ed0c0d); color: #fff; text-decoration: none; border-radius: 999px;
  padding: 8px 15px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.ch-globo-boton:hover { background: #ff1d1e; }

/* la X para esconderlo: aparece al pasar el mouse; en el celular se ve siempre, discreta */
.ch-ocultar {
  position: absolute; top: 4px; left: -4px; width: 26px; height: 26px; padding: 5px; border-radius: 50%;
  background: rgba(10, 10, 10, .78); color: #fff; border: 1.5px solid rgba(255, 255, 255, .45);
  opacity: 0; transition: opacity .2s;
}
.ch-ocultar::before { content: ""; position: absolute; inset: -9px; } /* el dedo necesita más que 26 px */
.ch-ocultar svg { width: 100%; height: 100%; }
.cholaito:hover .ch-ocultar, .ch-ocultar:focus-visible { opacity: 1; }
@media (hover: none) { .ch-ocultar { opacity: .7; } }

.cholaito.escondido { transform: translateX(-170%); opacity: 0; }
.cholaito.escondido > * { pointer-events: none; }

/* escondido: se asoma desde el borde, y tocándolo vuelve */
.cholaito-volver {
  position: fixed; left: -22px; bottom: 10px; z-index: 34; width: 56px; padding: 0; border: 0; background: none;
  transform: translateX(-130%) rotate(18deg); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
  -webkit-tap-highlight-color: transparent;
}
.cholaito-volver svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.cholaito-volver.ve { transform: translateX(0) rotate(18deg); }
.cholaito-volver.ve:hover { transform: translateX(12px) rotate(8deg); }

@media (min-width: 901px) {
  .cholaito { width: 124px; left: 14px; bottom: 8px; }
  .ch-globo { font-size: 16px; max-width: 290px; }
}
@media (max-width: 900px) {
  /* con el teclado abierto se agacha para no tapar lo que escribes */
  .cholaito.agachado { transform: translateY(88%); opacity: .4; }
}
@media (max-width: 380px) {
  .cholaito { width: 84px; }
  .ch-globo { font-size: 14px; }
}
@media print { .cholaito, .cholaito-volver { display: none !important; } }
