/* ══════════════════════════════════════════════════════════════
   mybusinezz — PWA chrome
   Install card, offline bar, update toast and app-mode tweaks.
   Loaded on every page after style.css.
   ══════════════════════════════════════════════════════════════ */

:root {
    --mybz-navy: #0D406B;
    --mybz-orange: #EC650B;
}

/* ─── Installed-app mode ─────────────────────────────────────
   Respect the notch / gesture bar so content is never clipped. */
html.app-mode body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* No text selection drag or tap highlight — reads as native. */
html.app-mode {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior-y: contain;
}

/* Inputs and anything explicitly marked stay selectable. */
html.app-mode input,
html.app-mode textarea,
html.app-mode [contenteditable],
html.app-mode .selectable {
    -webkit-user-select: text;
    user-select: text;
}

/* Hide anything that only makes sense on the public website. */
html.app-mode .website-only {
    display: none !important;
}

/* ─── Install card ───────────────────────────────────────────── */
.mybz-install {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 99999;

    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;

    background: #fff;
    border: 1px solid rgba(13, 64, 107, 0.14);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(13, 64, 107, 0.22);

    font-family: inherit;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s ease, transform .25s ease;
}

.mybz-install.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mybz-install img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex-shrink: 0;
}

.mybz-install__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.mybz-install__text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--mybz-navy);
}

.mybz-install__text span {
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
}

.mybz-install__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.mybz-install__actions button {
    font: inherit;
    cursor: pointer;
    border: 0;
    border-radius: 9px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.mybz-install__actions button[data-act="install"] {
    background: var(--mybz-orange);
    color: #fff;
}

.mybz-install__actions button[data-act="later"] {
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
    padding: 4px 16px;
}

/* ─── Offline bar ────────────────────────────────────────────── */
.mybz-offline-bar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100000;

    padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
    background: #b91c1c;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    letter-spacing: .2px;

    transform: translateY(-100%);
    transition: transform .3s ease;
}

.mybz-offline-bar.is-visible {
    transform: translateY(0);
}

/* ─── Update toast ───────────────────────────────────────────── */
.mybz-toast {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 100000;

    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(92vw, 460px);
    padding: 12px 14px 12px 18px;

    background: var(--mybz-navy);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
    font-size: 13px;

    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity .25s ease, transform .25s ease;
}

.mybz-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.mybz-toast button {
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    padding: 7px 15px;
    background: var(--mybz-orange);
    color: #fff;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .mybz-install,
    .mybz-offline-bar,
    .mybz-toast {
        transition: none;
    }
}
