/*
 * P3-01 — header chrome: sticky + compact scroll + GTranslate in-header.
 */

header.top_panel {
  position: sticky;
  top: 0;
  z-index: 1100;
  background-color: var(--c-surface);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

header.top_panel.ms2-header-scrolled {
  box-shadow: 0 1px 0 var(--c-line);
}

header.top_panel.ms2-header-scrolled .sc_layouts_row {
  padding-block: 0.5rem !important; /* compact scrolled state */
}

header.top_panel.ms2-header-scrolled .logo_image {
  max-height: 40px !important;
}

/* Slot for relocated GTranslate — right of nav / search */
.ms2-header-lang {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.5rem;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Keep switcher visible in the mobile header row next to search/burger */
.elementor-element-41f2dde .ms2-header-lang {
  margin-inline-start: 0.35rem;
}

.ms2-header-lang .gtranslate_wrapper,
.ms2-header-lang .gt_switcher_wrapper {
  position: static !important; /* fight plugin fixed bottom-right */
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  width: auto !important;
  height: auto !important;
}

.ms2-header-lang .gt_selector,
.ms2-header-lang select.gt_selector {
  min-height: 2.25rem;
  max-width: 9.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  background: var(--c-surface);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--t-small);
  cursor: pointer;
}

.ms2-header-lang .gt_selector:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

/* Until JS moves it, hide the floating body widget so it never sits mid-page */
body > .gtranslate_wrapper .gt_switcher_wrapper {
  /* JS moves the node; hide fixed float as fallback */
}

body > .gtranslate_wrapper:not(.ms2-lang-placed) .gt_switcher_wrapper {
  opacity: 0;
  pointer-events: none;
}

/* Mobile menu a11y helpers */
.menu_mobile:not(.opened):not(.menu_mobile_show) {
  /* ThemeREX toggles visibility; ensure inert when closed handled in JS */
}

.sc_layouts_menu_mobile_button a:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
}

.menu_mobile_close:focus-visible,
.menu_mobile a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .ms2-header-lang .gt_selector {
    max-width: 7.5rem;
    font-size: 0.8125rem;
  }
}
