:root {
  --app-bottom-nav-height: 74px;
  --app-bottom-nav-active: #2563eb;
  --app-bottom-nav-muted: #64748b;
}

.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 999;
  min-height: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid rgba(148, 163, 184, .25);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.bottom-nav .bnav-item {
  min-width: 0;
  min-height: 58px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  color: var(--app-bottom-nav-muted);
  text-decoration: none;
  border-radius: 14px;
  font: 650 .7rem/1 Inter, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s ease, transform .18s ease;
}

.bottom-nav .bnav-icon {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 1.18rem;
  transition: background-color .18s ease, transform .18s ease;
}

.bottom-nav .bnav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav .bnav-item.active {
  color: var(--app-bottom-nav-active);
  font-weight: 800;
}

.bottom-nav .bnav-item.active::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 28px;
  height: 3px;
  border-radius: 0 0 5px 5px;
  background: var(--app-bottom-nav-active);
  transform: translateX(-50%);
}

.bottom-nav .bnav-item.active .bnav-icon {
  background: #eaf2ff;
  transform: translateY(-1px);
}

.bottom-nav .bnav-primary {
  color: #1e3a8a;
  font-weight: 800;
}

.bottom-nav .bnav-primary .bnav-icon {
  width: 48px;
  height: 44px;
  margin-top: -15px;
  border: 4px solid #fff;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}

.bottom-nav .bnav-primary.active .bnav-icon {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.bottom-nav .bnav-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: -3px;
}

.bottom-nav .bnav-item:active { transform: scale(.96); }

[data-theme="dark"] .bottom-nav {
  background: rgba(15, 23, 42, .96);
  --app-bottom-nav-muted: #cbd5e1;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .bottom-nav { display: grid; }
}

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

@media (prefers-reduced-motion: reduce) {
  .bottom-nav *,
  .bottom-nav *::before { transition: none !important; }
}

body.checkout-focus .bottom-nav { display: none !important; }
