/* PWA install bar — centered floating card (original PC style), install then × */
.vb-pwa-install-bar {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2147483000;
    display: none;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: min(560px, calc(100vw - 24px));
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, #141b2e 0%, #0b1120 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.vb-pwa-install-bar.vb-pwa-install-bar--visible {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.vb-pwa-install-bar__main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.vb-pwa-install-bar__ios-hint {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 214, 160, 0.98);
}

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

:root[data-theme="light"] .vb-pwa-install-bar__ios-hint {
    border-top-color: rgba(0, 0, 0, 0.08);
    color: #9a3412;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .vb-pwa-install-bar__ios-hint {
        border-top-color: rgba(0, 0, 0, 0.08);
        color: #9a3412;
    }
}

.vb-pwa-install-bar__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 138, 0, 0.35);
    background: #1a1d2e;
}

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

.vb-pwa-install-bar__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.vb-pwa-install-bar__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.vb-pwa-install-bar__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

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

.vb-pwa-install-bar__install {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: #ff8a00;
    color: #0b1120;
    white-space: nowrap;
}

.vb-pwa-install-bar__install:hover {
    filter: brightness(1.06);
}

:root[data-theme="light"] .vb-pwa-install-bar {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .vb-pwa-install-bar__title {
    color: #1a1d2e;
}

:root[data-theme="light"] .vb-pwa-install-bar__close {
    border-color: rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
    color: #64748b;
}

/*
 * Auto theme: <html> has no data-theme (theme-toggle.js). Must follow system
 * like color-modes.css — NOT html:not([data-theme="dark"]), which wrongly
 * forced light bar whenever attribute was missing (including system dark).
 */
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .vb-pwa-install-bar {
        background: #fff;
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    }

    :root:not([data-theme]) .vb-pwa-install-bar__title {
        color: #1a1d2e;
    }

    :root:not([data-theme]) .vb-pwa-install-bar__close {
        border-color: rgba(0, 0, 0, 0.1);
        background: #f1f5f9;
        color: #64748b;
    }
}

@media (max-width: 480px) {
    .vb-pwa-install-bar {
        max-width: calc(100vw - 16px);
        padding: 10px 12px;
        gap: 10px;
    }
}

/* Push notifications — tap “চালু করুন” (required on iOS PWA for permission) */
.vb-pwa-push-prompt {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2147483645;
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: min(520px, calc(100vw - 24px));
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(47, 181, 255, 0.35);
    background: linear-gradient(145deg, #0f172a 0%, #0a1024 100%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.vb-pwa-push-prompt.vb-pwa-push-prompt--visible {
    display: flex;
}

.vb-pwa-push-prompt__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(47, 181, 255, 0.4);
}

.vb-pwa-push-prompt__text {
    flex: 1;
    min-width: 140px;
}

.vb-pwa-push-prompt__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.vb-pwa-push-prompt__sub {
    margin: 3px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.35;
}

.vb-pwa-push-prompt__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    width: 100%;
    justify-content: flex-end;
}

@media (min-width: 400px) {
    .vb-pwa-push-prompt__actions {
        width: auto;
        justify-content: flex-start;
    }
}

.vb-pwa-push-prompt__enable {
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: #2fb5ff;
    color: #040b2d;
    white-space: nowrap;
}

.vb-pwa-push-prompt__later {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
}

:root[data-theme="light"] .vb-pwa-push-prompt {
    background: #fff;
    border-color: rgba(0, 102, 204, 0.25);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .vb-pwa-push-prompt__title {
    color: #1a1d2e;
}

:root[data-theme="light"] .vb-pwa-push-prompt__sub {
    color: #64748b;
}

:root[data-theme="light"] .vb-pwa-push-prompt__later {
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .vb-pwa-push-prompt {
        background: #fff;
        border-color: rgba(0, 102, 204, 0.25);
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
    }

    :root:not([data-theme]) .vb-pwa-push-prompt__title {
        color: #1a1d2e;
    }

    :root:not([data-theme]) .vb-pwa-push-prompt__sub {
        color: #64748b;
    }

    :root:not([data-theme]) .vb-pwa-push-prompt__later {
        border-color: rgba(0, 0, 0, 0.12);
        color: #64748b;
    }
}

/*
 * Sit just above the fixed tab bar (~52–56px) + small gap; 108px left a huge empty strip.
 * body.has-vb-mobile-nav uses padding-bottom: 56px + safe-area — align to that + ~8px breathing room.
 */
@media (max-width: 768px) {
    body.has-vb-mobile-nav .vb-pwa-install-bar.vb-pwa-install-bar--visible {
        bottom: max(8px, calc(64px + env(safe-area-inset-bottom, 0px)));
    }

    body.has-vb-mobile-nav .vb-pwa-push-prompt.vb-pwa-push-prompt--visible {
        bottom: max(8px, calc(72px + env(safe-area-inset-bottom, 0px)));
    }
}
