/* ===== Base nav bar ===== */
.main-nav {
  position: relative;
  background: #0056a3;
  min-height: 56px;                 /* fixed bar height */
  padding: 0 1rem;                  /* horizontal breathing room */
  z-index: 1010;
  display: flex;                    /* allows centering the hamburger */
  align-items: center;              /* vertical center */
  justify-content: center;          /* center content horizontally on desktop */
}
.main-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.main-nav a:hover { text-decoration: underline; }
.main-nav a.active { font-weight: 600; text-decoration: underline; }

/* ===== Visually hidden (for the hamburger label) ===== */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ===== Hamburger (mobile) ===== */
.nav-toggle {
  display: none;                    /* shown only on small screens */
  position: absolute;
  left: 50%;
  top: 50%;                         /* center inside the blue bar */
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1030;                    /* above the dropdown panel */
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute;
  left: 8px; right: 8px;
  height: 2px; background: #fff; content: "";
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { top: -8px; }
.nav-toggle-bar::after  { top: 8px; }

/* ===== Dropdown base ===== */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;                    /* hidden by default */
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  color: #003b6f;
  min-width: 200px;
  padding: 0.5rem 0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 6px;
  z-index: 1020;
}
.dropdown-menu li a {
  color: #003b6f;
  padding: 0.5rem 1rem;
  display: block;
}
.dropdown-menu li a:hover { background: #f5f7fa; }

/* Show dropdown when open (desktop & mobile) */
.dropdown.open .dropdown-menu { display: block; }

/* Reset list styles inside dropdowns */
.dropdown-menu,
.dropdown-menu ul { list-style: none; margin: 0; padding: 0; }
.dropdown-menu li { list-style: none; }
.dropdown-menu li::marker { content: none; }

/* ===== Mega dropdown (desktop) ===== */
.dropdown-phones .dropdown-menu.mega {
  display: none;
  width: min(1100px, 92vw);
  padding: 14px;
  border-radius: 10px;
}
.dropdown.open .dropdown-menu.mega { display: block; }

.mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.mega-col {
  background: #f7f9fc;
  border: 1px solid #e6eef9;
  border-radius: 10px;
  padding: 10px;
}
.brand-heading { margin: 0 0 6px 0; font-size: 0.95rem; }
.brand-heading a { color: #003b6f; font-weight: 700; }
.models {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 4px;
}
.models a {
  color: #003b6f;
  display: block; padding: 6px 8px; border-radius: 8px;
}
.models a:hover { background: #eef4ff; text-decoration: none; }
.more { margin-top: 6px; }
.more a { color: #0056a3; font-weight: 600; }
.muted { color: #6a86a8; font-size: 0.92rem; }

/* ===== Mobile layout ===== */
@media (max-width: 960px) {
  /* show hamburger inside the bar */
  .nav-toggle { display: block; }

  /* Hide the horizontal list; use an overlay panel below the bar */
  .main-nav > ul {
    display: none;                  /* closed state */
    position: absolute;
    left: 0; right: 0;
    top: 56px;                      /* panel starts exactly under the 56px blue bar */
    background: #0056a3;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 12px;
    border-top: 1px solid rgba(255,255,255,.18);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1020;                  /* below the hamburger but above the page */
  }
  .main-nav > ul.open { display: flex; }

  .main-nav > ul > li a {
    display: block;
    padding: 12px 16px;
  }

  /* Make dropdowns look native in the mobile panel */
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    min-width: 0;
    background: #fff;
    color: #003b6f;
    margin: 6px 10px;
    border-radius: 8px;
  }
  .dropdown-phones .dropdown-menu.mega {
    width: auto;
    padding: 8px 10px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .main-nav > ul > li.dropdown { position: relative; }

  /* Keep brand list clean */
  .mega-grid { grid-template-columns: 1fr; }
  .mega-col  { background: #f9fbff; }
}