/* Keep the main navigation visible while browsing long pages. */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.mobile-menu-toggle, .mobile-menu-button { display: none; }

@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px 12px;
  }

  header .logo { font-size: 23px; margin: 0; letter-spacing: -1px; }
  header .logo span { width: 32px; height: 32px; font-size: 19px; }
  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #dfe5f2;
    border-radius: 10px;
    background: #eef2ff;
    color: #365cff;
    font-weight: 700;
    cursor: pointer;
  }
  header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: none;
    gap: 3px;
    overflow-x: auto;
    padding: 2px 0 5px;
    scrollbar-width: none;
  }
  header nav::-webkit-scrollbar { display: none; }
  header nav a, header .nav-actions > a, header .nav-actions .text-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }
  header nav a {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
  }
  header .nav-actions {
    display: none;
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 6px 0 0;
    border-top: 1px solid #edf0f5;
  }
  .mobile-menu-toggle:checked ~ nav,
  .mobile-menu-toggle:checked ~ nav + .nav-actions {
    display: flex;
  }
  .mobile-menu-toggle:checked ~ nav {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    padding: 6px;
    border: 1px solid #dfe5f2;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f5f7ff);
    box-shadow: 0 14px 30px rgba(35, 49, 100, .14);
  }
  .mobile-menu-toggle:checked ~ nav a { width: 100%; }
  header .nav-actions {
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
  }
  header .nav-actions > a:not(.profile):not(.btn) { display: inline-flex; }
  header .nav-actions .profile {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 10px;
    border-radius: 10px;
    background: #eef2ff;
    color: #365cff;
    font-weight: 700;
  }
  header .nav-actions .create-trip-nav { display: inline-flex !important; }
  header .nav-actions form { display: block; }
  header .nav-actions .book-car-nav { display: inline-flex !important; padding: 8px 10px; }
  header .nav-actions .profile { order: -1; }
  header .nav-actions .text-btn { padding: 8px 12px; border: 1px solid #e5e9f2; border-radius: 10px; background: #fff; }
}
