/* Mobile Bottom Navigation Bar */
.mobile-bnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 950;
  background: #fff;
  border-top: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  padding: 4px 0;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

@media (max-width: 767px) {
  .mobile-bnav { display: flex; }
  /* Add bottom padding to body so content isn't hidden behind the nav */
  body { padding-bottom: 64px; }
  /* Push sticky buybox up above bottom nav */
  .sticky-buybox { bottom: 60px !important; }
  /* Push compare bar up */
  .compare-bar { bottom: 60px !important; }
  /* Push back-to-top up */
  .back-to-top { bottom: 72px !important; }
  /* Push bulk-add toolbar up above bottom nav */
  .bulk-toolbar.is-visible { bottom: 76px !important; }
  /* Push category filter toggle button up above bottom nav */
  .filters-mobile-toggle { bottom: 72px !important; }
  /* Push search filter/sort bar up above bottom nav */
  [data-search-filters] .search-mobile-bar { bottom: calc(68px + env(safe-area-inset-bottom)) !important; }
}

.mobile-bnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px 4px;
  background: none;
  border: none;
  color: #6b7280;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
  font-family: inherit;
  min-height: 48px;
}

.mobile-bnav__item:hover {
  color: #1d4ed8;
}
.mobile-bnav__item:focus-visible {
  color: #1d4ed8;
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
  border-radius: 8px;
}

.mobile-bnav__item--active {
  color: #1d4ed8;
}

.mobile-bnav__item--active .mobile-bnav__icon {
  stroke-width: 2.5;
}

.mobile-bnav__icon {
  flex-shrink: 0;
}

.mobile-bnav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.mobile-bnav__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #1d4ed8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}

.mobile-bnav__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

/* Reduced motion: disable color transition for vestibular-sensitive users */
@media (prefers-reduced-motion: reduce) {
  .mobile-bnav__item { transition: none; }
}

@media (forced-colors: active) {
  .mobile-bnav__badge { border: 2px solid; }
}

@media print {
  .mobile-bnav { display: none !important; }
  body { padding-bottom: 0 !important; }
}

/* JS adds .mobile-bnav--hidden on checkout pages */
.mobile-bnav--hidden {
  display: none !important;
}
