/* app-shell.css — mobile app-style bottom navigation.
   Injected only on pages that include app-shell.js. Mobile-only (matches the site's existing
   900px breakpoint from mobile-fixes.css); desktop is untouched. Loaded AFTER mobile-fixes.css
   so its rules win the cascade without needing to out-specificity that file's !important floats.
*/

#spfAppNav { display: none; }

@media (max-width: 900px) {
  body.spf-app-shell {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  #spfAppNav {
    display: flex;
    position: fixed;
    /* top:auto is load-bearing, not decorative: several pages define a bare `nav{top:0}` rule
       (tag selector, applies to every <nav> including this one). CSS cascades per-property, not
       per-rule, so without an explicit override here, that top:0 stacks with this block's own
       bottom:0 and stretches #spfAppNav to fill the full viewport height instead of pinning it to
       a slim bottom bar - confirmed live via Playwright on index.html/campaigns.html/
       become-volunteer.html (2026-08-23). */
    top: auto; left: 0; right: 0; bottom: 0;
    height: auto;
    z-index: 9999;
    background: #0A0A0A;
    border-top: 1px solid #262626;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(0,0,0,.25);
  }

  #spfAppNav a, #spfAppNav button {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 2px 6px;
    background: none;
    border: none;
    color: #9a9a9a;
    font-size: .64rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    min-height: 52px;
  }

  #spfAppNav i { font-size: 1.1rem; }

  #spfAppNav .spf-nav-active { color: #FF6B35; }

  #spfAppNav .spf-nav-donate i {
    background: linear-gradient(135deg,#FF6B35,#e55a24);
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem;
    margin-top: -14px;
    box-shadow: 0 4px 10px rgba(255,107,53,.45);
  }
  #spfAppNav .spf-nav-donate.spf-nav-active i { color: #fff; }

  /* The bottom nav already surfaces Donate + AI Chat, so the legacy floating action buttons
     would duplicate those two CTAs right above it. Hide them only where the bottom nav is
     present — same selectors mobile-fixes.css already uses for this exact button set, so this
     doesn't fight that file's cascade, it just adds one more page in front of it. */
  body.spf-app-shell #spfChatBtn,
  body.spf-app-shell .fab-wrap .fab-donate,
  body.spf-app-shell .float-donate,
  body.spf-app-shell div[style*="z-index:900"] a[href*="donate.html"] {
    display: none !important;
  }
}
