/**
 * Story 160 — shell mobile (bottom nav + breakpoint 768px).
 * Tokens: ElevaCash (#2563EB, #F7F8FA, Inter, radius 12/8).
 */

:root {
  --mobile-nav-h: 64px;
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Desktop / tablet largo: bottom nav oculto */
#app-mobile-nav.mobile-nav {
  display: none;
}

#topbar-privacy-toggle {
  display: none;
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .app-sidebar {
    display: none !important;
  }

  .app-shell__column {
    min-width: 0;
    padding-bottom: calc(var(--mobile-nav-h) + var(--mobile-safe-bottom) + 0.5rem);
  }

  .app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .app-topbar__actions .btn:not(#topbar-privacy-toggle):not(#topbar-help),
  .app-topbar .app-nav-overflow {
    display: none !important;
  }

  #topbar-privacy-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem;
    opacity: 0.9;
    cursor: pointer;
  }

  #topbar-privacy-toggle.is-pressed,
  #topbar-privacy-toggle[aria-pressed="true"] {
    opacity: 1;
    color: var(--color-primary, #2563eb);
  }

  .app-topbar__help {
    display: none;
  }

  #app-mobile-nav.mobile-nav {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    grid-template-columns: 1fr 1fr 56px 1fr 1fr;
    align-items: flex-start;
    height: calc(var(--mobile-nav-h) + var(--mobile-safe-bottom));
    padding: 0 0.35rem var(--mobile-safe-bottom);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border, #e5e7eb);
    font-family: var(--font, "Inter", system-ui, sans-serif);
  }

  .mobile-nav__item {
    border: 0;
    background: transparent;
    min-height: 44px;
    padding: 0.45rem 0.15rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-muted, #64748b);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav__item--active,
  .mobile-nav__item[aria-current="page"] {
    color: var(--color-primary, #2563eb);
  }

  .mobile-nav__icon {
    font-size: 1.15rem;
    line-height: 1;
    height: 22px;
    display: grid;
    place-items: center;
  }

  .mobile-nav__fab-slot {
    display: flex;
    justify-content: center;
    margin-top: -18px;
  }

  .mobile-nav__fab {
    width: 52px;
    height: 52px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 16px;
    border: 0;
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    display: grid;
    place-items: center;
  }

  .mobile-nav__fab:active {
    background: var(--color-primary-hover, #1d4ed8);
  }

  .view-mais {
    padding: 0.85rem 1rem 1.5rem;
    color: var(--color-text, #172033);
  }
}

@media (min-width: 769px) {
  #app-mobile-nav.mobile-nav {
    display: none !important;
  }
}
