/* ========================================
   Bottom Nav Bar - Mobile Only
   Wise Owl Design System
   ========================================
   Fixed bottom navigation: Posiłki | Budżet | Menu
   Hidden on md (768px) and up.
   z-40: stays above meal cards, below FilterDrawer (z-60)
   ======================================== */

.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  background: var(--white);
  border-top: 1px solid rgba(30, 41, 59, 0.1); /* border-sage/10 */
  padding-bottom: env(safe-area-inset-bottom); /* pb-safe */
}

/* When off-canvas menu is open, keep bottom nav on top so Menu tab stays tappable to close */
/* Use both body class (JS) and :has(#offcanvas-menu.open) so it works reliably on 2nd+ open */
body.offcanvas-menu-open .bottom-nav-bar,
body:has(#offcanvas-menu-checkbox:checked) .bottom-nav-bar,
body:has(#offcanvas-menu.open) .bottom-nav-bar {
  z-index: 100003;
}

.bottom-nav-bar__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 1rem;
  padding: 0.5rem 1rem;
  min-height: 56px;
}

.bottom-nav-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem;
  color: #94a3b8; /* text-slate-400 - Inactive state */
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: color 0.15s ease;
}

.bottom-nav-bar__item:hover {
  color: rgba(30, 41, 59, 0.7); /* hover:text-sage/70 */
}

.bottom-nav-bar__item:focus {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

.bottom-nav-bar__item:active {
  transform: scale(0.95);
}

.bottom-nav-bar__item i {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.bottom-nav-bar__label {
  font-size: 10px; /* text-[10px] micro-copy */
  font-weight: 500; /* font-medium */
  margin-top: 0.25rem; /* mt-1 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active state - Meals or Budget */
.bottom-nav-bar__item--active {
  color: var(--honey-burnt);
  background: rgba(234, 179, 8, 0.1);
  border-radius: 0.5rem;
}

.bottom-nav-bar__item--active:hover {
  background: rgba(234, 179, 8, 0.15);
}

/* Menu item (hamburger) - no active state, uses inactive styling */
.bottom-nav-bar__item--menu {
  color: #94a3b8; /* text-slate-400 - Inactive */
}

.bottom-nav-bar__item--menu:hover {
  color: rgba(30, 41, 59, 0.7); /* hover:text-sage/70 */
}

/* Content spacer - prevents content from being hidden behind fixed bar */
.bottom-nav-bar-spacer {
  height: 56px;
}

/* Main content padding when bottom nav is visible - prevents cards hiding under nav */
@media (max-width: 767px) {
  body.bottom-nav-visible main#main-content {
    padding-bottom: 6rem; /* pb-24 - 96px */
  }
}

/* Hide top-right hamburger when bottom nav is visible - single Menu entry point in bottom nav */
/* Hide close button (X) in menu header - bottom nav hamburger becomes X to close */
@media (max-width: 767.98px) {
  body.bottom-nav-visible #offcanvas-menu-toggle,
  body.bottom-nav-visible .offcanvas-menu-toggle,
  body.bottom-nav-visible .offcanvas-menu-toggle-css,
  body.bottom-nav-visible .notification-dot-hamburger {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.bottom-nav-visible .offcanvas-menu-close {
    display: none !important;
  }
}

/* Hide on md and up */
@media (min-width: 768px) {
  .bottom-nav-bar {
    display: none !important;
  }

  .bottom-nav-bar-spacer {
    display: none !important;
  }
}
