﻿    /* =========================================================
       3. HEADER Y NAVEGACIÓN PRINCIPAL
    ========================================================= */
    header {
      position: sticky;
      top: 0;
      margin: 0;
      padding: 0;
      z-index: 1000;
      backdrop-filter: blur(24px);
      -webkit-backdrop-filter: blur(24px);
      background: rgba(255, 255, 255, 0.85);
      border-bottom: 1px solid rgba(255, 255, 255, 0.8);
      width: 100%;
      box-shadow: 0 12px 32px rgba(11, 61, 145, 0.06);
      transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }
    
    header:hover {
      background: rgba(255, 255, 255, 0.95);
      box-shadow: 0 16px 40px rgba(11, 61, 145, 0.1);
    }

    .nav {
      min-height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      padding: 0 8px;
      max-width: var(--container);
      margin: 0 auto;
      width: min(var(--container), calc(100% - 16px));
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 16px;
      transition: opacity 0.3s ease;
    }

    .brand:hover {
      opacity: 0.85;
    }

    .brand-logo {
      height: 48px;
      width: auto;
      object-fit: contain;
      filter: drop-shadow(0 4px 6px rgba(11, 61, 145, 0.08));
    }

    .menu {
      display: flex;
      align-items: center;
      gap: 12px;
      list-style: none;
    }

    /* Make dropdown parents relative so absolute positioning works */
    .menu li {
      position: relative;   
    }

    .menu > li > a {
      color: var(--gray-700);
      font-weight: 600;
      font-size: 0.94rem;
      padding: 10px 14px;
      border-radius: 999px;
      transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
      display: inline-flex;
      align-items: center;
      position: relative;
      white-space: nowrap;
    }

    .menu > li > a::after {
      content: '';
      position: absolute;
      bottom: 4px;
      left: 50%;
      transform: translateX(-50%) scaleX(0);
      width: 18px;
      height: 3px;
      border-radius: 999px;
      background: var(--blue-800);
      transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
      opacity: 0;
    }

    .menu > li > a:hover {
      color: var(--blue-900);
      background: rgba(11, 61, 145, 0.04);
    }
    
    .menu > li > a:hover::after {
      transform: translateX(-50%) scaleX(1);
      opacity: 1;
    }

    .arrow {
      font-size: 0.75rem;
      margin-left: 6px;
      transition: transform 0.3s ease;
      display: inline-block;
    }

    /* Submenus - correctly absolutely positioned */
    .has-dropdown {
      position: relative; /* Extra safety */
    }

    .dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      background: #ffffff;
      min-width: 200px;
      border-radius: 12px;
      padding: 8px 0;
      box-shadow: 0 16px 36px rgba(11, 61, 145, 0.12);
      border: 1px solid rgba(11, 61, 145, 0.08);
      opacity: 0;
      visibility: hidden;
      transform: translateY(15px);
      transition: all 0.3s ease;
      list-style: none;
      display: flex;
      flex-direction: column;
      z-index: 1050;
      gap: 0; /* Reset gap from .menu */
    }

    .menu li.has-dropdown.open > .dropdown,
    .menu li.has-dropdown.is-hover-open > .dropdown {
      opacity: 1;
      visibility: visible;
      transform: translateY(4px);
    }

    .menu li.has-dropdown.open .arrow,
    .menu li.has-dropdown.is-hover-open .arrow {
      transform: rotate(180deg);
    }

    .dropdown li {
      width: 100%;
      display: block; /* Reset display flex from .menu li */
    }

    .dropdown a {
      color: var(--gray-700);
      font-weight: 500;
      font-size: 0.9rem;
      padding: 10px 20px;
      display: block;
      transition: all 0.2s ease;
      border-radius: 0;
      white-space: nowrap;
    }

    .dropdown a::after {
      display: none; /* No animated underline inside dropdowns */
    }

    .dropdown a:hover {
      background: var(--blue-050);
      color: var(--blue-900);
      padding-left: 24px;
    }

    /* Nav Actions (Botones) */
    .nav-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .nav-actions .btn,
    .nav-actions .btn-outline {
      height: 44px;
      line-height: 42px; /* Center text vertically */
      padding: 0 20px;
      font-size: 0.94rem;
      white-space: nowrap;
    }

    .btn,
    .btn-outline {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      font-weight: 700;
      transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
      cursor: pointer;
      border: none;
      letter-spacing: -0.01em;
      white-space: nowrap;
    }

    .btn {
      background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-900) 100%);
      color: var(--white);
      box-shadow: 0 10px 20px rgba(11, 61, 145, 0.16), inset 0 2px 0 rgba(255,255,255,0.1);
    }

    .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 14px 28px rgba(11, 61, 145, 0.24), inset 0 2px 0 rgba(255,255,255,0.1);
      background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-800) 100%);
    }

    .btn-outline {
      background: rgba(255, 255, 255, 0.6);
      color: var(--blue-900);
      border: 1.5px solid rgba(11, 61, 145, 0.15);
      backdrop-filter: blur(8px);
    }

    .btn-outline:hover {
      background: var(--white);
      border-color: rgba(11, 61, 145, 0.3);
      transform: translateY(-2px);
    }

    .btn-login-soft {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 96px;
      height: 44px;
      padding: 0 18px;
      border-radius: 12px;
      font-size: 0.94rem;
      font-weight: 700;
      color: #0f3f83;
      background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
      border: 1px solid rgba(59, 130, 246, 0.28);
      box-shadow: 0 8px 18px rgba(59, 130, 246, 0.14);
      transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
      white-space: nowrap;
    }

    .btn-login-soft:hover {
      transform: translateY(-2px);
      background: linear-gradient(135deg, #c7e0ff 0%, #a9cfff 100%);
      box-shadow: 0 12px 24px rgba(59, 130, 246, 0.2);
    }

    .menu-toggle {
      display: none;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 1px solid rgba(11, 61, 145, 0.15);
      background: rgba(255,255,255,0.8);
      font-size: 1.2rem;
      color: var(--blue-900);
      cursor: pointer;
      transition: all 0.3s ease;
    }
    
    .menu-toggle:hover {
      background: var(--blue-050);
    }

    .mobile-menu {
      display: none;
      padding: 0 24px 24px;
    }

    .mobile-menu.active {
      display: block;
      animation: slideDown 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }
    
    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .mobile-menu ul {
      list-style: none;
      display: grid;
      gap: 10px;
      padding-top: 16px;
      border-top: 1px solid rgba(11, 61, 145, 0.08);
    }

    .mobile-menu a {
      display: block;
      padding: 14px 20px;
      border-radius: 16px;
      background: rgba(255,255,255,0.6);
      color: var(--gray-700);
      border: 1px solid rgba(11, 61, 145, 0.08);
      font-weight: 700;
      transition: all 0.2s ease;
    }
    
    .mobile-menu a:hover, .mobile-menu a:active {
      background: var(--blue-050);
      color: var(--blue-900);
      border-color: rgba(11, 61, 145, 0.2);
    }

