/* PWA: boton de instalacion y aviso de sin conexion.
   Se carga despues de base.css y tambien en seguimiento.html (que no usa base.css ni
   sus variables), por eso los colores van literales en lugar de var(--primary). */

.pwa-instalar {
  position: fixed;
  right: 1rem;
  /* Arriba del aviso de sin conexion, que ocupa el borde inferior completo. */
  bottom: 3.5rem;
  z-index: 1100;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f2600c, #ffb020 160%);
  border-radius: 999px;
  box-shadow: 0 12px 30px -8px rgba(242, 96, 12, 0.6);
  animation: pwa-entra 0.6s linear(0, 0.13 6%, 0.5 14%, 0.86 24%, 1.03 33%, 1.07 40%, 1.04 50%, 0.99 64%, 1) 1.2s both;
  padding: 0.2rem 0.2rem 0.2rem 0.9rem;
}

.pwa-instalar-btn {
  background: none;
  border: none;
  border-radius: 999px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

.pwa-instalar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pwa-instalar-cerrar {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  /* Objetivo tactil de 32px sin que el boton domine la pildora. */
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
}

.pwa-instalar-cerrar:hover {
  background: rgba(255, 255, 255, 0.35);
}

.pwa-offline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  background: #f59e0b;
  color: #1f2937;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

@keyframes pwa-entra { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
/* En movil la pildora sube por encima de la barra de navegacion inferior. */
@media (max-width: 900px) { .pwa-instalar { bottom: calc(5.5rem + env(safe-area-inset-bottom)); } }

/* Instrucciones para instalar desde el menu cuando Chrome no muestra su ventana. */
.pwa-ayuda {
  left: 1rem;
  max-width: 26rem;
  margin-left: auto;
  border-radius: 16px;
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.35;
  gap: 0.5rem;
  padding: 0.6rem 0.4rem 0.6rem 0.9rem;
  animation-delay: 0s;
}
@media (max-width: 900px) { .pwa-instalar { bottom: calc(5.5rem + env(safe-area-inset-bottom)); } }
