/* Instagram-style floating bottom navigation (shared) */

:root {
  --nav-inset-x: 16px;
  --nav-inset-y: 12px;
  --nav-bar-height: 64px;
  --bottom-nav-offset: calc(
    var(--nav-inset-y) + env(safe-area-inset-bottom, 0px) + var(--nav-bar-height)
  );
}

.has-bottom-nav {
  padding-bottom: calc(var(--bottom-nav-offset) + 16px) !important;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-inset-y) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100% - var(--nav-inset-x) * 2);
  max-width: calc(448px - var(--nav-inset-x) * 2);
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  padding: 6px 8px;
  min-height: var(--nav-bar-height);
  z-index: 100;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 28px rgba(217, 77, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

@media (prefers-reduced-transparency: reduce) {
  .bottom-nav {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 6px 4px;
  margin: 0;
  background: none;
  border: none;
  color: var(--text-tertiary, rgba(0, 0, 0, 0.45));
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  border-radius: 999px;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

.nav-btn:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .nav-btn:hover {
    color: var(--primary, #FF5B00);
    background: var(--primary-light, #FFF1E8);
  }
}

.nav-btn.active {
  color: var(--primary, #FF5B00);
  background: var(--primary-light, #FFF1E8);
}

/* Disable legacy top indicator from page-level overrides */
.nav-btn::before {
  display: none !important;
  content: none !important;
}

.nav-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

@media (hover: hover) {
  .nav-btn:hover .nav-icon {
    transform: scale(1.06);
  }
}

.nav-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15px;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Tighter packing when 6 admin tabs are present */
.bottom-nav:has(> :nth-child(6)) .nav-btn {
  padding: 5px 2px;
}

.bottom-nav:has(> :nth-child(6)) .nav-icon {
  width: 20px;
  height: 20px;
}

.bottom-nav:has(> :nth-child(6)) .nav-text {
  font-size: 9px;
}

/* Cart badge sits on the icon corner inside the pill */
.nav-btn .nav-badge,
.nav-btn > span[style*="position:absolute"] {
  top: 2px !important;
  right: 50% !important;
  margin-right: -18px !important;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  margin-right: -18px;
  min-width: 16px;
  padding: 0 5px;
  height: 16px;
  border-radius: 999px;
  background: #FF5B00;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  z-index: 2;
}
