/* ========== HEADER — 2-ROW RED (Based on staging) ========== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: white;
  border-top: 4px solid #EE3124;
}

/* Top bar: logo + secondary menu (Empresa, Contato, PEAD) + WhatsApp + Search */
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}

.header-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.header-logo img {
  height: 44px;
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
  filter: none;
}

.header-top-right {
  display: flex; align-items: center; gap: 24px;
}

.header-secondary-menu {
  display: flex; align-items: center; gap: 0;
}

.header-secondary-menu a {
  padding: 5px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--gray11);
  transition: background 0.18s;
  letter-spacing: 0.3px;
  border-radius: 4px;
}
.header-secondary-menu a:hover { background: rgba(0,0,0,0.06); opacity: 1; }

/* Dropdown arrow for Empresa */
.header-secondary-menu .has-dropdown { position: relative; cursor: pointer; }
.header-secondary-menu > a,
.header-secondary-menu .has-dropdown > a { text-transform: uppercase; }
.header-secondary-menu .has-dropdown .dropdown-arrow {
  display: inline-block; margin-left: 4px; font-size: 10px;
  color: var(--gray11); vertical-align: middle;
  transition: transform 0.2s;
}
/* dropdown-arrow now uses stroke="currentColor", inherits from parent a */
.header-secondary-menu .has-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}
.header-secondary-menu .has-dropdown .dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-radius: 0 0 8px 8px; padding: 8px 0; z-index: 100;
}
.header-secondary-menu .has-dropdown:hover .dropdown { display: block; }
.header-secondary-menu .dropdown a {
  display: block; padding: 8px 20px;
  color: var(--gray11); font-size: 13px;
}
.header-secondary-menu .dropdown a:hover {
  background: var(--light-bg); color: var(--red); opacity: 1;
}

.header-top-icons {
  display: flex; align-items: center; gap: 8px;
  border-left: 1px solid rgba(0,0,0,0.12);
  padding-left: 16px; margin-left: 8px;
}

.header-top-icons a {
  color: var(--gray11); display: flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  transition: opacity 0.2s;
}
.header-top-icons a:hover { opacity: 0.8; }
.header-top-icons .icon-svg { width: 18px; height: 18px; fill: currentColor; }

/* Language switcher — base */
.header-lang-switcher {
  position: relative;
  display: flex; align-items: center;
  z-index: 1100;
}
.header-lang-switcher .lang-current {
  display: flex; align-items: center; gap: 5px;
  background: transparent; border: 0; cursor: pointer;
  padding: 5px 8px; font: inherit;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; line-height: 1;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}
.header-lang-switcher .lang-current svg { transition: transform 0.2s; }
.header-lang-switcher:hover .lang-current svg,
.header-lang-switcher.open .lang-current svg { transform: rotate(180deg); }
.header-lang-switcher .lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  min-width: 64px; padding: 4px 0;
  display: none; z-index: 1200;
}
/* Invisible bridge to keep :hover alive across the gap between button and dropdown */
.header-lang-switcher::after {
  content: ''; position: absolute;
  top: 100%; right: 0; left: 0; height: 8px;
  display: none;
}
.header-lang-switcher:hover::after,
.header-lang-switcher.open::after { display: block; }
.header-lang-switcher:hover .lang-dropdown,
.header-lang-switcher.open .lang-dropdown { display: block; }
.header-lang-switcher .lang-dropdown a {
  display: block; padding: 7px 14px;
  color: var(--gray11); text-decoration: none !important;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: center;
  width: auto !important; height: auto !important;
}
.header-lang-switcher .lang-dropdown a:hover { background: var(--gray2); opacity: 1; }

/* Top variant — white bar, dark text */
.header-lang-switcher--top { margin-right: 4px; }
.header-lang-switcher--top .lang-current { color: var(--gray11); }
.header-lang-switcher--top .lang-current:hover { background: rgba(0,0,0,0.05); }

/* Bottom variant — red bar, white text, separator before social */
.header-lang-switcher--bottom {
  margin-left: auto; margin-right: 14px;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.25);
  display: none; /* shown only when scrolled */
}
.header-lang-switcher--bottom .lang-current { color: #fff; }
.header-lang-switcher--bottom .lang-current:hover { background: rgba(255,255,255,0.14); }

/* Toggle visibility based on scroll state */
.site-header.scrolled .header-lang-switcher--bottom { display: flex; }

/* Bottom bar: main nav + social icons */
.header-bottom {
  background: var(--red);
  border-top: 3px solid var(--gray4);
  transition: border-top-color 0.25s ease;
}

.site-header.scrolled .header-bottom {
  border-top: 0;
}

.header-bottom-inner {
  display: flex; align-items: center; justify-content: flex-start;
  height: 48px;
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}

.header-main-menu {
  display: flex; align-items: center; gap: 0;
}

.header-main-menu > li { position: relative; }

.header-main-menu > li > a {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 5px;
  transition: background 0.18s, color 0.18s;
  position: relative;
}
.header-main-menu > li > a:hover,
.header-main-menu > li:hover > a {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  opacity: 1;
}

/* Sub-menu dropdown: item hover com fundo vermelho */
.header-main-menu .sub-menu li a:hover {
  background: var(--red); color: var(--white); font-weight: 700;
}

.header-main-menu > li > a .arrow {
  display: inline-block; width: 10px; height: 6px; margin-left: 4px;
  vertical-align: middle; opacity: 0.85;
  transition: transform 0.2s;
}
.header-main-menu > li:hover > a .arrow {
  transform: rotate(180deg);
}

/* Main menu dropdowns */
.header-main-menu > li > .sub-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 0 0 8px 8px; padding: 8px 0; z-index: 100;
}
.header-main-menu > li:hover > .sub-menu { display: block; }
.header-main-menu .sub-menu li a {
  display: block; padding: 8px 20px;
  font-size: 13px; color: var(--gray11);
  font-weight: 400; text-transform: none; letter-spacing: 0;
  transition: background-color 0.2s, color 0.2s;
}

.header-social {
  display: flex; align-items: center; gap: 12px;
  margin-left: auto;
}

.header-social a {
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  transition: opacity 0.2s;
}
.header-social a:hover { opacity: 0.7; }
.header-social .icon-svg { width: 18px; height: 18px; fill: currentColor; }

/* ========== FLYOUT MENU (3 nivel) ========== */
.header-main-menu .sub-menu li.has-flyout { position: relative; }
.header-main-menu .sub-menu li.has-flyout > a {
  display: flex; align-items: center; justify-content: space-between;
  padding-right: 14px;
}
.flyout-arrow { width: 6px; height: 10px; flex-shrink: 0; margin-left: 8px; }
.header-main-menu .flyout-menu {
  display: none;
  position: absolute; top: 0; left: 100%;
  background: var(--white); min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 0 8px 8px 0; padding: 8px 0; z-index: 101;
}
.header-main-menu .sub-menu li.has-flyout:hover > .flyout-menu { display: block; }
.header-main-menu .flyout-menu li a {
  display: block; padding: 8px 20px;
  font-size: 13px; color: var(--gray11);
  font-weight: 400; transition: background-color 0.2s, color 0.2s;
}
.header-main-menu .flyout-menu li a:hover {
  background: var(--red); color: var(--white); font-weight: 700;
}

/* Mobile: flyout vira lista indentada */
@media (max-width: 1024px) {
  /* Neutraliza hover do flyout no mobile (hover fica grudado em touch) */
  .header-main-menu.mobile-open .sub-menu li.has-flyout:hover > .flyout-menu { display: none; }
  .header-main-menu.mobile-open .flyout-menu {
    display: none; position: static;
    box-shadow: none; border-radius: 0;
    background: #eaeaea; padding: 0;
  }
  /* !important para garantir que mob-open sempre vence o hover residual */
  .header-main-menu.mobile-open li.has-flyout.mob-open > .flyout-menu { display: block !important; }
  .header-main-menu.mobile-open .flyout-menu li a {
    padding: 10px 52px; font-size: 12px;
    color: #333 !important; border-bottom: 1px solid #ddd;
  }
  .header-main-menu.mobile-open .flyout-menu li a:hover {
    background: var(--red) !important; color: var(--white) !important; font-weight: 700 !important;
  }
}

/* ========== STICKY COMPACT HEADER on scroll ========== */
/* Smooth transition: header-top slides up, compact logo fades in */
.header-top {
  max-height: 64px;
  overflow: visible;
  position: relative;
  z-index: 2;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.site-header.scrolled .header-top {
  max-height: 0;
  opacity: 0;
}

.site-header .header-bottom-logo {
  display: flex;
  align-items: center;
  margin-right: 16px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: max-width 0.35s ease 0.1s, opacity 0.3s ease 0.15s;
}
.site-header .header-bottom-logo img {
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}

.site-header.scrolled .header-bottom-logo {
  max-width: 192px;
  opacity: 1;
}

.site-header.scrolled .header-bottom-logo img {
  height: 53px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Logo mobile hidden by default (desktop), shown in mobile media query */
.header-bottom-logo .logo-mobile { display: none; }

/* Mobile secondary menu hidden on desktop */
.mobile-secondary-menu { display: none; }

.header-bottom-inner {
  transition: height 0.3s ease;
}

.site-header.scrolled .header-bottom-inner {
  height: 58px;
}

.site-header {
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* ── Search button (desktop top bar) ── */
.header-search-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: inherit; display: inline-flex; align-items: center; justify-content: center;
  opacity: .85; transition: opacity .15s;
}
.header-search-btn:hover { opacity: 1; }

/* ── Search overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,10,10,.88);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
  opacity: 0; transition: opacity .22s ease;
  pointer-events: none;
}
.search-overlay:not([hidden]) { opacity: 1; pointer-events: auto; }

.search-overlay__inner {
  width: 100%; max-width: 680px; padding: 0 24px;
  position: relative;
}
.search-overlay__form {
  display: flex; align-items: center;
  border-bottom: 2px solid rgba(255,255,255,.35);
  transition: border-color .2s;
}
.search-overlay__form:focus-within { border-color: var(--white); }

.search-overlay__input {
  flex: 1; background: none; border: none; outline: none;
  font-size: clamp(22px, 4vw, 34px); font-weight: 300; color: var(--white);
  padding: 12px 0; caret-color: var(--red);
}
.search-overlay__input::placeholder { color: rgba(255,255,255,.35); }

.search-overlay__submit {
  background: none; border: none; cursor: pointer; padding: 8px;
  color: rgba(255,255,255,.6); display: flex; flex-shrink: 0;
  transition: color .15s;
}
.search-overlay__submit:hover { color: var(--white); }
.search-overlay__submit svg { width: 28px; height: 28px; fill: currentColor; }

.search-overlay__close {
  position: absolute; top: -52px; right: 24px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.6); display: flex; transition: color .15s;
}
.search-overlay__close:hover { color: var(--white); }
.search-overlay__close svg { width: 32px; height: 32px; fill: currentColor; }

/* Mobile hamburger */
.nav-hamburger {
  display: none; flex-direction: column;
  gap: 6px; cursor: pointer; padding: 10px;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger span {
  width: 28px; height: 3px; background: var(--white);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s, width 0.2s;
  transform-origin: center;
  display: block;
  border-radius: 2px;
}
