/* ==========================================================================
   PWA — install banner + strip contestuale post-N visite
   ========================================================================== */

.pwa-install-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: none;
    padding: 14px 20px;
    background: linear-gradient(180deg, #1a1a22 0%, #111118 100%);
    color: #e5e7eb;
    border-top: 1px solid rgba(224, 32, 32, 0.45);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
    font-size: 0.9rem;
}

.pwa-install-banner.show {
    display: block;
}

.pwa-install-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

.pwa-install-banner-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(224, 32, 32, 0.14);
    color: #f87171;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.pwa-install-banner p {
    margin: 0;
    flex: 1 1 260px;
    line-height: 1.45;
}

.pwa-install-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pwa-install-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.pwa-install-btn.primary {
    background: #e02020;
    color: #fff;
}

.pwa-install-btn.primary:hover {
    background: #c81a1a;
}

.pwa-install-btn.secondary {
    background: transparent;
    color: #cbd5e1;
    border-color: #4b5563;
}

.pwa-install-btn.secondary:hover {
    border-color: #9ca3af;
    color: #fff;
}

.pwa-context-strip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99997;
    display: none;
    background: linear-gradient(90deg, #fff7ed 0%, #fff 55%, #fef2f2 100%);
    color: #7c2d12;
    border-top: 1px solid #fed7aa;
    box-shadow: 0 -4px 14px rgba(124, 45, 18, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pwa-context-strip.show {
    display: block;
}

.pwa-context-strip__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}

.pwa-context-strip__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(224, 32, 32, 0.1);
    color: #e02020;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-context-strip__copy {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 600;
}

.pwa-context-strip__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-context-strip__cta,
.pwa-context-strip__dismiss {
    border: 0;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 12px;
}

.pwa-context-strip__cta {
    background: #e02020;
    color: #fff;
}

.pwa-context-strip__cta:hover {
    background: #c81a1a;
}

.pwa-context-strip__dismiss {
    background: transparent;
    color: #9a3412;
    padding: 7px 8px;
}

.pwa-context-strip__dismiss:hover {
    color: #7c2d12;
}

body.pwa-context-strip-visible {
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px));
}

body.pwa-context-strip-visible:has(.cookie-banner.show),
body.pwa-context-strip-visible:has(.cookie-preferences-panel.show) {
    padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px));
}

body:has(.cookie-banner.show) .pwa-context-strip.show,
body:has(.cookie-preferences-panel.show) .pwa-context-strip.show {
    bottom: 72px;
}

body:has(.cookie-banner.show) .pwa-install-banner.show,
body:has(.cookie-preferences-panel.show) .pwa-install-banner.show {
    bottom: 72px;
}

body.pwa-context-strip-visible:has(.pwa-install-banner.show) .pwa-install-banner.show {
    bottom: calc(54px + env(safe-area-inset-bottom, 0px));
}

body.pwa-context-strip-visible:has(.cookie-banner.show) .pwa-install-banner.show,
body.pwa-context-strip-visible:has(.cookie-preferences-panel.show) .pwa-install-banner.show {
    bottom: calc(126px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767px) {
    .pwa-context-strip__inner {
        flex-wrap: wrap;
        padding: 10px 12px;
    }

    .pwa-context-strip__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pwa-install-actions {
        width: 100%;
    }

    .pwa-install-btn {
        flex: 1 1 calc(50% - 4px);
    }
}