:root {
  --m-primary: #000000;
  --m-active-blue: #0A66C2;
  --m-header-h: 52px; /* Slimmer profile like professional networks */
  --m-text-muted: #666666;
  --m-border-color: #e1e1e1;
  --m-bg-hover: #f3f3f3;
}

/* MAIN NAVIGATION CONTAINER */
.m-nav-system {
  background: #fff;
  border-bottom: 1px solid var(--m-border-color);
  position: sticky;
  top: 0;
  z-index: 10000;
  height: var(--m-header-h);
}

.m-nav-wrapper {
  max-width: 1128px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 24px;
}

/* LEFT SECTION: LOGO & SEARCH */
.m-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.m-nav-brand {
  height: 34px;
  display: flex;
  align-items: center;
}

.m-nav-brand .logo {
  height: 30px;
  width: auto;
}

.m-search-mock {
  background: #edf3f8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 34px;
  width: 280px;
  transition: width 0.3s ease;
}

.m-search-mock svg {
  color: #606770;
}

.m-search-mock input {
  background: transparent;
  border: none;
  padding: 0 8px;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  color: #000;
}

/* NAVIGATION LINKS GROUPING */
.m-nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  height: 100%;
}

.m-customer-nav-group {
  display: flex;
  height: 100%;
}

/* NAV ITEMS: STACKED LAYOUT */
.m-nav-item {
  height: 100%;
  position: relative;
}

.m-nav-item > a,
.m-switch-trigger-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--m-text-muted);
  min-width: 80px;
  height: 100%;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.m-nav-item svg {
  margin-bottom: 2px;
  stroke-width: 1.5;
}

.m-nav-item span {
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

/* ACTIVE & HOVER STATES */
.m-nav-item:hover > a,
.m-nav-item.m-active > a,
.m-switch-trigger-btn:hover {
  color: #000;
}

.m-nav-item.m-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #000;
}

/* CARET STYLING */
.m-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* MEGA MENU (DESKTOP) */
.m-mega-panel {
  position: absolute;
  top: 100%;
  right: 0; /* Prevents running off the left edge */
  background: #fff;
  min-width: 260px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 0 0 8px 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  padding: 8px 0;
  z-index: 100;
}

.m-has-mega:hover .m-mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.m-mega-panel a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  transition: background 0.2s;
}

.m-mega-panel a:hover {
  background: var(--m-bg-hover);
}

.m-mega-panel a strong {
  display: block;
  color: #333;
  font-size: 13px;
  margin-bottom: 2px;
}

.m-mega-panel a span {
  font-size: 11px;
  color: #777;
  display: block;
}

/* DIVIDER */
.m-nav-divider {
  width: 1px;
  height: 34px;
  background: var(--m-border-color);
  margin: 0 12px;
}

/* HAMBURGER (MOBILE ONLY) */
.m-nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10005;
}

.m-nav-hamburger span {
  width: 22px;
  height: 2px;
  background: #333;
  transition: 0.3s;
}

/* RESPONSIVE / MOBILE REWORK */
@media (max-width: 1000px) {
  .m-search-mock { display: none; }

  .m-nav-hamburger { display: flex; }

  .m-nav-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 60px;
    overflow-y: auto;
  }

  .m-nav-content.m-show {
    transform: translateX(0);
  }

  .m-nav-links, .m-customer-nav-group {
    flex-direction: column;
    height: auto;
    width: 100%;
  }

  .m-nav-item {
    width: 100%;
    height: auto;
  }

  .m-nav-item > a, .m-switch-trigger-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 16px 24px;
    gap: 15px;
    min-width: unset;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .m-nav-item.m-active::after {
    display: none; /* No bottom border on mobile */
  }

  .m-nav-item.m-active > a {
    background: #f0f7ff;
    color: var(--m-active-blue);
  }

  .m-mega-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    transform: none;
    padding-left: 50px;
    background: #fcfcfc;
    display: block;
  }

  .m-nav-divider {
    display: none;
  }
}



/* Styling for the Login CTA */
.m-nav-cta {
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.m-btn-login {
    border: 1px solid var(--m-active-blue) !important;
    color: var(--m-active-blue) !important;
    border-radius: 20px;
    height: 34px !important; /* Slightly shorter than the nav height */
    padding: 0 16px !important;
    flex-direction: row !important; /* Row instead of stacked for the CTA */
    gap: 6px;
    transition: all 0.2s ease !important;
}

.m-btn-login:hover {
    background: rgba(10, 102, 194, 0.1);
    border-width: 2px !important;
}

.m-btn-login span {
    font-weight: 600 !important;
    font-size: 13px !important;
}

/* Hide the active underline for the CTA button */
.m-nav-cta.m-active::after {
    display: none;
}

/* Mobile adjustment: Login should be full width */
@media (max-width: 1200px) {
     /* Fix CTA to bottom */
    .m-nav-cta {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 16px 24px;
        background: #fff;
        border-top: 1px solid rgba(0,0,0,0.06);
        display: flex;
        justify-content: center;
    }

    .m-btn-login {
        width: 100%;
        justify-content: center !important;
        height: 44px !important;
        font-size: 14px !important;
    }
}


/* Prevent flash of hidden content on page load */
[x-cloak] { display: none !important; }

@media (max-width: 768px) {
    /* Hide by default on mobile */
    .m-mega-panel {
        display: none !important;
        position: static !important; /* Forces it to push content down */
    }

    /* Show only when active */
    .m-mega-panel.m-show-mobile {
        display: block !important;
    }
}



