/*
 * Mobile layout fixes. Loaded after the Vite bundle so these rules win
 * without a rebuild. The same rules are appended in resources/css/mobile.css
 * for the next asset build.
 *
 * The desktop link row plus Log in and Register is about 850px wide, so the
 * hamburger stays through 1023px. Below that, the old sm:flex rule showed the
 * desktop links and pushed Log in off the screen.
 */

@media (max-width: 1023px) {
  .nav-desktop,
  .nav-desktop-actions {
    display: none !important;
  }

  .nav-mobile-button {
    display: flex !important;
  }

  .mobile-bottom-nav,
  .mobile-nav-spacer {
    display: block !important;
  }
}

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

  .nav-desktop,
  .nav-desktop-actions {
    display: flex !important;
  }
}

/* The bar is h-16 plus .pb-safe (at least 1rem). A 4rem spacer left the
   footer under the bar. */
.mobile-nav-spacer {
  height: calc(4rem + max(1rem, env(safe-area-inset-bottom, 0px))) !important;
}

.mobile-bottom-nav a span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
}

@media (max-width: 639px) {
  .mobile-full {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
}

@media (max-width: 1023px) {
  footer a,
  .tap-link,
  .mobile-nav-panel a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  footer ul a,
  .mobile-nav-panel a {
    width: 100%;
  }

  [aria-label="Agent profile tabs"] {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  [aria-label="Agent profile tabs"] > a {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
  }
}
