/* ==========================================================================
   Mobile bottom navigation
   Fixed app-style tab bar shown only on phones/tablets (hidden from 768px up).
   Markup: bottom_nav_markup() in includes/layout.php.
   ========================================================================== */

.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: stretch;
  gap: 0.125rem;
  padding: 0.375rem 0.25rem calc(0.375rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -6px 20px -12px rgba(15, 23, 42, 0.35);
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3rem;
  padding: 0.25rem 0.125rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.6875rem;
  line-height: 1.1;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.bottom-nav-item > span { white-space: nowrap; }
.bottom-nav-item:active { background: rgba(15, 23, 42, 0.05); }

.bottom-nav-item.is-active {
  color: var(--brand, #0f172a);
  background: color-mix(in srgb, var(--brand, #0f172a) 10%, transparent);
}

.bottom-nav-wa { color: #16a34a; }

/* Cart icon + live item badge */
.bottom-nav-cart-icon {
  position: relative;
  display: inline-flex;
}

.bottom-nav-badge {
  position: absolute;
  top: -0.35rem;
  inset-inline-start: 0.6rem;
  min-width: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

.bottom-nav-badge.is-empty { display: none; }

/* Keep page content clear of the fixed bar. The cart FAB remains vertically
   centered by cart-drawer.css; combining its top: 50% with a bottom inset
   makes an auto-height fixed element stretch between both edges. */
@media (max-width: 767.98px) {
  body.has-bottom-nav {
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  }
}
