/* Instalación y arranque de la PWA. Usa --c-primario / --c-acento de cada layout. */
.pwa-aviso { position: fixed; z-index: 2000; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: #0f2a2f; color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-user-select: none; user-select: none; }
.pwa-aviso-texto { display: flex; flex-direction: column; gap: 4px; }
.pwa-aviso-texto strong { font-size: 1rem; }
.pwa-aviso-texto span { color: #cfe0e2; }
.pwa-aviso-acc { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.pwa-btn { min-height: 44px; padding: 8px 20px; font: inherit; font-weight: 700; color: #1b1600; background: var(--c-acento, #f5b800); border: 2px solid var(--c-acento, #f5b800); border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.pwa-btn-sec { color: #fff; background: transparent; border-color: #5d7a7f; }
.pwa-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (min-width: 720px) { .pwa-aviso { flex-direction: row; align-items: center; justify-content: space-between; } }

.pwa-arranque { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--c-primario, #0b6e79); color: #fff; font: 700 1.3rem system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; transition: opacity .3s; }
.pwa-arranque.sale { opacity: 0; pointer-events: none; }
.pwa-arranque img { border-radius: 26px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.pwa-arranque-barra { width: min(220px, 60vw); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; margin-top: 8px; }
.pwa-arranque-barra i { display: block; height: 100%; width: 0; background: var(--c-acento, #f5b800); border-radius: 3px; animation: pwa-llena 1.5s ease-out forwards; }
@media (prefers-reduced-motion: no-preference) { .pwa-arranque img { animation: pwa-entra .6s ease-out both; } .pwa-arranque-nombre { animation: pwa-entra .6s .15s ease-out both; } }
@keyframes pwa-entra { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes pwa-llena { from { width: 0; } to { width: 100%; } }

/* Barra fina de carga arriba de la pantalla */
.pwa-barra { position: fixed; z-index: 2500; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .2s; }
.pwa-barra.on { opacity: 1; }
.pwa-barra i { position: absolute; top: 0; bottom: 0; width: 40%; background: var(--c-acento, #f5b800); border-radius: 2px; animation: pwa-barra 1.1s ease-in-out infinite; }
@keyframes pwa-barra { 0% { left: -40%; } 100% { left: 100%; } }

/* Círculo giratorio en botones mientras cargan */
@keyframes gira { to { transform: rotate(360deg); } }
.btn.cargando, .btn-link.cargando { pointer-events: none; opacity: .85; }
.btn.cargando::after, .btn-link.cargando::after { content: ""; flex: none; width: 16px; height: 16px; margin-left: 10px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pwa-barra i { animation: none; left: 0; width: 100%; opacity: .7; } .pwa-arranque-barra i { animation-duration: .01s !important; width: 100%; } .btn.cargando::after, .btn-link.cargando::after { animation-duration: 1.6s; } }
