/*
 * HiBiker shared navigation chrome — floating glass.
 * Presentation only: one component language for Rider, Business and Club.
 * The functional tab markup, account switchers and routing remain untouched.
 */
:root {
  --hibiker-nav-accent: #ff873e;
  --hibiker-nav-radius: 27px;
  --hibiker-nav-glass: linear-gradient(145deg, rgba(48, 45, 46, .88), rgba(23, 23, 26, .86));
}

/* All three identities share this shell-level, inset header treatment. */
.app-shell > header.topbar-home {
  top: calc(8px + env(safe-area-inset-top, 0px));
  min-height: 66px;
  margin: calc(8px + env(safe-area-inset-top, 0px)) 12px 5px;
  padding: 8px 13px;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 23px;
  /* Flat, opaque header: no top-edge dissolution, glass blur or fading shadow. */
  background: #f7f4ef;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
.app-shell > header.topbar-home .home-head-actions { gap: 7px; }
.app-shell > header.topbar-home .head-icon {
  border-color: rgba(255, 255, 255, .66);
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 2px 9px rgba(61, 47, 34, .055);
  transition: background-color .17s ease, border-color .17s ease, transform .17s ease;
}
.app-shell > header.topbar-home .head-icon:active {
  transform: scale(.96);
  background: rgba(255, 255, 255, .82);
}
.app-shell > header.topbar-home .head-icon:focus-visible,
.app-shell > header.topbar-home .brand:focus-visible,
.app-shell > header.topbar-home .home-user-chip:focus-visible {
  outline: 2px solid #e96922;
  outline-offset: 3px;
}
.app-shell > header.topbar-home .home-user-chip img {
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 3px 11px rgba(38, 28, 22, .11);
}

/* Floating tab island: glass supports content; it never becomes a content card. */
.app-shell > nav.bottom-nav {
  box-sizing: border-box;
  position: fixed;
  z-index: 35;
  left: 50%;
  /* Sit closer to the phone edge while leaving clearance for iOS home indicator. */
  bottom: max(6px, calc(env(safe-area-inset-bottom, 0px) - 5px));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 620px);
  max-width: 620px;
  height: 72px;
  min-height: 72px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--hibiker-nav-radius);
  background: var(--hibiker-nav-glass);
  -webkit-backdrop-filter: blur(19px) saturate(155%);
  backdrop-filter: blur(19px) saturate(155%);
  box-shadow: 0 12px 34px rgba(21, 19, 19, .25),
              0 3px 8px rgba(17, 16, 17, .10),
              inset 0 1px 0 rgba(255, 255, 255, .17);
  isolation: isolate;
}
.app-shell > nav.bottom-nav .nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 56px;
  height: 100%;
  padding: 3px 1px 2px;
  border-radius: 18px;
  gap: 3px;
  color: #e3dedd;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color .18s ease;
}
.app-shell > nav.bottom-nav .nav-btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: min(49px, calc(100% - 10px));
  height: 38px;
  border: 1px solid rgba(255, 176, 121, .14);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 150, 80, .16), rgba(255, 255, 255, .085));
  transform: translateX(-50%) scale(.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
}
.app-shell > nav.bottom-nav .nav-btn.active {
  color: #ffab70;
  font-weight: 800;
}
.app-shell > nav.bottom-nav .nav-btn.active::before {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}
.app-shell > nav.bottom-nav .nav-btn .nav-icon,
.app-shell > nav.bottom-nav .nav-btn small {
  position: relative;
  z-index: 1;
}
.app-shell > nav.bottom-nav .nav-btn .nav-icon {
  min-height: 27px;
  transition: transform .18s cubic-bezier(.2, .8, .2, 1);
}
.app-shell > nav.bottom-nav .nav-btn.active .nav-icon { transform: translateY(-1px); }
.app-shell > nav.bottom-nav .nav-btn .ui-svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.app-shell > nav.bottom-nav .nav-btn small {
  display: block;
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: .025em;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
}
.app-shell > nav.bottom-nav .nav-btn:focus-visible {
  outline: 2px solid #ffc193;
  outline-offset: -3px;
}
.app-shell > nav.bottom-nav .nav-btn:active .nav-icon { transform: scale(.95); }

/* Keep the Rider's raised RIDE landmark, integrated into the glass material. */
.app-shell > nav.bottom-nav .nav-btn.ride-main::before { opacity: 0; }
.app-shell > nav.bottom-nav .nav-btn.ride-main .nav-icon {
  box-sizing: border-box;
  width: 49px;
  height: 49px;
  min-height: 49px;
  margin-top: -18px;
  border: 2px solid rgba(255, 142, 70, .83);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(65, 53, 48, .98), rgba(29, 29, 32, .98));
  box-shadow: 0 4px 13px rgba(0, 0, 0, .24),
              inset 0 1px 0 rgba(255, 255, 255, .15);
}
.app-shell > nav.bottom-nav .nav-btn.ride-main .ui-svg { width: 27px; height: 27px; }
.app-shell > nav.bottom-nav .nav-btn.ride-main.active .nav-icon {
  border-color: #ffa060;
  box-shadow: 0 0 0 3px rgba(255, 125, 54, .12), 0 5px 15px rgba(0, 0, 0, .22);
}
.app-shell > nav.bottom-nav .nav-btn.ride-main small { margin-top: -3px; }
.app-shell > nav.bottom-nav .nav-badge {
  border-color: #292629;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .27);
}

/* Account-specific variations are identity details, not different navigation systems. */
.app-shell > header.bow-topbar,
.app-shell > header.club-topbar { border-color: rgba(250, 225, 207, .72); }
.app-shell > nav.business-only-native-nav .nav-btn { min-width: 0; }

/* The floating bar must never cover the last tappable content. */
.app-shell:has(> nav.bottom-nav) { padding-bottom: calc(114px + env(safe-area-inset-bottom, 0px)); }
.app-shell > .content { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 600px) {
  .app-shell > header.topbar-home {
    min-height: 64px;
    margin-inline: 9px;
    padding: 8px 10px;
    gap: 7px;
    border-radius: 21px;
  }
  .app-shell > header.topbar-home .home-head-actions { gap: 5px; }
  .app-shell > nav.bottom-nav {
    width: calc(100% - 18px);
    height: 70px;
    min-height: 70px;
    padding: 6px 5px;
    border-radius: 25px;
  }
  .app-shell > nav.bottom-nav .nav-btn { min-height: 56px; }
  .app-shell > nav.bottom-nav .nav-btn small { font-size: 8.5px; }
}
@media (max-width: 360px) {
  .app-shell > header.topbar-home { margin-inline: 7px; padding-inline: 8px; }
  .app-shell > header.topbar-home .home-head-actions { gap: 3px; }
  .app-shell > nav.bottom-nav { width: calc(100% - 14px); }
  .app-shell > nav.bottom-nav .nav-btn small { font-size: 8px; letter-spacing: 0; }
}
/* iPhone PWA: nest the glass island deeper into the bottom safe area. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 600px) and (pointer: coarse) {
    .app-shell > nav.bottom-nav {
      bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) - 17px));
    }
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .app-shell > header.topbar-home { background: #f5f1eb; }
  .app-shell > nav.bottom-nav { background: #29272a; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell > nav.bottom-nav .nav-btn,
  .app-shell > nav.bottom-nav .nav-btn::before,
  .app-shell > nav.bottom-nav .nav-btn .nav-icon,
  .app-shell > header.topbar-home .head-icon { transition: none !important; }
}

/*
 * iOS 27 standalone PWAs: WebKit can paint a native scroll-edge blur
 * down over the actual header. A fixed, opaque top-edge sample makes
 * the system status bar solid without introducing an overlay on the
 * header or altering its safe-area / tab navigation geometry.
 */
/* No extra chrome in browsers or non-installed PWA windows. */
.hb-ios-status-edge { display: none; }
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) and (pointer: coarse) {
    body > .hb-ios-status-edge {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 8px;
      background: #e9e5df;
      pointer-events: none;
      z-index: 2147483000;
    }
  }
}
