/**
 * pwa.css - Banners de instalação e de atualização da PWA.
 * Carregado tanto pelo base desktop quanto pelo mobile; o posicionamento se ajusta
 * à bottom nav quando ela existe (.mobile-app).
 */

.pwa-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 1080;

    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;

    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Entra deslizando de baixo; a classe .pwa-banner-visivel é adicionada pelo JS. */
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .28s ease;
}

.pwa-banner-visivel {
    transform: translateY(0);
    opacity: 1;
}

/* Acima da bottom nav nos templates mobile. */
.mobile-app .pwa-banner {
    bottom: calc(var(--mobile-nav-height, 64px) + 12px + env(safe-area-inset-bottom, 0px));
}

.pwa-banner-icone {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.14);
    color: #60a5fa;
}

.pwa-banner-icone svg {
    width: 22px;
    height: 22px;
}

.pwa-banner-texto {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-banner-texto strong {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
}

.pwa-banner-texto span {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #94a3b8;
}

.pwa-banner-texto span strong {
    font-size: inherit;
    color: #cbd5e1;
}

/* Ícone de compartilhar embutido na instrução do iOS. */
.pwa-icone-inline {
    width: 15px;
    height: 15px;
    vertical-align: -3px;
    margin: 0 1px;
    color: #60a5fa;
}

.pwa-banner-acoes {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-banner-btn {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease;
}

.pwa-banner-btn:active {
    transform: scale(0.96);
}

.pwa-banner-btn-primaria {
    background: #2563eb;
    color: #fff;
}

.pwa-banner-btn-primaria:active {
    background: #1d4ed8;
}

/* Em telas estreitas o banner empilha, senão os botões espremem o texto. */
@media (max-width: 420px) {
    .pwa-banner {
        flex-wrap: wrap;
    }

    .pwa-banner-acoes {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Em telas largas o banner não precisa ocupar a largura toda. */
@media (min-width: 768px) {
    .pwa-banner {
        left: auto;
        right: 24px;
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        max-width: 460px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-banner {
        transition: opacity .01s linear;
        transform: none;
    }
}
