/* ═══════════════════════════════════════════════════════════
   Foodia Electronic Menu — Custom PWA Install Prompt
   Replaces the default browser install banner with a branded,
   animated bottom-sheet (mobile) / card (desktop) prompt.
   ═══════════════════════════════════════════════════════════ */

.pwa-install-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.pwa-install-overlay--show {
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-card {
    position: fixed;
    left: 50%;
    bottom: 16px;
    width: min(380px, calc(100% - 32px));
    transform: translate(-50%, 24px) scale(.97);
    opacity: 0;
    /* Hidden cards must not intercept taps — without this, the invisible card sitting at the
       bottom of the screen blocks clicks on the cart / quantity controls underneath it. */
    pointer-events: none;
    background: var(--card-bg, #fff);
    color: var(--text, #1A1A2E);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    padding: 20px;
    z-index: 2001;
    font-family: var(--font, 'Cairo', sans-serif);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
}

.pwa-install-card--show {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pwa-install-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    flex-shrink: 0;
    background: #f0f0f0;
}

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

.pwa-install-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text, #1A1A2E);
}

.pwa-install-subtitle {
    font-size: 13px;
    color: #777;
    margin: 2px 0 0;
}

.pwa-install-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.pwa-install-benefits {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pwa-install-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text, #1A1A2E);
}

.pwa-install-benefits .pwa-benefit-icon {
    font-size: 16px;
    flex-shrink: 0;
}

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

.pwa-install-btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 11px 0;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.pwa-install-btn:active { transform: scale(.96); }

.pwa-install-btn--primary {
    background: var(--primary, #1B3A8B);
    color: #fff;
}

.pwa-install-btn--secondary {
    background: transparent;
    color: #888;
}

/* iOS instructions panel (no native beforeinstallprompt support on iOS Safari) */
.pwa-ios-steps {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-ios-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}

.pwa-ios-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary, #1B3A8B);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-ios-share-icon { font-size: 16px; }

@media (min-width: 600px) {
    .pwa-install-card {
        bottom: auto;
        top: 24px;
        right: 24px;
        left: auto;
        transform: translateY(-12px) scale(.97);
    }

    .pwa-install-card--show {
        transform: translateY(0) scale(1);
    }
}

/* Update-available banner (used by pwa-register.js) */
.pwa-update-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: #1A1A2E;
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    font-family: var(--font, 'Cairo', sans-serif);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
    z-index: 2100;
    transition: transform .25s ease, opacity .25s ease;
}

.pwa-update-banner--show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-update-btn {
    background: var(--primary, #3D6FE8);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
