/* ==========================================================
   Mobile app-style bottom bar
   ========================================================== */
.appbar { display: none; }
@media (max-width: 989px) {
  :root:has(.appbar) { --appbar-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body:has(.appbar) { padding-bottom: var(--appbar-h); }
  .appbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: stretch; justify-content: space-around;
    height: var(--appbar-h); padding: 0 6px env(safe-area-inset-bottom, 0px);
    background: rgba(var(--c-bg-rgb), .9); color: var(--c-text);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(var(--c-text-rgb), .08);
    box-shadow: 0 -12px 40px rgba(0,0,0,.06);
    transition: transform .5s cubic-bezier(.16, 1, .3, 1);
  }
  body.is-locked .appbar, html.mm-open .appbar { transform: translateY(110%); }
  .appbar__item {
    flex: 1; min-width: 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .appbar__ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 30px; transition: background .4s, color .4s, transform .4s cubic-bezier(.34, 1.56, .64, 1); }
  .appbar__ic .icon { width: 21px; height: 21px; opacity: .62; transition: opacity .3s; }
  .appbar__lb { font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; transition: opacity .3s; }
  .appbar__item.is-active .appbar__ic { background: rgba(var(--c-accent-rgb), .14); color: var(--c-accent); }
  .appbar__item.is-active .appbar__ic .icon { opacity: 1; stroke-width: 2; }
  .appbar__item.is-active .appbar__lb { opacity: 1; color: var(--c-accent); }
  .appbar__item:active .appbar__ic { transform: scale(.88); }
  .appbar__count { position: absolute; top: -3px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px; background: var(--c-accent); color: #fff; font-size: .6rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px rgb(var(--c-bg-rgb)); }
  .appbar__count[hidden] { display: none; }
  :root:has(.appbar--icons) { --appbar-h: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .appbar--icons .appbar__lb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  /* Lift floating buttons above the bar */
  body:has(.appbar) .float-btn--whatsapp { bottom: calc(var(--appbar-h) + 14px); }
  body:has(.appbar) .float-btn--top { bottom: calc(var(--appbar-h) + 76px); }
  body:has(.appbar):not(:has(.float-btn--whatsapp)) .float-btn--top { bottom: calc(var(--appbar-h) + 14px); }
}
