/* =======================
   Layout & Fixed Header
   ======================= */

.header__container {backdrop-filter: blur(8px) !important;}

.header__container {
  position: relative;
}

/* Enable fixed header when module setting is on */
.header__container.header__container--scroll-enabled {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* subtle shadow */
  will-change: transform;
}

/* Hidden state for fixed-on-scroll behavior */
.header__container.header__container--scroll-enabled.header--hidden {
  transform: translateY(-100%);
}

/* Body padding is set dynamically by JS when fixed header is enabled */
body { padding-top: 0; }

/* Flex wrapper for header rows */
.header__wrapper {
  display: flex;
  align-items: center;
  margin: 0 auto;
}

/* =======================
   Top Bar
   ======================= */

.header__top {
  padding: 0.7rem 20px;
}

/* Hide top bar on mobile */
@media (max-width: 767px) {
  .header__top { display: none; }
}

/* =======================
   Layout: Left
   ======================= */

.header__container--left .header__language-switcher-col {
  margin-left: auto;
}

.header__container--left .header__wrapper--bottom {
  /* Desktop/tablet: keep space-between so CTA can live on the right */
  justify-content: space-between;
}

.header__container--left .header__menu-col {
  margin-left: auto;
  text-align: right;
}

.header__container--left .header__button-col {
  margin-left: 1rem;
}

/* If no menu, push CTA all the way right */
.header__container--left .header__button-col--no-menu {
  margin-left: auto;
}

/* Give desktop/tablet menu column some width to breathe */
@media (min-width: 767px) {
  .header__container--left .header__menu-col {
    flex: 2 0 0;
  }
}

/* =======================
   Layout: Centered
   ======================= */

.header__container--centered .header__button-col {
  margin-left: auto;
}

.header__container--centered .header__wrapper--bottom {
  flex-wrap: wrap;
  text-align: center;
}

.header__container--centered .header__logo-col {
  width: 100%;
  margin-bottom: 1.4rem;
}

.header__container--centered .header__menu-col {
  width: 100%;
}

@media (max-width: 767px) {
  .header__container--centered .header__wrapper--bottom {
    justify-content: space-around; /* keeps chunks spaced on small screens */
    text-align: left;
  }
  .header__container--centered .header__logo-col,
  .header__container--centered .header__menu-col {
    width: auto;
    margin-bottom: 0;
  }
}

/* =======================
   Language Switcher
   ======================= */

.header__language-switcher {
  position: relative;
  cursor: pointer;
}

.header__language-switcher .lang_switcher_class {
  position: static;
}

/* Top-level label (flag + text + chevron) */
.header__language-switcher-label {
  display: flex;
}

.header__language-switcher-current-label {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  margin-bottom: 5px;
}

.header__language-switcher-child-toggle svg {
  width: 12px; height: 12px;
  margin-left: 0.35rem;
}

/* Dropdown panel */
.header__language-switcher .lang_list_class {
  position: absolute;
  top: 100% !important; right: 0; left: auto;
  width: 200px;
  padding: 0;
  text-align: left;
  transform: none;
  opacity: 0; visibility: hidden;
  display: block;
  z-index: 99;
}

/* Open states (click or hover) */
.header__language-switcher-label--open .lang_list_class,
.header__language-switcher:hover .lang_list_class,
.header__language-switcher:focus .lang_list_class {
  opacity: 1;
  visibility: visible;
}

/* Reset boilerplate triangles if present */
.header__language-switcher .lang_list_class:after,
.header__language-switcher .lang_list_class:before {
  content: none;
}

/* List items */
.header__language-switcher .lang_list_class li {
  margin: 0; padding: 0; border: none;
}
.header__language-switcher .lang_list_class li:first-child { padding-top: 0; border-top: none; }
.header__language-switcher .lang_list_class li:last-child  { padding-bottom: 0; border-bottom: 0; }
.header__language-switcher .lang_list_class .lang_switcher_link {
  display: inline-flex;
  width: 100%;
  padding: 1rem 1.4rem;
}

/* Mobile behavior for language switcher */
@media (max-width: 767px) {
  .header__language-switcher .lang_list_class {
    position: static;
    width: 100%;
    border: none;
    display: none;
  }
  .header__language-switcher-label--open .lang_list_class { display: block; }

  .header__language-switcher-current-label {
    order: 1;
    width: 80%;
    padding: 1rem 0 1rem 1.4rem;
    margin: 0;
    display: block;
  }
  .header__language-switcher .globe_class {
    width: 100%; height: auto;
  }
  .header__language-switcher-label {
    display: flex;
    flex-wrap: wrap;
  }
}

/* Mobile chevron target area */
@media (max-width: 767px) {
  .header__language-switcher-child-toggle,
  .header__language-switcher-child-toggle:hover,
  .header__language-switcher-child-toggle:focus,
  .header__language-switcher-child-toggle:active {
    position: absolute;
    top: 0; right: 0;
    padding: 16px 30px;
    border: 0;
    cursor: pointer;
  }
  .header__language-switcher-child-toggle svg { margin-left: 0; }
  .header__language-switcher-child-toggle--open svg {
    transform: rotate(180deg);
    transform-origin: 50% 50%;
    transition: transform 0.4s;
  }
}

/* =======================
   Logo
   ======================= */

/* Desktop/tablet cap to prevent the logo from crushing the nav */
.header__logo {
  max-width: 125px; /* adjust if your desktop header allows a wider logo */
}

.header__logo img {
  max-width: 125px;
  height: auto;
}

/* =======================
   Menu (shared)
   ======================= */

.header__menu-container--mobile { display: none; }

.header__menu--mobile {
  display: none;
  position: absolute; /* opens below bottom row */
  top: 100%;
  right: 0;
  width: 100%;
  z-index: 99;
}

/* Desktop hides mobile menu; JS toggles visibility */
@media (max-width: 767px) {
  .header__menu--desktop { display: none; }
  .header__menu-container--mobile { display: block; }
  .header__menu--show { display: block; }
}

/* Menu items */
.header__menu-item {
  display: inline-flex;
  position: relative;
  cursor: pointer !important; /* keeps tap targets active */
}

.header__menu-link { width: 100%; }

/* Mobile menu items become stacked, full width */
@media (max-width: 767px) {
  .header__menu-item {
    display: block;
    width: 100%;
    text-align: left;
  }
  .header__menu-link {
    display: block;
    padding: 1rem 1.4rem;
  }
  /* When a submenu exists, reserve space for the chevron */
  .header__menu-item--has-submenu .header__menu-link { width: 80%; }
}

/* Top-level menu item padding */
.header__menu-item--depth-1 { padding: 0 1rem; }
@media (max-width: 767px) {
  .header__menu-item--depth-1 { padding: 0; }
}

/* Submenus */
.header__menu-submenu {
  position: absolute;
  top: 100%;
  left: -1px;
  width: 290px;
  text-align: left;
  display: none;
  z-index: 99;
}
.header__menu-item--open > .header__menu-submenu { display: block; }

/* Right edge protection for last item */
.header__menu-item--depth-1:last-child > .header__menu-submenu {
  left: auto;
  right: 0;
}

/* Level-3 submenu positioning */
.header__menu-submenu--level-3 {
  top: 0;
  left: 100%;
}
/* Flip level-3 for near-right-edge parents */
.header__menu-item--depth-1:nth-last-child(-n + 2) .header__menu-submenu--level-3 {
  right: 100%;
  left: auto;
  top: 0;
}

/* Submenu items inherit parent background (you style via scoped CSS) */
.header__menu-submenu .header__menu-item {
  width: 100%;
  background-color: inherit;
}
.header__menu-submenu .header__menu-link {
  display: inline-flex;
  padding: 1rem 1.4rem;
}

/* Button as a menu item */
.header__menu-item--button { padding: 1rem 1.4rem; }

/* Mobile submenu behavior: inline flow */
@media (max-width: 767px) {
  .header__menu-submenu,
  .header__menu-submenu--level-3,
  .header__menu-item--depth-1:nth-last-child(-n + 2) .header__menu-submenu--level-3 {
    position: static;
    width: 100%;
    border: none;
  }
  .header__menu-item--depth-2 > .header__menu-link { margin-left: 20px; }
  .header__menu-item--depth-3 > .header__menu-link { margin-left: 40px; }
  .header__menu-item--depth-5 > .header__menu-link,
  .header__menu-item--depth-6 > .header__menu-link,
  .header__menu-item--depth-7 > .header__menu-link,
  .header__menu-item--depth-8 > .header__menu-link,
  .header__menu-item--depth-9 > .header__menu-link,
  .header__menu-item--depth-10 > .header__menu-link {
    margin-left: 40px;
  }
}

/* =======================
   Menu Icons / Toggles
   ======================= */

/* Desktop: provide space for chevron in submenus */
@media (min-width: 767px) {
  .header__menu-submenu .header__menu-child-toggle {
    margin-left: auto;
    padding: 1rem 1.4rem;
  }
}

.header__menu-child-toggle svg {
  width: 12px; height: 12px;
  margin-left: 0.5rem;
}

/* Hide toggles by default; JS toggles visibility */
.header__menu-toggle { display: none; }
.header__menu-toggle svg { width: 30px; height: 30px; }

/* Mobile toggle button (arrow next to items with children) */
@media (max-width: 767px) {
  .header__menu-child-toggle,
  .header__menu-child-toggle:hover,
  .header__menu-child-toggle:focus,
  .header__menu-child-toggle:active {
    position: absolute;
    top: 0; right: 0;
    padding: 16px 30px;
    border: 0;
    cursor: pointer;
  }
  .header__menu-child-toggle svg { margin-left: 0; }
  .header__menu-child-toggle--open svg {
    transform: rotate(180deg);
    transform-origin: 50% 50%;
    transition: transform 0.4s;
  }
  .header__menu-toggle--show { display: block; }
}

/* =======================
   Position Helpers
   ======================= */

header.header__fixed {
  position: fixed;
  left: 0; right: 0;
  z-index: 999;
}

/* =======================
   Mobile Interaction Resets
   ======================= */

.mobile-device .header__menu-submenu *:hover,
.mobile-device .header__menu-submenu *:active,
.mobile-device .header__menu-submenu *:focus {
  /* Prevent sticky hover styles on touchscreens */
  background-color: inherit !important;
  color: inherit !important;
}

/* =======================
   Fixed Header (Mobile) Layering
   ======================= */

@media (max-width: 767px) {
  .header__container.header__container--scroll-enabled {
    z-index: 1000; /* ensure header sits above menu content */
  }
  .header__container.header__container--scroll-enabled .header__menu--mobile {
    position: absolute;
    top: 100%;
  }
  
  /* Hide the standalone header CTA on mobile */
.header__button-col { display: none; }
  
  

/* Make the CTA inside the dropdown left-aligned like other items */
.header__menu-item--cta-mobile { padding: 0; margin-top: 4px; }

.header__menu-item--cta-mobile .header__button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.4rem;         /* match menu item padding */
  border-radius: 0;             /* optional: make it look like a list row */
}

}

/* =======================
   MOBILE (<= 767px)
   - Consolidated fixes for width overflow
   - Suggestions applied: 1–3, 4B, 5–8 + nice-to-have
   ======================= */
@media (max-width: 767px) {

  /* 1–2) Wrapper breathing room + prevent horizontal scroll */
  html, body { overflow-x: hidden; }
  .header__wrapper--bottom { 
    padding: 8px 0; 
    box-sizing: border-box; 
  }

  /* 3) Logo scales with available space (no crowding) */
  .header__logo { max-width: 42vw; }
  .header__logo-image {
    height: auto;
    max-height: 40px;
    width: auto;
  }

  /* 4B) Keep CTA but make it compact */
  .header__button { 
    padding: 4px 8px; 
    font-size: 14px; 
    line-height: 1.2; 
  }

  /* 5) Hamburger spacing + keep it from stealing width */
  .header__menu-container--mobile { margin-right: 0;
                                    margin-left: 0;}
  .header__menu-toggle--open { margin-left: 0;
                               margin-right: 6px; }
  .header__container--left .header__menu-col { 
    order: -1;              /* hamburger first */
    flex: 0 0 auto; 
    margin-left: 0; 
    margin-right: 8px; 
    display: flex; 
    align-items: center; 
  }

  /* 6) Allow long labels to wrap (no overflow) */
  .header__menu-link { 
    white-space: normal; 
    line-height: 1.3; 
  }

  /* 7) Tighter padding on top-level items */
  .header__menu-item--depth-1 > .header__menu-link { 
    padding: 10px 14px; 
  }

  /* 8) Language switcher compact (keeps feature visible without crowding) */
  .header__language-switcher-current-label > span { 
    font-size: 14px; 
  }

  /* Nice-to-have: reduce gaps and prevent wrap jumps */
  .header__container--left .header__wrapper--bottom {
    justify-content: flex-start;   /* left-align row */
    align-items: center;
    gap: 8px;                      /* was 12px */
    flex-wrap: nowrap;             /* avoid layout jumps */
  }

  /* Keep CTA last and push right when space allows */
  .header__container--left .header__button-col {
    order: 1;
    margin-left: auto;
  }

  /* Mobile menu visibility + stacking (preserve your existing behavior) */
  .header__menu--desktop { display: none; }
  .header__menu-container--mobile { display: block; }
  .header__menu--mobile { 
    display: none; 
    position: absolute; 
    top: 100%; 
    right: 0; 
    width: 100%; 
    z-index: 99; 
  }
  .header__menu--show { display: block; }

  /* Mobile list item layout */
  .header__menu-item {
    display: block;
    width: 100%;
    text-align: left;
  }
  .header__menu-link {
    display: block;
    padding: 1rem 1.4rem;
  }

  /* Reserve space for chevron on items with children */
  .header__menu-item--has-submenu .header__menu-link { width: 80%; }

  /* Submenus inline on mobile */
  .header__menu-submenu,
  .header__menu-submenu--level-3,
  .header__menu-item--depth-1:nth-last-child(-n + 2) .header__menu-submenu--level-3 {
    position: static;
    width: 100%;
    border: none;
  }
  .header__menu-item--depth-2 > .header__menu-link { margin-left: 20px; }
  .header__menu-item--depth-3 > .header__menu-link { margin-left: 40px; }
  .header__menu-item--depth-5 > .header__menu-link,
  .header__menu-item--depth-6 > .header__menu-link,
  .header__menu-item--depth-7 > .header__menu-link,
  .header__menu-item--depth-8 > .header__menu-link,
  .header__menu-item--depth-9 > .header__menu-link,
  .header__menu-item--depth-10 > .header__menu-link {
    margin-left: 40px;
  }

  /* Chevron target area + state */
  .header__menu-child-toggle,
  .header__menu-child-toggle:hover,
  .header__menu-child-toggle:focus,
  .header__menu-child-toggle:active {
    position: absolute;
    top: 0; right: 0;
    padding: 16px 30px;
    border: 0;
    cursor: pointer;
  }
  .header__menu-child-toggle--open svg {
    transform: rotate(180deg);
    transform-origin: 50% 50%;
    transition: transform 0.4s;
  }

  /* Keep your existing “mobile background for top-level items” */
  .header__menu-item--depth-1 > .header__menu-link:not(.button) {
    /* background-color: rgba(92, 95, 96, 0.8); */
  }

  /* Ensure fixed-on-scroll header layers above the dropdown */
  .header__container.header__container--scroll-enabled {
    z-index: 1000;
  }
  .header__container.header__container--scroll-enabled .header__menu--mobile {
    position: absolute;
    top: 100%;
  }
  
  /* Mobile: background for top-level menu items (non-CTA) */ 
  .header__menu-item--depth-1 > .header__menu-link:not(.button) { background-color: rgba(92, 95, 96, 0.8); /* adjust to match brand */
  
}
  
  @media (max-width: 767px) {
  .header__menu-item--cta-mobile {
    padding: 0.5rem 0.5rem .5rem 0.5rem;   /* match menu padding */
  }

  .header__menu-item--cta-mobile .header__button {
    /*display: inline-block;    /* shrink to content */
    width: auto;              /* no full width */
    text-align: center;         /* left aligned */
    /* padding: 12px 16px 12px 16px !important;        /* compact pill/button sizing */
    /* border-radius: 4px;       /* optional */
     border: 1px solid #000 !important; */
    font-size: 18px !important;
    font-weight: 700 !important;
    
  }
    .header__menu-item--cta-mobile {
      background: rgba(92, 95, 96, 0.8) !important;
}

