/* UNIMART PWA — install banner + push opt-in */

.pwa-install {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    padding: 0 0.75rem 0.65rem;
    pointer-events: none;
}

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

.pwa-install__card {
    pointer-events: auto;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(6, 16, 31, 0.96);
    border: 1px solid rgba(246, 139, 30, 0.35);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem;
    align-items: center;
}

.pwa-install__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    overflow: hidden;
}

.pwa-install__logo {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.pwa-install__benefits {
    margin: 0.35rem 0 0;
}

.pwa-benefits-list {
    margin: 0;
    padding: 0 0 0 1rem;
    font-size: 0.72rem;
    color: rgba(243, 246, 251, 0.7);
    line-height: 1.4;
}

.pwa-benefits-list li + li {
    margin-top: 0.15rem;
}

.pwa-install--celebrate .pwa-install__card {
    grid-template-columns: 1fr;
    text-align: center;
}

.pwa-celebrate {
    padding: 0.35rem 0.25rem;
}

.pwa-celebrate__icon {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 auto 0.45rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.pwa-celebrate h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--unimart-bg-muted);
}

.pwa-celebrate p {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: rgba(243, 246, 251, 0.7);
}

/* Soft service-worker update toast */
.unimart-sw-update {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mobile-bottom-nav-height, 70px) + 1rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(120%);
    z-index: 12100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: min(420px, calc(100% - 1.5rem));
    padding: 0.65rem 0.75rem;
    border-radius: 999px;
    background: rgba(6, 16, 31, 0.96);
    border: 1px solid rgba(246, 139, 30, 0.4);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
    color: #f3f6fb;
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.unimart-sw-update.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.unimart-sw-update__text {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.unimart-sw-update__btn {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary, #f68b1e);
    color: #fff;
    cursor: pointer;
}

.unimart-sw-update__dismiss {
    border: none;
    background: transparent;
    color: rgba(243, 246, 251, 0.55);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

@media (min-width: 768px) {
    .unimart-sw-update {
        bottom: 1.25rem;
    }
}

.pwa-install__body {
    min-width: 0;
}

.pwa-install__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--unimart-bg-muted);
}

.pwa-install__desc {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: rgba(243, 246, 251, 0.72);
    line-height: 1.35;
}

.pwa-install__actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pwa-install__btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install__btn--primary {
    background: var(--primary);
    color: #fff;
}

.pwa-install__btn--ghost {
    background: transparent;
    color: rgba(243, 246, 251, 0.55);
}

.pwa-install--ios .pwa-install__card {
    grid-template-columns: auto 1fr;
}

.pwa-install--ios .pwa-install__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .pwa-install {
        bottom: 1rem;
        max-width: 420px;
        left: auto;
        right: 1rem;
        padding: 0;
    }
}

/* Standalone PWA — no browser chrome */
@media (display-mode: standalone) {
    .pwa-install {
        display: none !important;
    }
}

body.pwa-standalone .pwa-install {
    display: none !important;
}

/* PWA push opt-in — shown in standalone when user has not allowed yet */
.pwa-notify {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-bottom-nav-height, 70px) + env(safe-area-inset-bottom, 0px));
    z-index: 1199;
    padding: 0 0.75rem 0.65rem;
    pointer-events: none;
}

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

.pwa-notify__card {
    pointer-events: auto;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(6, 16, 31, 0.96);
    border: 1px solid rgba(246, 139, 30, 0.35);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
}

.pwa-notify__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary));
    border: 1px solid rgba(246, 139, 30, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
    overflow: hidden;
}

.pwa-notify__logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 9px;
    display: block;
}

.pwa-notify__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--unimart-bg-muted);
}

.pwa-notify__desc,
.pwa-notify__hint,
.pwa-notify__denied {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: rgba(243, 246, 251, 0.72);
    line-height: 1.35;
}

.pwa-notify__hint {
    color: rgba(246, 139, 30, 0.9);
}

.pwa-notify__denied {
    color: var(--danger);
}

.pwa-notify__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.pwa-notify__btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.pwa-notify__btn--primary {
    background: var(--primary);
    color: #fff;
}

.pwa-notify__btn--ghost {
    background: transparent;
    color: rgba(243, 246, 251, 0.55);
}

.pwa-notify.is-success .pwa-notify__card {
    border-color: rgba(34, 197, 94, 0.45);
}

@media (min-width: 768px) {
    .pwa-notify {
        bottom: 1rem;
        max-width: 420px;
        left: auto;
        right: 1rem;
        padding: 0;
    }
}

.top-nav-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    color: var(--um-navy, #2c3e50);
    text-decoration: none;
    margin-right: 0.35rem;
}

.top-nav-notif-bell:hover { color: var(--primary); }

.top-nav-notif-bell__badge {
    position: absolute;
    top: -0.15rem;
    right: -0.2rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.top-nav-notif-bell__badge.is-hidden { display: none; }

.um-notif-toast {
    min-width: 280px;
    max-width: 360px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.um-notif-toast__body { font-size: 0.85rem; color: var(--gray); }
.um-notif-toast__actions { padding: 0.35rem 0.75rem 0.65rem; }
.um-notif-toast__cta { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.um-notif-toast-stack { display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.um-notif-toast-stack .toast { pointer-events: auto; }
