/* ==========================================================================
   Banner "Instalar app" e passo a passo
   ========================================================================== */

.r-pwa {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    width: min(536px, calc(100vw - 24px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 10px;
    background: #fff;
    border: 1px solid var(--r-line);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .14);
    animation: rPwaIn .4s var(--r-ease) both;
}
.r-pwa[hidden] { display: none; }
.r-pwa__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--r-line);
    flex-shrink: 0;
}
.r-pwa__text { flex: 1; min-width: 0; line-height: 1.25; }
.r-pwa__text strong { display: block; font-size: 14px; font-weight: 800; }
.r-pwa__text span { font-size: 12px; color: var(--r-ink-2); }
.r-pwa__btn {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--r-red);
    color: #fff;
    font-family: var(--r-font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}
.r-pwa__btn:hover { background: var(--r-red-dark); }
.r-pwa__close {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--r-ink-3);
    cursor: pointer;
    flex-shrink: 0;
}
.r-pwa__close:hover { background: var(--r-panel); color: var(--r-ink); }
.r-pwa__close svg { width: 16px; height: 16px; }

.r-pwa-sheet {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, .4);
    animation: rFade .2s ease both;
}
.r-pwa-sheet[hidden] { display: none; }
.r-pwa-sheet.is-closing { animation: rFadeOut .22s ease forwards; }
.r-pwa-sheet__box {
    width: 100%;
    max-width: 560px;
    padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 18px 18px 0 0;
    animation: rSheetUp .32s var(--r-ease) both;
}
.r-pwa-sheet.is-closing .r-pwa-sheet__box { animation: rSheetDown .22s ease forwards; }
.r-pwa-sheet__grip {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: var(--r-line-strong);
}
.r-pwa-sheet__head { display: flex; align-items: center; gap: 12px; }
.r-pwa-sheet__head img { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--r-line); }
.r-pwa-sheet__head div { flex: 1; }
.r-pwa-sheet__head strong { display: block; font-size: 16px; font-weight: 800; }
.r-pwa-sheet__head span { font-size: 13px; color: var(--r-ink-2); }

.r-pwa-sheet__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 16px 0 12px;
    padding: 4px;
    border-radius: 10px;
    background: var(--r-panel);
}
.r-pwa-sheet__tabs button {
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-family: var(--r-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--r-ink-2);
    cursor: pointer;
}
.r-pwa-sheet__tabs button.is-active { background: #fff; color: var(--r-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.r-pwa-sheet__steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.r-pwa-sheet__steps li {
    counter-increment: step;
    position: relative;
    padding: 10px 0 10px 38px;
    font-size: 14px;
    line-height: 1.4;
}
.r-pwa-sheet__steps li + li { border-top: 1px solid var(--r-line); }
.r-pwa-sheet__steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--r-red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

@keyframes rPwaIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rFade { from { opacity: 0; } }
@keyframes rFadeOut { to { opacity: 0; } }
@keyframes rSheetUp { from { transform: translateY(100%); } }
@keyframes rSheetDown { to { transform: translateY(100%); } }

body.has-pwa-banner .home-wrap { padding-bottom: 96px; }

body.modal-open .r-pwa, body.r-sidebar-lock .r-pwa { display: none; }
