/* Ask for Data — PWA : installation, mises à jour, hors ligne */
.pwa-btn {
    display: inline-flex; align-items: center; gap: 8px; border: 1px solid #E5E7EB; background: #fff;
    color: #1F2937; padding: 9px 16px; border-radius: 10px; font: 600 0.9rem/1.2 Inter, system-ui, sans-serif;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pwa-btn:hover { border-color: #FF8200; color: #FF8200; }
.pwa-btn--primary { background: linear-gradient(135deg, #FF8200, #FF6B00); border-color: transparent; color: #fff; }
.pwa-btn--primary:hover { color: #fff; filter: brightness(1.05); }

/* Toast (installation / nouvelle version) */
.pwa-toast {
    position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 2000;
    transform: translate(-50%, 140%); opacity: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
    width: min(560px, calc(100vw - 24px)); padding: 12px 14px; background: #fff; border-radius: 16px;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .06);
    font: 400 0.9rem/1.4 Inter, system-ui, sans-serif; color: #1F2937;
}
.pwa-toast.show { transform: translate(-50%, 0); opacity: 1; }
.pwa-toast-text { flex: 1 1 260px; display: flex; align-items: center; gap: 12px; }
.pwa-toast-text img { border-radius: 9px; flex-shrink: 0; }
.pwa-toast-text i { color: #009A44; }

/* Guide d'installation iPhone */
.pwa-sheet {
    position: fixed; inset: 0; z-index: 2100; background: rgba(15, 23, 42, .45);
    display: flex; align-items: flex-end; justify-content: center; padding: 12px;
    animation: pwa-fade .2s ease-out;
}
.pwa-sheet-card {
    position: relative; width: min(440px, 100%); background: #fff; border-radius: 20px;
    padding: 24px 22px calc(20px + env(safe-area-inset-bottom)); text-align: center;
    font: 400 0.95rem/1.5 Inter, system-ui, sans-serif; color: #1F2937; animation: pwa-up .3s cubic-bezier(.2,.8,.2,1);
}
.pwa-sheet-card img { border-radius: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.pwa-sheet-card h2 { margin: 12px 0 10px; font-size: 1.2rem; }
.pwa-sheet-card ol { text-align: left; margin: 0 auto; padding-left: 1.3rem; max-width: 330px; }
.pwa-sheet-card li { margin: 6px 0; }
.pwa-sheet-card li i { color: #0A84FF; margin-left: 4px; }
.pwa-sheet-note { margin: 14px 0 0; color: #6B7280; font-size: 0.85rem; }
.pwa-sheet-close {
    position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: #F3F4F6; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #374151;
}
@keyframes pwa-fade { from { opacity: 0; } }
@keyframes pwa-up { from { transform: translateY(40px); opacity: 0; } }

/* Bandeau hors ligne */
.pwa-offline-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 2050; text-align: center;
    padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: #1F2937; color: #fff;
    font: 500 0.82rem/1.3 Inter, system-ui, sans-serif;
}
.pwa-offline-bar i { color: #FBBF24; margin-right: 6px; }

/* Page hors ligne */
.pwa-offline { max-width: 560px; margin: 0 auto; padding: 72px 20px 80px; text-align: center; }
.pwa-offline img { border-radius: 22px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.25); }
.pwa-offline h1 { font-size: 1.6rem; margin: 22px 0 10px; }
.pwa-offline p { color: #4B5563; line-height: 1.6; }
.pwa-offline-note { font-size: 0.9rem; color: #6B7280 !important; }
.pwa-offline-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* En application installée : respect des encoches (iPhone) */
.is-pwa body { padding-top: env(safe-area-inset-top); }

[data-pwa-install][hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .pwa-toast, .pwa-sheet, .pwa-sheet-card { transition: none; animation: none; }
}

/* Boutons d'installation dans le menu mobile et le pied de page (aspect de lien) */
.nav-mobile-install { width: 100%; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; }
.footer-install { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; opacity: .85; }
.footer-install:hover { opacity: 1; text-decoration: underline; }
