:root {
  --text: #16324f;
  --muted: #5d7186;
  --accent: #0b7dbb;
  --accent-2: #f4b942;
  --header-h: 82px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor-offset);
}

.nav-wrap {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* 1. Universal Link Behavior */
.primary-nav a {
  display: block !important;       /* Forces block display over any external styles */
  width: 100% !important;          /* Guarantees full edge-to-edge hitting space */
  padding: 12px 14px !important;   /* Extra room for mobile fingers to tap */
  text-align: right !important;     /* Direct text rule ensuring left-alignment */
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover {
  color: var(--accent);
  background-color: rgba(11, 125, 187, 0.08);
}

/* 2. Hamburger Button Styles */
.menu-toggle {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 2px;
}

/* 3. Base Dropdown Framework (Desktop View) */
.primary-nav {
  position: absolute;
  top: var(--header-h);
  display: none;
  flex-direction: column;
  align-items: flex-start !important; /* Left justifies the internal items */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  width: 350px;
}

.primary-nav.open {
  display: flex;
  position: absolute;
  z-index: 200000000;
  right: 170px;
  top: 90px;
}

/* 4. Mobile Layout Adjustments (Width <= 768px) */
/* Placed firmly at the bottom so it overrides everything above it */
@media (max-width: 768px) {
  .primary-nav {
    width: 250px !important;
    align-items: flex-start !important;
  }
  
  .primary-nav.open {
    display: flex !important;
    position: absolute !important;
    right: 0px !important; 
    top: 90px !important;
    z-index: 200000000 !important;
  }
}