/* Logo Styles */
.logo-group {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.header-inner {
    position: relative;
}

/* Mega Menu Styles */
.mega-menu-list {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-item {
    position: relative;
}

.mega-menu-item.dropdown-mega {
    position: static;
}

.mega-menu-item > a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: {% if use_custom %}{% else %}#ffffff{% endif %};
    font-weight: 500;
    text-decoration: none;
    padding: 10px 4px;
    transition: color 0.2s ease;
    font-size: 1.05rem; /* <-- INCREASED: Changed from 0.95rem */
}

.mega-menu-item > a:hover {
    color: {% if use_custom %}{% else %}#3b82f6{% endif %};
}

/* Hide any extra arrows from global CSS */
.mega-menu-item > a::after,
.mega-menu-list .hs-menu-children-wrapper::before {
    display: none !important;
    content: none !important;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
    flex-shrink: 0;
}

.mega-menu-item:hover .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ========================================
   DROPDOWN SHARED STYLES
======================================== */

/* Simple Dropdown */
.simple-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 8px !important;
    margin-top: 8px !important;
    min-width: 200px !important;
    list-style: none !important;
    display: none !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4) !important;
    z-index: 99999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.simple-dropdown::before {
    content: "" !important;
    position: absolute !important;
    top: -8px !important;
    left: 0 !important;
    right: 0 !important;
    height: 8px !important;
}

.mega-menu-item:hover .simple-dropdown,
.mega-menu-item.has-dropdown:hover .simple-dropdown {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.simple-dropdown li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.simple-dropdown li a {
    display: block !important;
    padding: 12px 16px !important;
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    background: transparent !important;
}

.simple-dropdown li a:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #ffffff !important;
}

/* ========================================
   MEGA DROPDOWN STYLES
======================================== */

.mega-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 32px;
    width: max-content;
    max-width: min(var(--container-width), calc(100vw - 40px));
    margin: 0;
    display: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    z-index: 99999;
}

.mega-menu-item:hover .mega-dropdown,
.mega-menu-item.has-dropdown:hover .mega-dropdown {
    display: block !important;
}

.mega-dropdown-columns {
    display: flex;
    gap: 32px;
}

.mega-column {
    min-width: 160px;
    flex-shrink: 0;
}

.mega-column:first-child {
    padding-left: 0;
}

.mega-column:last-child {
    padding-right: 0;
}

.mega-column-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0 0 12px;
    padding: 0 8px;
    font-weight: 600;
}

.mega-column-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.mega-column-links li {
    margin-bottom: 2px;
    list-style: none !important;
}

.mega-column-links li a {
    display: block;
    padding: 8px 0;
    text-decoration: none !important;
    color: #e2e8f0 !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.15s ease;
    line-height: 1.4;
}

.mega-column-links li a:hover {
    color: #3b82f6 !important;
}

.mega-featured {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #334155;
    grid-column: 1 / -1;
}

.mega-featured h5 {
    font-size: 0.9rem;
    margin: 0 0 6px;
    color: #ffffff;
    font-weight: 600;
}

.mega-featured p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 12px;
    line-height: 1.5;
}

.mega-featured-link {
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mega-featured-link:hover {
    color: #60a5fa;
}

/* Mobile Menu */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-background);
    border-top: 1px solid var(--color-border);
    padding: 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 999;
}

.mobile-nav.open {
    display: block !important;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-item > a,
.mobile-nav-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 0;
    color: {% if use_custom %}{% else %}var(--color-text){% endif %};
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
}

.mobile-nav-toggle svg {
    transition: transform 0.2s ease;
}

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

.mobile-submenu {
    display: none;
    padding-bottom: 16px;
}

.mobile-nav-item.open .mobile-submenu {
    display: block;
}

.mobile-submenu a {
    display: block;
    padding: 10px 16px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
}

.mobile-submenu a:hover {
    color: var(--color-primary);
}

.mobile-submenu-group {
    margin-bottom: 16px;
}

.mobile-submenu-title {
    display: block;
    padding: 8px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Header CTA Button */
.header-cta .btn,
.header-cta .btn.btn-primary {
    display: inline-block;
    padding: 8px 24px; /* <-- CHANGED: Reduced top/bottom padding from 12px to 8px to reduce height */
    {% if use_custom %}
    background-color:  !important;
    color:  !important;
    {% else %}
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    {% endif %}
    border-radius: 24px !important; /* <-- CHANGED: Overrides the global theme variable to force the rounded look */
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.header-cta .btn:hover,
.header-cta .btn.btn-primary:hover {
    {% if use_custom %}
    background-color:  !important;
    color:  !important;
    {% else %}
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    {% endif %}
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: {% if use_custom %}{% else %}#ffffff{% endif %};
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.15);
}

/* ========================================
   RESPONSIVE STYLES
======================================== */

@media (max-width: 991px) {
    .mega-nav {
        display: none !important;
    }
    
  /* ADD THIS TO OVERRIDE THE THEME RULE */
.header-inner .mega-nav.open,
.header-inner .mega-nav.nav-links--open {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #020617; /* Dark blue background */
    flex-direction: column;
    padding: 20px;
    z-index: 10000;
}
  
    .mobile-menu-toggle {
        display: flex !important;
      position: relative;
        z-index: 10001;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .header-cta .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    /* Hide language switcher on mobile */
    .header-actions .hs-language-switcher {
        display: block;
    }
}

@media (min-width: 992px) {
    .mobile-nav,
    .mobile-menu-toggle {
        display: none !important;
    }
}
  
  @media (max-width: 991px) {
    /* Ensure the mobile nav is actually sitting on top of the search bar */
    .mobile-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #020617 !important; /* Forces the dark color */
        z-index: 10000 !important; /* One level higher than search overlay */
    }

    .mobile-nav.open {
        display: block !important;
    }
    
    /* This ensures the hamburger button is clickable */
    .header-actions {
        position: relative;
        z-index: 10001 !important;
    }
    .top-links ul {
      gap: 10px !important;
    flex-wrap: wrap;
    }
}
  
  /* Container for the white top bar */
.header-top {
  background-color: #060623;
    border-bottom: 1px solid #24244275;
    margin-bottom: 5px;
}

.header-top-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
 /* max-width: 1200px;  Adjust to match your site width */
  margin: 0 auto;
  padding: 0 20px;
}

/* Forces the HubSpot Menu to be a single horizontal line */
.top-links ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  gap: 24px;
}

.top-links ul li {
  margin: 0 !important;
}

.top-links ul li a {
  text-decoration: none !important;
  color: #c2dff0 !important; /* Professional grey */
  font-size: 13px;
  font-weight: 400;
  transition: color 0.2s;
}

.top-links ul li a:hover {
  color: #3b82f6 !important;
}

/* Hides any accidental dropdowns in the top bar */
.top-links .hs-menu-children-wrapper {
  display: none !important;
}
 
 .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-icon-btn {
    background: none;
    border: none;
    color: #ffffff; /* Adjust based on your header color */
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.search-icon-btn:hover {
    transform: scale(1.1);
}

/* Overlay Background */
.navigation-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    padding: 15px 0 50px; /* More bottom padding for whitespace */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: none;
    z-index: 9999;
  pointer-events: none; 
    visibility: hidden;
}

.navigation-search-overlay.active {
    display: block;
    animation: slideDown 0.3s ease-out;
  pointer-events: auto;
    visibility: visible;
}

.search-inner-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Close button alignment */
.close-trigger-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.close-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    padding: 5px;
    display: flex;
    transition: opacity 0.2s;
}

.close-search-btn:hover { opacity: 0.6; }

/* The Rounded Search Bar */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-field {
    width: 100%;
    padding: 15px 50px 15px 25px; /* Space for the icon on the right */
    background: #f4f5f7; /* Light grey background */
    border: 1px solid #080831;
    border-radius: 12px; /* Rounded corners */
    font-size: 16px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}

.search-input-field:focus {
    border-color: #cbd5e0;
}
  .search-input-field::placeholder {
    color: #000000;
}

/* Search Icon inside the input */
.search-submit-icon {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}
  
/* 1. Restore scrolling for the page */
html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
}

/* 2. Fix the Header (Position Fixed is safer than Sticky here) */
header.header.header--sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background-color: #020617 !important; /* Matches your dark blue theme */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 3. Fix the "Messi" look by ensuring internal alignment */
header.header--sticky .header-inner {
    max-width: 1200px; /* Adjust this to match your site's container width */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

/* 4. Push the page content down so it's not hidden behind the fixed header */
body {
    padding-top: 140px !important; /* Adjust this number to match the height of your header */
}

/* 1. Container & Bridge Logic */
.top-actions {
    display: flex !important;
    align-items: center;
    position: relative;
    padding: 10px 0; /* Creates hover area so menu stays open */
}

.custom-language-selector {
    position: relative;
    display: inline-block;
  list-style: none !important;
}

/* 2. Visible Toggle (Globe + Name + Arrow) */
.lang-current-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

/* Force White Globe Icon */
.custom-language-selector .globe-icon {
    width: 18px;
    height: 18px;
    background-image: url('https://static.hsappstatic.net/cos-LanguageSwitcher/static-1.11/img/globe.png');
    background-size: contain;
    background-repeat: no-repeat;
    filter: invert(100%) brightness(200%);
    margin-right: 8px;
}

/* V-Shape Arrow */
.arrow-v {
    width: 5px;
    height: 5px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
    margin-left: 8px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

/* 3. The Dropdown List */
ul.lang-dropdown-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    position: absolute;
    top: 100%;
    right: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    min-width: 140px;
    display: none; /* Hidden by default */
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* The "Invisible Bridge" - prevents menu from closing when moving mouse down */
.lang-dropdown-list::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

/* 4. Hover Interactions */
.custom-language-selector:hover .lang-dropdown-list {
    display: block;
}

.custom-language-selector:hover .arrow-v {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}

/* 5. Dropdown Item Styling */
ul.lang-dropdown-list li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.lang-dropdown-list li a {
    display: block !important;
    padding: 10px 20px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    text-align: left !important;
}

/* Hover logic */
.custom-language-selector:hover .lang-dropdown-list {
    display: block !important;
}

.lang-dropdown-list li.active a {
    color: #3b82f6 !important;
    font-weight: bold;
}
.lang-dropdown-list li.active {
    background: rgba(255,255,255,0.05);
    color: #3b82f6;
    font-weight: bold;
}

/* Hide standard HubSpot switcher if it tries to appear */
.hs-language-switcher {
    display: none !important;
}