/* Header Module - Module-specific styles only */
/* Generic/shared styles should be in theme CSS */
/* Updated: Vertical dropdown menus fix - v2024.12.14 */

/* Override any global link styles for CTA buttons - ensure proper colors */
#hs_cos_wrapper_site_header .site-header a.header-cta.btn-primary {
  color: var(--color-primary-contrast, #ffffff) !important;
  font-weight: bold;
}

#hs_cos_wrapper_site_header .site-header a.header-cta.btn-secondary {
  color: #ffffff !important;
}

/* Inherit container width from theme settings */
.header-container {
  max-width: var(--container-width, 1200px);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Mobile menu toggle — base display/layout + the hamburger→X animation are
   owned by the inline CSS in module.html (audit L3, to avoid two conflicting
   X-animations). Only :hover/:focus kept here; outline uses currentColor since
   --menu-icon-color is undefined (audit M4). */
.menu-toggle:hover {
  opacity: 0.7;
}

.menu-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}


/* Legacy fullscreen-dark search-overlay CSS removed (audit M1) — the current
   boxed search design is owned entirely by the inline block in module.html, and
   these rules out-specified it (undefined --color-overlay/--color-text-inverse,
   wrong submit-button colors). */

/* Logo responsive sizing — light/dark visibility is owned by the inline CSS in
   module.html (base rules + the dark-mode media/[data-theme-override] overrides).
   The old !important display/visibility block here broke the dark-mode swap in
   auto mode (audit H2). */
.header-brand img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Reserve space to prevent layout shift */
.header-brand .logo-link {
  display: flex;
  align-items: center;
  position: relative;
  text-decoration: none;
}

/* Text logo fallback */
.header-brand .text-logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

/* Dark mode logo switching moved to conditional CSS in module.html for PageSpeed optimization */
/* This ensures dark mode CSS is only loaded when theme.dark_mode.enabled is true */

/* Language selector - Module specific */
.language-selector {
  position: relative;
}

.language-toggle {
  background: transparent;
  border: 1px solid currentColor;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-bg, white);
  border: 1px solid var(--color-border, #e0e0e0);
  box-shadow: 0 2px 8px var(--shadow-sm, rgba(0,0,0,0.1));
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  min-width: 150px;
}

.language-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.language-menu a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: inherit;
}

.language-menu a:hover {
  background: var(--color-bg-hover, #f5f5f5);
}

/* Membership menu - Module specific */
.membership-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary, #007bff);
  color: var(--color-text-inverse, white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: bold;
}

.auth-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Standard HubSpot menu styles */
.main-menu .hs-menu-wrapper {
  display: flex;
  align-items: center;
}

.main-menu .hs-menu-wrapper > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-menu .hs-menu-item {
  position: relative;
}

.main-menu .hs-menu-item a {
  text-decoration: none;
  color: inherit;
  padding: 0.5rem 0;
  display: inline-block;
  transition: color 0.2s ease;
}

.main-menu .hs-menu-item a:hover,
.main-menu .hs-menu-item.active-branch > a {
  color: var(--color-primary, #007bff);
}

/* Shared dropdown styles for ALL menu types (desktop & mobile) */
/* These styles apply to both HubSpot standard menus (.hs-menu-children-wrapper) 
   and custom macro menus (.submenu.level-2, .submenu.level-3) */

/* Desktop dropdown styles - VERTICAL layout for all menu types */
@media (min-width: 993px) {
  /* Hide mobile-specific elements on desktop */
  .submenu-toggle,
  .menu-arrow {
    display: none !important;
  }

  /* L1 items with L2 dropdowns - downward chevron */
  .menu-list > .menu-item.has-children > .menu-item-content > .menu-link::after,
  .menu-primary > .menu-item.has-children > .menu-item-content > .menu-link::after,
  .main-menu > ul > li.hs-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  /* Highlight chevron on hover */
  .menu-list > .menu-item.has-children:hover > .menu-item-content > .menu-link::after,
  .menu-primary > .menu-item.has-children:hover > .menu-item-content > .menu-link::after,
  .main-menu > ul > li.hs-item-has-children:hover > a::after {
    opacity: 1;
  }

  /* Ensure L1 items with children have positioning context */
  .menu-item.has-children,
  .main-menu > .hs-item-has-children {
    position: relative !important;
  }

  /* Universal dropdown container styles - ALL levels hidden by default */
  .main-menu .hs-menu-children-wrapper,
  .submenu.level-2,
  .submenu.level-3 {
    display: block !important;
    flex-direction: column !important;
    gap: 0 !important;
    position: absolute;
    top: 100%; /* Standard positioning */
    left: 0;
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, #e0e0e0);
    box-shadow: var(--shadow, 0 4px 12px rgba(0,0,0,0.1));
    min-width: 200px;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.15s ease; /* Only opacity transition - no visibility to prevent jump */
    z-index: 1000;
    padding: 0.5rem 0;
    border-radius: var(--radius, 0.5rem);
    will-change: opacity; /* GPU-accelerated opacity animation */
  }

  /* Dropdown side chosen by JS (placeDropdowns) BEFORE any hover — beats the
     left:0 above in both the custom (.submenu) and HubSpot
     (.hs-menu-children-wrapper) menus, so a near-edge panel opens leftward with
     no flash and no horizontal-scrollbar reflow (audit H1). */
  .submenu.submenu--flip,
  .main-menu .hs-menu-children-wrapper.submenu--flip {
    left: auto !important;
    right: 0 !important;
  }

  /* Make L2 dropdowns visible on L1 hover/focus - both menu types.
     (The `.hover`-class selectors were removed with the JS hover system, and
     `:focus-within` added for keyboard access — Batch 2d.) */
  .main-menu > ul > li.hs-item-has-children:hover > .hs-menu-children-wrapper,
  .main-menu > ul > li.hs-item-has-children:focus-within > .hs-menu-children-wrapper,
  .menu-list > .menu-item.has-children:hover > .submenu.level-2,
  .menu-primary > .menu-item.has-children:hover > .submenu.level-2,
  .menu-primary > .menu-item.has-children:focus-within > .submenu.level-2,
  /* Keep L2 dropdown visible when hovering on it */
  .main-menu > ul > li.hs-item-has-children > .hs-menu-children-wrapper:hover,
  .submenu.level-2:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity 0.15s ease !important;
  }

  /* Additional: Keep L2 parent item active when hovering L2 submenu */
  .main-menu > ul > li.hs-item-has-children:has(.hs-menu-children-wrapper:hover) > .hs-menu-children-wrapper,
  .menu-list > .menu-item.has-children:has(.submenu.level-2:hover) > .submenu.level-2,
  .menu-primary > .menu-item.has-children:has(.submenu.level-2:hover) > .submenu.level-2 {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  /* Touch device support - click to toggle */
  @media (hover: none) and (pointer: coarse) {
    .main-menu .hs-item-has-children > a,
    .has-submenu > .menu-link,
    .has-children > .menu-link {
      padding-right: 2.5rem;
    }
    
    .main-menu .hs-item-has-children > a::after,
    .has-submenu > .menu-link::after,
    .has-children > .menu-link::after {
      content: '▼';
      position: absolute;
      right: 1rem;
      font-size: 0.8em;
      pointer-events: none;
    }
  }
  
  /* Universal dropdown items - vertical stacking */
  .main-menu .hs-menu-children-wrapper > li,
  .main-menu .hs-menu-children-wrapper ul li,
  .submenu.level-2 > li,
  .submenu.level-3 > li {
    display: block !important;
    width: 100% !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Style all dropdown links consistently */
  .main-menu .hs-menu-children-wrapper a,
  .submenu.level-2 .menu-link,
  .submenu.level-3 .menu-link {
    display: block !important;
    padding: 0.5rem 1rem !important;
    white-space: nowrap;
    color: var(--color-text, #333);
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Hover state for all dropdown links */
  .main-menu .hs-menu-children-wrapper a:hover,
  .submenu.level-2 .menu-link:hover,
  .submenu.level-3 .menu-link:hover {
    background: var(--color-bg-hover, #f5f5f5);
    color: var(--color-primary, #007bff);
    padding-left: 1.25rem !important;
  }
  
  /* Third level positioning — native HubSpot menu ONLY. The custom-menu L3
     (.submenu.level-3) is positioned entirely by initDesktopL3 (fixed coords);
     a static left:100% fallback here was the right-side ghost spot (Batch 2c). */
  .main-menu .hs-menu-children-wrapper .hs-menu-children-wrapper {
    top: -0.5rem;
    left: 100%;
    margin-left: 0.25rem;
  }
  
  /* Ensure level 3 menus are above level 2 */
  .main-menu .hs-menu-children-wrapper .hs-menu-children-wrapper,
  .submenu.level-3 {
    z-index: 1001 !important;
  }
  
  /* Native HubSpot menu L3 — shown via CSS hover (it has no JS positioning). */
  .main-menu .hs-menu-children-wrapper .hs-item-has-children:hover > .hs-menu-children-wrapper,
  .main-menu .hs-menu-children-wrapper .hs-item-has-children.hover > .hs-menu-children-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Custom-menu L3 = initDesktopL3's .is-open AND the top-level item still being
     hovered. Tying it to the live ancestor :hover makes L2 and L3 die in the SAME
     frame when you leave the menu — no timer races, no orphaned L3 (Batch 2d).
     sub3 is position:fixed but still a DOM descendant of the top <li>, so
     hovering the fly-out keeps the ancestor :hover true. Needs !important to beat
     the hidden default (also !important); the inline .is-open rule has none. */
  .menu-primary > .menu-item.has-children:hover .submenu.level-3.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  
  /* Arrow indicators for L2 items with L3 children - sideways chevron (›) */
  .main-menu .hs-menu-children-wrapper .hs-item-has-children > a::after,
  .submenu.level-2 > .menu-item.has-children > .menu-item-content > .menu-link::after {
    content: '›';
    position: absolute;
    right: 1rem;
    font-size: 1.2em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }

  /* Highlight arrow on hover */
  .main-menu .hs-menu-children-wrapper .hs-item-has-children:hover > a::after,
  .submenu.level-2 > .menu-item.has-children:hover > .menu-item-content > .menu-link::after {
    opacity: 1;
  }
}

/* Membership menu styles - manual rendering */
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Desktop: Horizontal flex layout */
@media (min-width: 993px) {
  .menu-list {
    display: flex;
    gap: 0; /* Remove gap - will use padding instead */
    align-items: center;
  }
}

.menu-item {
  position: relative;
}

/* ===========================================
   MENU LINKS - Mobile First Approach
   =========================================== */

/* Base menu link styles (mobile first) */
.menu-link {
  /* Mobile defaults */
  display: flex !important;           /* Flex for all menu items on mobile */
  align-items: center;
  line-height: 1.6;                  /* Better readability on mobile */
  text-decoration: none;
  color: inherit;
  padding: 0.75rem 1rem;             /* More padding for touch targets */
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: visible;
  width: 100%;                       /* Full width on mobile */
}

/* Desktop overrides */
@media (min-width: 993px) {
  /* L1 menu links on desktop */
  .menu-list > .menu-item > .menu-item-content > .menu-link,
  .menu-primary > .menu-item > .menu-item-content > .menu-link {
    display: inline-flex !important;  /* Inline for horizontal menu */
    line-height: 1;                  /* Tight baseline for desktop */
    gap: 0.25rem;                    /* Space between icon and text */
    padding: 0.5rem 1rem;            /* Desktop padding */
    width: max-content;              /* Size to content on desktop */
  }

  /* Submenu links stay flex for vertical layout */
  .submenu .menu-link,
  .hs-menu-children-wrapper a {
    display: flex !important;         /* Keep flex in dropdowns */
    align-items: center;
    width: 100%;                     /* Full width in dropdown */
    padding: 0.5rem 1rem;            /* Consistent dropdown padding */
    gap: 0;                          /* No gap in dropdowns since images are inline */
  }
}

/* ===========================================
   MENU IMAGES - Mobile First Approach
   =========================================== */

/* Base styles for ALL menu images (mobile first) */
.menu-link img,
.submenu .menu-link img,
.hs-menu-children-wrapper a img {
  /* Mobile defaults */
  display: inline-block !important;  /* Inline with text on mobile */
  vertical-align: middle !important; /* Align with text baseline */
  width: 1.5rem !important;          /* 24px at 16px base font size */
  height: 1.5rem !important;         /* Scales with user's font preferences */
  margin-right: 0.5rem;              /* 8px at 16px base - scales proportionally */

  /* Common styles for all viewports */
  position: static !important;
  float: none !important;
  flex-shrink: 0;
  flex-grow: 0;
}

/* Desktop overrides (993px and up) */
@media (min-width: 993px) {
  /* L1 menu items - need block display to fix baseline */
  .menu-list > .menu-item .menu-link img,
  .menu-primary > .menu-item .menu-link img {
    display: block !important;      /* Remove baseline offset on desktop */
    margin-right: 0;                /* Remove mobile spacing */
  }

  /* L2/L3 submenu items - keep inline for dropdown menus */
  .submenu .menu-link img,
  .hs-menu-children-wrapper img {
    display: inline-block !important;  /* Keep inline in dropdowns */
    vertical-align: middle !important;
    margin-right: 0.5rem;              /* Keep spacing in dropdowns */
    width: 1.25rem !important;         /* 20px at 16px base - slightly smaller */
    height: 1.25rem !important;        /* Scales with user's font preferences */
  }
}

/* Desktop-specific: Ensure L1 menu items display images inline */
@media (min-width: 993px) {
  /* Don't make menu-item flex - let it stay as default to preserve gap spacing */
  .menu-list > .menu-item {
    position: relative;
    height: 100%; /* Ensure consistent height */
  }

  .menu-item-content {
    display: flex;
    align-items: center;
    height: 100%;
  }

  /* Make ALL L1 links flex containers for consistent alignment */
  .menu-list > .menu-item .menu-link,
  .menu-item-content > .menu-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem; /* Horizontal padding for spacing */
    line-height: 1; /* Tighten baseline to fix alignment */
    white-space: nowrap;
    width: max-content;    /* Force width to include all content */
    position: relative;
    overflow: visible;
  }

  /* First menu item doesn't need left padding */
  .menu-list > .menu-item:first-child .menu-link {
    padding-left: 0;
  }

  /* Last menu item doesn't need right padding */
  .menu-list > .menu-item:last-child .menu-link {
    padding-right: 0;
  }

  /* Ensure proper alignment for unified menu L1 items */
  .unified-menu .menu-list > .menu-item > .menu-item-content {
    display: flex;
    align-items: center;
  }

  .unified-menu .menu-list > .menu-item .menu-link {
    display: inline-flex !important;
    align-items: center;
  }
}

.menu-link:hover,
.menu-link.active {
  color: var(--color-primary, #007bff);
}

.menu-link.active-branch {
  font-weight: 500;
}

/* Submenu styles - desktop only */
/* Removed .menu-item.has-children flex rule to preserve parent gap spacing */

.submenu-toggle {
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: transform 0.2s ease;
}

.submenu-toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg, white);
  border: 1px solid var(--color-border, #e0e0e0);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.1));
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease; /* Only opacity transition - no visibility to prevent jump */
  will-change: opacity; /* GPU-accelerated opacity animation */
  z-index: 100;
}

.menu-item:hover .submenu,
.menu-item:focus-within .submenu,
.submenu-toggle[aria-expanded="true"] + .submenu {
  opacity: 1;
  visibility: visible;
}

.submenu .menu-link {
  display: flex !important;
  align-items: center;
  line-height: 1;        /* tighten baseline */
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  width: 100%;
}

.submenu .menu-link:hover {
  background: var(--color-bg-hover, #f5f5f5);
}

/* Mobile-specific styles - Shared for BOTH menu types */
@media (max-width: 992px) {
  /* Core mobile styles remain in module.html inline for performance */
  /* These visual enhancements apply to both HubSpot and custom menus */
  
  /* Unify both menu types on mobile */
  .main-menu,
  .membership-menu {
    width: 100%;
  }
  
  /* Make both menu types display as block lists on mobile */
  .main-menu .hs-menu-wrapper > ul,
  .menu-list,
  .menu-list.menu-primary,
  .menu-list.menu-membership {
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Ensure all top-level items are block level */
  .main-menu .hs-menu-item.hs-menu-depth-1,
  .menu-list > .menu-item,
  .menu-primary > .menu-item {
    display: block !important;
    width: 100% !important;
    position: relative !important;
    border-top: 1px solid rgba(127, 131, 139, 0.24);
  }
  
  .main-menu .hs-menu-item.hs-menu-depth-1:first-child,
  .menu-list > .menu-item:first-child {
    border-top: none;
  }
  
  /* Override any desktop absolute positioning */
  .main-menu .hs-menu-children-wrapper,
  .main-menu ul ul,
  .submenu.level-2,
  .submenu.level-3 {
    position: static !important;
    left: 0 !important;
    top: auto !important;
    float: none !important;
    display: none !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* Show submenu when parent has submenu-open class - ALL levels */
  .menu-item.submenu-open > .submenu.level-2,
  .menu-item.submenu-open > .submenu.level-3,
  li.submenu-open > .submenu,
  .hs-item-has-children.submenu-open > .hs-menu-children-wrapper {
    display: block !important;
    position: static !important;
    max-height: none !important;
    pointer-events: auto !important;
  }
  
  
  /* Typography improvements for all mobile menus.
     (Hardcoded `Lato` removed per audit M6 — not loaded by this theme; the menu
     inherits the theme body font via the scope_css block.) */
  .nav-menu,
  .navigation-primary {
    --menu-indent-level-1: 1.5rem;
    --menu-indent-level-2: 3rem;
    --menu-indent-level-3: 4.5rem;
  }
  
  /* Universal link styles for mobile */
  .nav-menu a,
  .navigation-primary a {
    font-size: 17px; /* Mobile menu general links */
    font-weight: 300;
    line-height: 1.6;
    will-change: transform;
    transition: transform 0.2s ease, color 0.2s ease;
  }

  /* Menu link font size for mobile - already has flex from base styles */
  .menu-link {
    font-size: 17px;
    font-weight: 300;
  }
  
  /* Clean borders between ALL menu items */
  .nav-menu .hs-menu-item,
  .submenu > li,
  .menu-item {
    border-bottom: none;
    border-top: 1px solid rgba(127, 131, 139, 0.24);
    position: relative;
  }
  
  .nav-menu .hs-menu-item:first-child,
  .submenu > li:first-child,
  .menu-item:first-child {
    border-top: none;
  }
  
  /* Main menu items styling - unified for both types */
  .main-menu .hs-menu-wrapper > ul > li > a,
  .nav-menu .hs-menu-wrapper > ul > li > a,
  .menu-list > .menu-item .menu-item-content > .menu-link,
  .menu-list > .menu-item:not(.has-children) > .menu-link,
  .submenu.level-1 > li > a,
  .navigation-primary > ul > li > a {
    display: block !important;
    padding: 0.875rem 1.5rem !important;
    font-size: 18px !important; /* Mobile L1 menu items */
    font-weight: 400 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-align: left !important;
  }
  
  /* Base mobile menu structure */
  .menu-item {
    position: relative;
    display: block;
  }
  
  /* Menu item content container - consistent flexbox layout for all levels */
  .menu-item-content {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 48px; /* Consistent touch target height */
  }
  
  /* Level-specific padding for visual hierarchy */
  .menu-list > .menu-item > .menu-item-content {
    padding-left: 1.5rem; /* L1 */
  }
  
  .submenu.level-2 > .menu-item > .menu-item-content {
    padding-left: 3rem; /* L2 */
  }
  
  .submenu.level-3 > .menu-item > .menu-item-content {
    padding-left: 4.5rem; /* L3 */
  }
  
  .submenu.level-4 > .menu-item > .menu-item-content {
    padding-left: 6rem; /* L4 */
  }
  
  /* Menu links - flex to fill available space */
  .menu-item-content > .menu-link {
    flex: 1;
    display: block;
    text-align: left;
    padding: 0.75rem 1rem 0.75rem 0;
    text-decoration: none;
    color: inherit;
  }
  
  /* Submenu toggle button - always vertically centered */
  .menu-item-content > .submenu-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: none; /* No transition on button itself */
  }
  
  /* HubSpot standard menu compatibility */
  .hs-menu-item {
    position: relative;
    display: block;
  }
  
  .hs-menu-wrapper > ul > li > a {
    display: block;
    padding: 0.875rem 1.5rem;
  }
  
  /* For HubSpot menus with children, add space for arrow */
  .hs-item-has-children > a {
    padding-right: 60px;
  }
  
  /* Arrow SVG styling and animation */
  .submenu-toggle svg {
    width: 12px;
    height: 12px;
    pointer-events: none;
    transition: transform 0.3s ease;
    display: block;
  }
  
  /* Rotate only the SVG when submenu is open */
  .submenu-open > .menu-item-content > .submenu-toggle svg {
    transform: rotate(180deg);
  }
  
  /* Submenu styling - hidden by default on mobile */
  .submenu {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background: rgba(127, 131, 139, 0.08);
    border-left: 2px solid var(--color-primary, #007bff);
  }
  
  /* Show submenu when parent has submenu-open class */
  .menu-item.submenu-open > .submenu {
    display: block;
  }
  
  /* Show submenus when opened */
  .hs-item-has-children.submenu-open > .hs-menu-children-wrapper,
  input[type="checkbox"]:checked ~ .submenu {
    display: block;
  }
  
  /* Ensure L2/L3 items stack vertically on mobile */
  .nav-menu .hs-menu-children-wrapper > li,
  .nav-menu .hs-menu-children-wrapper ul > li,
  .submenu.level-2 > li,
  .submenu.level-3 > li {
    display: block !important;
    width: 100% !important;
    position: relative !important;
    border-top: 1px solid rgba(127, 131, 139, 0.18);
  }
  
  .nav-menu .hs-menu-children-wrapper > li:first-child,
  .submenu.level-2 > li:first-child {
    border-top: none;
  }
  
  .nav-menu .hs-menu-children-wrapper > li > a,
  .nav-menu .hs-menu-children-wrapper a,
  .submenu.level-2 > li > a,
  .submenu.level-2 .menu-link,
  .submenu.level-3 > li > a,
  .submenu.level-3 .menu-link {
    display: block !important;
    width: 100% !important;
    padding: 0.75rem var(--menu-indent-level-2);
    font-size: 14px; /* Mobile L2 submenu items */
    font-weight: 300;
    text-transform: none;
    white-space: normal !important;
  }
  
  /* Third level indentation - both menu types */
  .nav-menu .hs-menu-children-wrapper .hs-menu-children-wrapper,
  .submenu.level-3 {
    background: rgba(127, 131, 139, 0.05);
    border-left: none;
    padding-left: 1rem;
    position: static !important;
  }
  
  /* Ensure L3 items maintain their own positioning context */
  .submenu.level-3 > li {
    position: relative !important;
  }
  
  .nav-menu .hs-menu-children-wrapper .hs-menu-children-wrapper > li > a,
  .submenu.level-3 > li > a,
  .submenu.level-3 .menu-link {
    padding: 0.625rem var(--menu-indent-level-3);
    font-size: 12px; /* Mobile L3 submenu items */
  }
  
  /* Active item styling - both menu types */
  .nav-menu a.active,
  .nav-menu a[aria-current="page"],
  .menu-link.active-item,
  .menu-link.active-branch {
    font-weight: 600;
    color: var(--color-primary, #007bff);
    position: relative;
  }
  
  /* Active indicator for top-level items - both types */
  .nav-menu .hs-menu-wrapper > ul > li > a.active::before,
  .submenu.level-1 > li > a.active-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--color-primary, #007bff);
    border-radius: 0 2px 2px 0;
  }
  
  /* Smooth hover effect - both menu types */
  .nav-menu a:hover,
  .menu-link:hover {
    transform: translateX(4px);
    color: var(--color-primary, #007bff);
  }
  
  /* Submenu toggle arrow improvements - both types */
  .nav-menu .hs-item-has-children > a::after,
  .has-submenu > .menu-link::after,
  .has-children > .menu-link::after {
    transition: transform 0.3s ease;
    opacity: 0.7;
  }
  
  .nav-menu .hs-item-has-children.submenu-open > a::after,
  .submenu-toggle:checked ~ .menu-arrow {
    transform: rotate(180deg);
    opacity: 1;
  }
  
  /* Membership menu styling */
  .membership-menu a {
    font-size: 14px; /* Mobile membership menu items */
    padding: 0.75rem 1.5rem;
  }
  
  /* Auth links - applies to both menu types */
  .auth-links {
    border-top: 2px solid rgba(127, 131, 139, 0.24);
    margin-top: 1rem;
    padding-top: 1rem;
  }
  
  .auth-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 14px; /* Mobile membership menu items */
    font-weight: 400;
    text-align: center;
    border: 1px solid currentColor;
    border-radius: 4px;
    margin: 0.5rem 1rem;
    transition: all 0.2s ease;
  }
  
  .auth-links a:hover {
    background: var(--color-primary, #007bff);
    color: white;
    border-color: var(--color-primary, #007bff);
    transform: none;
  }
  
  .auth-links .signup-link {
    background: var(--color-primary, #007bff);
    color: white;
    border-color: var(--color-primary, #007bff);
  }
  
  .auth-links .signup-link:hover {
    background: var(--color-primary-dark, #0056b3);
    border-color: var(--color-primary-dark, #0056b3);
  }
}