/* Mobile-only bottom nav with center call button and slide-up submenus. */
.bottom-nav,
.bottom-nav-drawer {
  display: none;
}

@media (max-width: 64rem) {
  body {
    padding-bottom: 4.75rem;
  }

  /* Shrink hero so the scrolling banner + content sit above the bottom nav */
  .hero {
    height: calc(100vh - 4.75rem);
    min-height: 30rem;
  }
  .hero-video {
    height: calc(100vh - 4.75rem);
  }

  /* Hide the old floating envelope on mobile — Contact is in the bottom nav now */
  .floating-contact {
    display: none !important;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid rgba(40, 62, 148, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    z-index: 9500;
    padding: 0.4rem 0.6rem calc(0.4rem + env(safe-area-inset-bottom));
    gap: 0;
    height: 4.5rem;
  }

  /* Solid safe-area backstop below the nav so iOS rubber-band scroll
     doesn't briefly expose page content behind it. */
  .bottom-nav::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -100vh;
    height: 100vh;
    background: #ffffff;
    z-index: -1;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    padding: 0.25rem 0.2rem;
    color: var(--text-color, #213043);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    min-width: 0;
  }

  .bottom-nav-item i {
    font-size: 1.15rem;
    color: var(--main-color, #283e94);
    transition: transform 0.2s;
  }

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

  .bottom-nav-item:hover,
  .bottom-nav-item:focus-visible,
  .bottom-nav-item.is-active {
    color: var(--main-color, #283e94);
    outline: none;
  }

  .bottom-nav-item:hover i,
  .bottom-nav-item.is-active i {
    transform: translateY(-2px);
  }

  .bottom-nav-call {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: -1.6rem 0.4rem 0;
    border-radius: 50%;
    background: var(--main-color, #283e94);
    color: #fff;
    text-decoration: none;
    box-shadow:
      0 10px 24px rgba(40, 62, 148, 0.35),
      0 0 0 4px rgba(255, 255, 255, 0.96);
    transition:
      transform 0.2s,
      background 0.2s;
    align-self: start;
  }

  .bottom-nav-call i {
    font-size: 1.35rem;
  }

  .bottom-nav-call:hover,
  .bottom-nav-call:focus-visible {
    transform: translateY(-2px) scale(1.03);
    background: #1e2f72;
    outline: none;
  }

  /* Drawers */
  .bottom-nav-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10500;
    pointer-events: none;
  }

  .bottom-nav-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .bottom-nav-drawer-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
  }

  .bottom-nav-drawer.is-open {
    pointer-events: auto;
  }

  .bottom-nav-drawer.is-open .bottom-nav-drawer-backdrop {
    opacity: 1;
  }

  .bottom-nav-drawer.is-open .bottom-nav-drawer-panel {
    transform: translateY(0);
  }

  .bottom-nav-drawer-handle {
    width: 2.5rem;
    height: 0.25rem;
    background: rgba(40, 62, 148, 0.2);
    border-radius: 999px;
    margin: 0 auto 0.75rem;
  }

  .bottom-nav-drawer-panel h3 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    padding: 0 0.5rem;
    color: var(--main-color, #283e94);
  }

  .bottom-nav-drawer-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .bottom-nav-drawer-panel li {
    border-top: 1px solid rgba(40, 62, 148, 0.06);
  }

  .bottom-nav-drawer-panel li:first-child {
    border-top: none;
  }

  .bottom-nav-drawer-panel a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 0.5rem;
    color: var(--text-color, #213043);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
  }

  .bottom-nav-drawer-panel a > i:first-child {
    color: var(--main-color, #283e94);
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
  }

  .bottom-nav-drawer-panel a > span {
    flex: 1;
  }

  .bottom-nav-drawer-panel a > i:last-child {
    color: rgba(40, 62, 148, 0.4);
    font-size: 0.8rem;
  }

  .bottom-nav-drawer-panel a:active {
    background: rgba(40, 62, 148, 0.05);
  }

  @media (prefers-reduced-motion: reduce) {
    .bottom-nav-drawer-panel,
    .bottom-nav-drawer-backdrop {
      transition: none;
    }
  }
}
