/* PWA — баннер установки и iOS-инструкция */

.pwa-install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 14px;
    padding-top: 36px;
    background: linear-gradient(135deg, #1a1d24 0%, #22262e 100%);
    border: 1px solid rgba(230, 57, 70, 0.35);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    animation: pwaSlideUp 0.35s ease;
}

@keyframes pwaSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.pwa-install-banner__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.pwa-install-banner__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.pwa-install-banner__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #0f1117;
}

.pwa-install-banner__body {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__title {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: #fff;
}

.pwa-install-banner__text {
    font-size: 0.72rem;
    color: #aaa;
    margin: 0;
    line-height: 1.35;
}

.pwa-install-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install-banner__btn {
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install-banner__btn--primary {
    background: linear-gradient(135deg, #e63946, #c1121f);
    color: #fff;
}

.pwa-install-banner__btn--ghost {
    background: transparent;
    color: #888;
    padding: 4px 8px;
    font-weight: 500;
}

/* iOS modal */
.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.pwa-ios-modal[hidden] { display: none !important; }

.pwa-ios-modal__sheet {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    background: #1a1d24;
    border: 1px solid #2a2f3a;
    border-radius: 20px 20px 16px 16px;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}

.pwa-ios-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pwa-ios-modal__head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.pwa-ios-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #252932;
    color: #aaa;
    cursor: pointer;
    font-size: 1.2rem;
}

.pwa-ios-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: pwa-step;
}

.pwa-ios-steps li {
    counter-increment: pwa-step;
    position: relative;
    padding: 10px 0 10px 36px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #ccc;
    border-bottom: 1px solid #2a2f3a;
}

.pwa-ios-steps li:last-child { border-bottom: none; }

.pwa-ios-steps li::before {
    content: counter(pwa-step);
    position: absolute;
    left: 0;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.2);
    color: #e63946;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-ios-share-icon {
    display: inline-block;
    vertical-align: middle;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .pwa-install-banner {
        left: auto;
        right: 24px;
        bottom: 24px;
        max-width: 380px;
    }
}

@media (display-mode: standalone) {
    .pwa-install-banner { display: none !important; }
}
