/* =========================================
   1. Wrapper: Adjusted for Perfect Alignment
   ========================================= */
.language-globe-wrapper {
  position: relative;
  display: inline-block;    /* Keeps it next to the search icon */
  vertical-align: top;      /* Aligns to the top of the header row */
  
  /* ALIGNMENT FIX: 
     Search has 15px padding + 32px height (Center = 31px).
     Globe has 22px height. To hit center 31px, we need ~20-21px padding. */
  padding-top: 18px;        
  
  margin-left: 10px;
  line-height: 1;
}

/* =========================================
   2. The Globe Button
   ========================================= */
.globe-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: block;
  transition: opacity 0.3s, color 0.3s ease;
  
  /* Default: White */
  color: #ffffff; 
}

/* Scrolled State: Switch to Black */
header.active .globe-btn,
.main-navigation.active .globe-btn {
  color: #000000 !important;
}

/* SVG Sizing */
.globe-btn svg {
  width: 23px;
  height: 23px;
  display: block;
}

.globe-btn:hover {
  opacity: 0.9;
}

/* =========================================
   3. The Dropdown Menu
   ========================================= */
.lang-dropdown {
  display: none;            /* Hidden by default */
  position: absolute;
  top: 100%;
  right: -5px;
  background-color: #ffffff;
  min-width: 140px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.15);
  border-radius: 4px;
  z-index: 9999;
  list-style: none !important;
  padding: 10px 0;
  margin-top: 10px;         
  text-align: left;
}

/* Bridge to prevent closing on mouse move */
.lang-dropdown::before {
  content: "";
  display: block;
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
}

/* Visible State */
.lang-dropdown.show {
  display: block !important;
}

/* =========================================
   4. Dropdown Links
   ========================================= */
.lang-dropdown li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang-dropdown a {
  display: block;
  padding: 10px 20px;
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.lang-dropdown a:hover {
  background-color: #f5f5f5;
  color: #000;
}

.lang-dropdown a.active {
  font-weight: 700;
  color: #000;
  background-color: #fafafa;
}

/* =========================================
/* =========================================
   MOBILE / TABLET FIXES (Max-width: 1140px)
   ========================================= */
@media (max-width: 1140px) {
  
  /* 1. HIDE THE SEARCH ICON */
  .navigation-search-tab, 
  #navigation-search-tab {
    display: none !important;
  }

  /* 2. GLOBE POSITIONING */
  .language-globe-wrapper {
    /* Reset vertical alignment */
    padding-top: 0px !important;     
    
    /* FORCE RIGHT ALIGNMENT: Pushes globe to the right now that search is gone */
    margin-left: auto !important;
    
    /* Keep space for the Burger Menu on the right */
    margin-right: 40px;              
    
    display: inline-block;
    vertical-align: middle;
    height: auto;
  }

  /* Icon Size */
  .globe-btn svg {
    width: 24px;
    height: 24px;
  }
  
  /* Dropdown Menu Position */
  .lang-dropdown {
    right: -50px;       
    top: 140%;          
  }
}
