/* =========================================================
   GRIDLAB — HEADER E FOOTER GLOBAIS
   Edite este arquivo para alterar o visual comum a todas as páginas.
   ========================================================= */
:root {
  --site-red: #e0001b;
  --site-red-strong: #b60016;
  --site-text: #202124;
  --site-muted: #666a70;
  --site-line: #e3e3e5;
  --site-dark: #151516;
  --site-header-bg: #ffffff;
  --site-shell-width: 1280px;
}

.site-shell-container {
  width: min(var(--site-shell-width), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--site-header-bg) !important;
  border-bottom: 1px solid rgba(224, 0, 27, .16) !important;
  box-shadow: 0 7px 24px rgba(30, 22, 24, .045);
  isolation: isolate;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.site-header::before {
  left: 0;
  bottom: 0;
  width: min(380px, 34vw);
  height: 4px;
  background: linear-gradient(90deg, var(--site-red) 0%, var(--site-red) 44%, rgba(224,0,27,.34) 72%, transparent 100%);
}

.site-header::after {
  right: 2.8%;
  top: 0;
  width: 112px;
  height: 5px;
  background: var(--site-red);
  transform: skewX(-34deg);
  box-shadow: -25px 12px 0 -2px rgba(224,0,27,.55);
}

.site-header .navbar {
  position: relative;
  z-index: 2;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

/* Circuito vermelho global do menu */
.site-header .navbar::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: 5px;
  right: 0;
  width: min(660px, 58vw);
  height: calc(100% - 10px);
  opacity: .42;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 90'%3E%3Cg fill='none' stroke='%23e0001b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.9'%3E%3Cpath d='M700 12H620l-18 18h-68l-18 18h-78'/%3E%3Cpath d='M700 31h-46l-20 20h-75l-14 14h-82'/%3E%3Cpath d='M700 70h-88l-16-16h-56l-18-18h-58'/%3E%3Cpath d='M600 8v16M560 54v18M504 29v18M452 43v20'/%3E%3Ccircle cx='620' cy='12' r='4' fill='%23e0001b'/%3E%3Ccircle cx='602' cy='30' r='4' fill='%23e0001b'/%3E%3Ccircle cx='654' cy='31' r='4' fill='%23e0001b'/%3E%3Ccircle cx='612' cy='70' r='4' fill='%23e0001b'/%3E%3Ccircle cx='540' cy='54' r='4' fill='%23e0001b'/%3E%3Ccircle cx='504' cy='47' r='4' fill='%23e0001b'/%3E%3Ccircle cx='452' cy='63' r='4' fill='%23e0001b'/%3E%3C/g%3E%3C/svg%3E");
}

.site-header .brand {
  width: 250px;
  height: 68px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 3;
}

.site-header .brand img {
  width: auto;
  height: 58px;
  max-width: 100%;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 3;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 3px;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-link,
.nav-toggle-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--site-text);
  cursor: pointer;
  font-size: .93rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}

.nav-link::after,
.nav-toggle-link::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 4px;
  height: 3px;
  border-radius: 99px;
  background: var(--site-red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .24s ease;
}

.nav-link:hover::after,
.nav-toggle-link:hover::after,
.nav-link.is-current::after,
.nav-toggle-link.is-current::after,
.nav-item:focus-within > .nav-toggle-link::after {
  transform: scaleX(1);
}

.nav-link:hover,
.nav-toggle-link:hover,
.nav-link.is-current,
.nav-toggle-link.is-current,
.nav-item:focus-within > .nav-toggle-link {
  color: var(--site-red);
  background: rgba(255,255,255,.84);
}

.nav-toggle-link svg {
  width: 14px;
  height: 14px;
  transition: transform .22s ease;
}

.nav-item:hover > .nav-toggle-link svg,
.nav-item:focus-within > .nav-toggle-link svg,
.nav-item.open > .nav-toggle-link svg {
  transform: rotate(180deg);
}

/* Submenu sempre branco, inclusive no modo escuro. */
.dropdown,
html[data-theme="eco"] .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 265px;
  padding: 11px 9px 9px;
  overflow: hidden;
  background: #fff !important;
  border: 1px solid rgba(224, 0, 27, .18) !important;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(28, 24, 26, .14) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.dropdown::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 4px;
  border-radius: 0 0 99px 99px;
  background: linear-gradient(90deg, var(--site-red) 0%, var(--site-red) 58%, rgba(224,0,27,.18) 100%);
  pointer-events: none;
}

.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown,
.nav-item.open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown a,
html[data-theme="eco"] .dropdown a {
  position: relative;
  display: block;
  padding: 11px 12px 11px 17px;
  border-radius: 8px;
  color: #5f6065 !important;
  background: transparent !important;
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}

.dropdown a::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 99px;
  background: var(--site-red);
  transform: translateY(-50%);
  transition: height .18s ease;
}

.dropdown a:hover,
.dropdown a:focus-visible,
.dropdown a[aria-current="page"],
html[data-theme="eco"] .dropdown a:hover,
html[data-theme="eco"] .dropdown a:focus-visible,
html[data-theme="eco"] .dropdown a[aria-current="page"] {
  color: #c7001a !important;
  background: #fff1f3 !important;
}

.dropdown a:hover::before,
.dropdown a:focus-visible::before,
.dropdown a[aria-current="page"]::before { height: 60%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 3;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.language-flag-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(32,33,36,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.88);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.language-flag-btn:hover,
.language-flag-btn[aria-pressed="true"] {
  border-color: var(--site-red);
  background: #fff;
}
.language-flag-btn:hover { transform: translateY(-1px); }
.language-flag { width: 28px; height: 20px; display: block; }
.language-flag-svg { display: block; width: 28px; height: 20px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.10); }

.eco-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(32,33,36,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.90);
  color: var(--site-text);
  cursor: pointer;
  font-size: .83rem;
  font-weight: 800;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.eco-btn:hover { border-color: var(--site-red); color: var(--site-red); transform: translateY(-1px); }
.eco-dot { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #fff0f2; }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(224,0,27,.16);
  border-radius: 12px;
  background: #fff5f6;
  cursor: pointer;
  position: relative;
  z-index: 4;
}
.menu-btn span,
.menu-btn::before,
.menu-btn::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--site-text);
  transition: transform .2s ease, opacity .2s ease;
}
.menu-btn.active::before { transform: translateY(7px) rotate(45deg); }
.menu-btn.active span { opacity: 0; }
.menu-btn.active::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Eco / tema escuro ---------- */
html[data-theme="eco"] .site-header {
  --site-text: #f4f5f6;
  --site-muted: #a9adb4;
  background: #0d0e10 !important;
  border-bottom-color: rgba(255,48,74,.24) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.28);
}
html[data-theme="eco"] .site-header .navbar::after { opacity: .52; filter: saturate(1.18) brightness(1.12); }
html[data-theme="eco"] .nav-link:hover,
html[data-theme="eco"] .nav-toggle-link:hover,
html[data-theme="eco"] .nav-link.is-current,
html[data-theme="eco"] .nav-toggle-link.is-current,
html[data-theme="eco"] .nav-item:focus-within > .nav-toggle-link { background: rgba(255,255,255,.04); }
html[data-theme="eco"] .language-flag-btn { background: #17191d; border-color: rgba(255,255,255,.13); }
html[data-theme="eco"] .language-flag-btn:hover,
html[data-theme="eco"] .language-flag-btn[aria-pressed="true"] { background: #202329; border-color: #ff304a; }
html[data-theme="eco"] .eco-btn { background: #15171a; color: #f4f5f6; border-color: #315f3b; }
html[data-theme="eco"] .eco-btn[aria-pressed="true"] { color: #8ce59e; background: #14291a; }
html[data-theme="eco"] .eco-dot { background: #183521; color: #74d98a; }

/* ---------- Footer ---------- */
.site-footer {
  background: #151516 !important;
  color: #fff !important;
  padding: 56px 0 24px;
}
.site-footer .site-shell-container { width: min(1280px, calc(100% - 40px)); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(250px,1.25fr) minmax(105px,.55fr) minmax(155px,.75fr) minmax(205px,1fr) minmax(175px,.85fr);
  align-items: start;
  column-gap: 26px;
  row-gap: 34px;
}
.footer-grid > * { min-width: 0; }
.footer-brand-block { padding-right: 10px; }
.footer-logo { width: 235px; max-height: 76px; object-fit: contain; object-position: left center; margin-bottom: 18px; }
.footer-copy { margin: 0; max-width: 330px; color: rgba(255,255,255,.58); font-size: .9rem; line-height: 1.65; }
.footer-title { margin-bottom: 13px; color: #fff; font-weight: 900; line-height: 1.25; }
.footer-links { display: grid; gap: 8px; }
.footer-links a,
.footer-location { color: rgba(255,255,255,.63); font-size: .88rem; line-height: 1.45; text-decoration: none; }
.footer-links a { width: fit-content; max-width: 100%; }
.footer-links a:hover { color: #fff; }
.footer-contact-column .footer-links a { white-space: nowrap; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.11); margin-top: 38px; padding-top: 20px; display: flex; justify-content: space-between; gap: 18px; color: rgba(255,255,255,.5); font-size: .8rem; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2200;
  max-width: 350px;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: #151516;
  color: #fff;
  box-shadow: 0 16px 45px rgba(0,0,0,.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast strong { color: var(--site-red); }

@media (max-width: 1120px) and (min-width: 821px) {
  .site-header .brand { width: 210px; }
  .site-header .brand img { height: 52px; }
  .nav-link, .nav-toggle-link { padding-inline: 8px; font-size: .88rem; }
  .eco-label { display: none; }
  .footer-grid { grid-template-columns: repeat(4,minmax(0,1fr)); column-gap: 28px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-copy { max-width: 520px; }
}

@media (max-width: 820px) {
  .site-shell-container { width: min(100% - 28px, var(--site-shell-width)); }
  .site-header .navbar { min-height: 74px; }
  .site-header .brand { width: 205px; height: 60px; }
  .site-header .brand img { height: 50px; }
  .site-header .navbar::after { width: 210px; height: 60px; right: 52px; top: 7px; opacity: .28; background-size: 230px 64px; }
  .site-header::before { width: 150px; height: 3px; }
  .site-header::after { right: 18px; width: 54px; height: 3px; }

  .menu-btn { display: block; }
  .nav-wrap {
    position: absolute;
    top: calc(100% + 1px);
    left: 14px;
    right: 14px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    padding: 16px;
    border: 1px solid rgba(224,0,27,.16);
    border-radius: 0 0 18px 18px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,.12);
  }
  .nav-wrap.open { display: flex; }
  .nav-list { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link, .nav-toggle-link { width: 100%; justify-content: space-between; min-height: 48px; padding: 12px 13px; }
  .nav-link::after, .nav-toggle-link::after { left: 13px; right: auto; width: 48px; }

  .dropdown,
  html[data-theme="eco"] .dropdown {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    margin: 3px 0 7px;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: none !important;
    border-radius: 12px;
  }
  .nav-item.open > .dropdown { display: block; }

  .header-actions { width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid rgba(224,0,27,.12); }
  .eco-label { display: inline; }

  html[data-theme="eco"] .nav-wrap { background: #0d0e10; border-color: rgba(255,48,74,.20); }

  .site-footer { padding-top: 46px; }
  .site-footer .site-shell-container { width: min(100% - 40px, 1280px); }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px 28px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-copy { max-width: 560px; }
}

@media (max-width: 590px) {
  .site-header .brand { width: 180px; }
  .site-header .brand img { height: 46px; }
  .site-footer .site-shell-container { width: min(100% - 28px,1280px); }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-logo { width: 220px; }
  .footer-title { margin-bottom: 9px; }
  .footer-bottom { margin-top: 30px; flex-direction: column; }
}


/* =========================================================
   HEADER GLOBAL FIXO NA ROLAGEM — V2
   O componente global é montado dentro de [data-site-header].
   O sticky precisa ficar no host para acompanhar toda a página.
   ========================================================= */
[data-site-header] {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5000;
  width: 100%;
  display: block;
}

[data-site-header] > .site-header {
  position: relative !important;
  top: auto !important;
  z-index: auto !important;
  width: 100%;
}

/* Mantém o submenu acima do conteúdo durante a rolagem. */
[data-site-header] .dropdown,
[data-site-header] .nav-wrap {
  z-index: 10;
}


/* =========================================================
   SUBMENU COM TRAVA POR CLIQUE — V3
   Se um dropdown estiver aberto por clique, o hover dos
   outros dropdowns fica temporariamente desativado.
   ========================================================= */
@media (min-width: 821px) {
  /* O item explicitamente aberto por clique continua visível. */
  .nav-list.has-click-open > .nav-item.open > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-list.has-click-open > .nav-item.open > .nav-toggle-link svg {
    transform: rotate(180deg);
  }

  /* Bloqueia hover/focus visual dos OUTROS submenus enquanto há um travado. */
  .nav-list.has-click-open > .nav-item:not(.open):hover > .dropdown,
  .nav-list.has-click-open > .nav-item:not(.open):focus-within > .dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    pointer-events: none;
  }

  .nav-list.has-click-open > .nav-item:not(.open):hover > .nav-toggle-link svg,
  .nav-list.has-click-open > .nav-item:not(.open):focus-within > .nav-toggle-link svg {
    transform: none;
  }

  /* Mantém o outro item com aparência normal ao apenas passar o mouse. */
  .nav-list.has-click-open > .nav-item:not(.open):hover > .nav-toggle-link,
  .nav-list.has-click-open > .nav-item:not(.open):focus-within > .nav-toggle-link {
    color: var(--site-text);
    background: transparent;
  }

  .nav-list.has-click-open > .nav-item:not(.open):hover > .nav-toggle-link::after,
  .nav-list.has-click-open > .nav-item:not(.open):focus-within > .nav-toggle-link::after {
    transform: scaleX(0);
  }

  /* O submenu travado recebe o destaque vermelho do menu ativo. */
  .nav-list.has-click-open > .nav-item.open > .nav-toggle-link {
    color: var(--site-red);
    background: rgba(255,255,255,.84);
  }

  .nav-list.has-click-open > .nav-item.open > .nav-toggle-link::after {
    transform: scaleX(1);
  }

  html[data-theme="eco"] .nav-list.has-click-open > .nav-item.open > .nav-toggle-link {
    background: rgba(255,255,255,.04);
  }
}


/* =========================================================
   MENU MOBILE ESTÁVEL — V4
   O submenu abre somente pelo estado .open controlado no JS.
   Evita :focus-within manter dropdowns presos após toque.
   ========================================================= */
@media (max-width: 820px) {
  .nav-item > .dropdown,
  .nav-item:hover > .dropdown,
  .nav-item:focus-within > .dropdown {
    display: none;
  }

  .nav-item.open > .dropdown {
    display: block;
  }

  .nav-item.open > .nav-toggle-link {
    color: var(--site-red);
    background: #fff1f3;
  }

  html[data-theme="eco"] .nav-item.open > .nav-toggle-link {
    color: #ff304a;
    background: rgba(255,48,74,.10);
  }

  .nav-wrap {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}


/* =========================================================
   MENU GLOBAL — SUBMENU DE SEGUNDO NÍVEL V7
   Texto navega para a página; seta abre o terceiro nível.
   ========================================================= */
.dropdown,
html[data-theme="eco"] .dropdown {
  overflow: visible;
}

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.dropdown-submenu-link {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 43px;
  padding: 11px 8px 11px 17px;
  color: #5f6065;
  font-size: .92rem;
  font-weight: 650;
  text-align: left;
  transition: color .18s ease, background .18s ease;
}

.dropdown-submenu-link::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 99px;
  background: var(--site-red);
  transform: translateY(-50%);
  transition: height .18s ease;
}

.dropdown-submenu-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 43px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(224,0,27,.10);
  background: transparent;
  color: #5f6065;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}

.dropdown-submenu-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform .18s ease;
}

.dropdown-submenu:hover > .dropdown-submenu-head,
.dropdown-submenu:focus-within > .dropdown-submenu-head,
.dropdown-submenu.open > .dropdown-submenu-head,
.dropdown-submenu.is-current > .dropdown-submenu-head {
  background: #fff1f3;
}

.dropdown-submenu:hover .dropdown-submenu-link,
.dropdown-submenu:focus-within .dropdown-submenu-link,
.dropdown-submenu.open .dropdown-submenu-link,
.dropdown-submenu-link.is-current,
.dropdown-submenu:hover .dropdown-submenu-toggle,
.dropdown-submenu:focus-within .dropdown-submenu-toggle,
.dropdown-submenu.open .dropdown-submenu-toggle,
.dropdown-submenu-toggle.is-current {
  color: #c7001a;
}

.dropdown-submenu:hover .dropdown-submenu-link::before,
.dropdown-submenu:focus-within .dropdown-submenu-link::before,
.dropdown-submenu.open .dropdown-submenu-link::before,
.dropdown-submenu-link.is-current::before {
  height: 60%;
}

.dropdown-submenu:hover > .dropdown-submenu-head .dropdown-submenu-toggle svg,
.dropdown-submenu:focus-within > .dropdown-submenu-head .dropdown-submenu-toggle svg,
.dropdown-submenu.open > .dropdown-submenu-head .dropdown-submenu-toggle svg {
  transform: translateX(2px);
}

.dropdown-submenu-link:focus-visible,
.dropdown-submenu-toggle:focus-visible {
  outline: 2px solid var(--site-red);
  outline-offset: -2px;
}

.dropdown-nested,
html[data-theme="eco"] .dropdown-nested {
  position: absolute;
  top: -8px;
  left: calc(100% + 8px);
  z-index: 45;
  min-width: 235px;
  padding: 11px 9px 9px;
  background: #fff !important;
  border: 1px solid rgba(224,0,27,.20) !important;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(28,24,26,.15) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.dropdown-nested::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--site-red);
}

.dropdown-submenu:hover > .dropdown-nested,
.dropdown-submenu:focus-within > .dropdown-nested,
.dropdown-submenu.open > .dropdown-nested {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.dropdown-nested a,
html[data-theme="eco"] .dropdown-nested a {
  padding-left: 18px;
}

@media (min-width: 821px) and (max-width: 1080px) {
  .dropdown-nested,
  html[data-theme="eco"] .dropdown-nested {
    left: auto;
    right: calc(100% + 8px);
    transform: translateX(4px);
  }

  .dropdown-submenu:hover > .dropdown-nested,
  .dropdown-submenu:focus-within > .dropdown-nested,
  .dropdown-submenu.open > .dropdown-nested {
    transform: translateX(0);
  }
}

@media (max-width: 820px) {
  .dropdown-submenu-head {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .dropdown-submenu-link,
  .dropdown-submenu-toggle {
    min-height: 48px;
  }

  .dropdown-submenu-link {
    padding: 11px 8px 11px 18px;
  }

  .dropdown-submenu-toggle {
    width: 48px;
    min-width: 48px;
  }

  .dropdown-submenu-toggle svg {
    transform: rotate(90deg);
  }

  .dropdown-submenu.open > .dropdown-submenu-head .dropdown-submenu-toggle svg {
    transform: rotate(-90deg);
  }

  .dropdown-submenu > .dropdown-nested,
  .dropdown-submenu:hover > .dropdown-nested,
  .dropdown-submenu:focus-within > .dropdown-nested,
  html[data-theme="eco"] .dropdown-submenu > .dropdown-nested {
    position: static;
    display: none;
    width: calc(100% - 14px);
    min-width: 0;
    margin: 4px 0 7px 14px;
    padding: 7px 7px 7px 9px;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    border-radius: 10px;
    box-shadow: none !important;
    border-color: rgba(224,0,27,.16) !important;
  }

  .dropdown-submenu.open > .dropdown-nested,
  html[data-theme="eco"] .dropdown-submenu.open > .dropdown-nested {
    display: block;
  }

  .dropdown-nested::before {
    top: 8px;
    bottom: 8px;
    width: 2px;
  }
}

/* =========================================================
   V16 — MENU MOBILE / TEMA ESCURO
   Mantém o X do menu com contraste suficiente.
   ========================================================= */
@media (max-width: 820px) {
  html[data-theme="eco"] .site-header .menu-btn {
    background: #17191d !important;
    border-color: rgba(255,48,74,.38) !important;
  }

  html[data-theme="eco"] .site-header .menu-btn span,
  html[data-theme="eco"] .site-header .menu-btn::before,
  html[data-theme="eco"] .site-header .menu-btn::after {
    background: #ffffff !important;
  }

  html[data-theme="eco"] .site-header .menu-btn.active {
    background: #211216 !important;
    border-color: #ff304a !important;
    box-shadow: 0 0 0 3px rgba(255,48,74,.10);
  }

  html[data-theme="eco"] .site-header .menu-btn.active::before,
  html[data-theme="eco"] .site-header .menu-btn.active::after {
    background: #ff5268 !important;
  }
}


/* =========================================================
   V20 — BOTÃO GLOBAL VOLTAR AO TOPO
   ========================================================= */
.site-back-to-top {
  position: fixed;
  right: clamp(16px, 2.2vw, 30px);
  bottom: clamp(18px, 2.6vw, 34px);
  z-index: 4800;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(224, 0, 27, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: var(--site-red, #e0001b);
  box-shadow: 0 12px 30px rgba(24, 21, 22, .16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(.92);
  cursor: pointer;
  transition:
    opacity .22s ease,
    visibility .22s ease,
    transform .22s ease,
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-back-to-top svg {
  width: 23px;
  height: 23px;
  transition: transform .18s ease;
}

.site-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.site-back-to-top:hover,
.site-back-to-top:focus-visible {
  color: #fff;
  background: var(--site-red, #e0001b);
  border-color: var(--site-red, #e0001b);
  box-shadow: 0 14px 34px rgba(224, 0, 27, .28);
  outline: none;
}

.site-back-to-top:hover svg,
.site-back-to-top:focus-visible svg {
  transform: translateY(-2px);
}

html[data-theme="eco"] .site-back-to-top {
  background: rgba(22, 24, 28, .96);
  color: #ff4057;
  border-color: rgba(255, 64, 87, .32);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .40);
}

html[data-theme="eco"] .site-back-to-top:hover,
html[data-theme="eco"] .site-back-to-top:focus-visible {
  background: #e0001b;
  color: #fff;
  border-color: #e0001b;
}

@media (max-width: 620px) {
  .site-back-to-top {
    right: 14px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .site-back-to-top svg {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-back-to-top,
  .site-back-to-top svg {
    transition: none !important;
  }
}


/* =========================================================
   MENU DESKTOP — PONTE DE HOVER + ATRASO V21
   Evita fechamento ao mover o mouse entre os níveis.
   ========================================================= */
@media (min-width: 821px) {
  /* Ponte invisível entre o item principal e o dropdown. */
  .site-header .dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 16px;
    background: transparent;
    pointer-events: auto;
  }

  /* Estado controlado por JS para tolerar pequenas saídas do ponteiro. */
  .site-header .nav-item.hover-open > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Mantém a seta do item principal coerente durante o hover estabilizado. */
  .site-header .nav-item.hover-open > .nav-toggle-link svg {
    transform: rotate(180deg);
  }

  /* Ponte entre Sistema de Alerta e Alarme e o submenu lateral. */
  .site-header .dropdown-submenu::after {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 100%;
    width: 14px;
    background: transparent;
    pointer-events: auto;
  }

  .site-header .dropdown-submenu.hover-open > .dropdown-submenu-head {
    background: #fff1f3;
  }

  .site-header .dropdown-submenu.hover-open .dropdown-submenu-link,
  .site-header .dropdown-submenu.hover-open .dropdown-submenu-toggle {
    color: #c7001a;
  }

  .site-header .dropdown-submenu.hover-open .dropdown-submenu-link::before {
    height: 60%;
  }

  .site-header .dropdown-submenu.hover-open > .dropdown-submenu-head .dropdown-submenu-toggle svg {
    transform: translateX(2px);
  }

  .site-header .dropdown-submenu.hover-open > .dropdown-nested {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Reduz o vão físico sem colar visualmente os cartões. */
  .site-header .dropdown-nested,
  html[data-theme="eco"] .site-header .dropdown-nested {
    left: calc(100% + 4px);
  }

  /* Em telas intermediárias, o submenu abre para a esquerda. */
  @media (max-width: 1080px) {
    .site-header .dropdown-submenu::after {
      left: auto;
      right: 100%;
    }

    .site-header .dropdown-nested,
    html[data-theme="eco"] .site-header .dropdown-nested {
      left: auto;
      right: calc(100% + 4px);
    }
  }

  /* Se existe um menu travado por clique, mantém o bloqueio dos demais. */
  .site-header .nav-list.has-click-open > .nav-item:not(.open).hover-open > .dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    pointer-events: none;
  }
}


/* GRIDLAB GLOBAL SHELL ISOLATION — V30 */
[data-site-header], [data-site-header] *, [data-site-footer], [data-site-footer] * { box-sizing: border-box; }
[data-site-header] .site-header, [data-site-footer] .site-footer { font-family: "Inter", Arial, Helvetica, sans-serif; }
[data-site-header] a, [data-site-footer] a { text-decoration: none; }
[data-site-header] button { font-family: inherit; }
[data-site-header] .nav-link, [data-site-header] .nav-toggle-link { line-height: 1.2; }


/* =========================================================
   MENU DESKTOP — HOVER EXCLUSIVO V32
   O JS garante apenas um dropdown principal aberto por hover.
   Esta camada evita que um dropdown em fechamento capture o mouse.
   ========================================================= */
@media (min-width: 821px) {
  .site-header .nav-list:not(.has-click-open) > .nav-item:not(.hover-open):not(.open) > .dropdown {
    pointer-events: none;
  }

  .site-header .nav-list > .nav-item.hover-open {
    z-index: 41;
  }

  .site-header .nav-list > .nav-item.hover-open > .dropdown {
    z-index: 42;
  }
}


/* =========================================================
   V35 — SUBMENUS ACOMPANHAM O MODO ESCURO
   O valor interno do tema continua "eco" por compatibilidade.
   ========================================================= */
html[data-theme="eco"] .site-header .dropdown {
  background: #0d0e10 !important;
  border-color: rgba(255, 48, 74, .24) !important;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .48) !important;
}

/* Itens do submenu principal */
html[data-theme="eco"] .site-header .dropdown > a,
html[data-theme="eco"] .site-header .dropdown-submenu-link,
html[data-theme="eco"] .site-header .dropdown-submenu-toggle {
  color: #e6e8eb !important;
  background: transparent !important;
}

/* Divisor da seta no item Sistema de Alerta e Alarme */
html[data-theme="eco"] .site-header .dropdown-submenu-toggle {
  border-left-color: rgba(255, 255, 255, .10) !important;
}

/* Hover / foco / item atual no submenu principal */
html[data-theme="eco"] .site-header .dropdown > a:hover,
html[data-theme="eco"] .site-header .dropdown > a:focus-visible,
html[data-theme="eco"] .site-header .dropdown > a[aria-current="page"],
html[data-theme="eco"] .site-header .dropdown-submenu:hover > .dropdown-submenu-head,
html[data-theme="eco"] .site-header .dropdown-submenu:focus-within > .dropdown-submenu-head,
html[data-theme="eco"] .site-header .dropdown-submenu.open > .dropdown-submenu-head,
html[data-theme="eco"] .site-header .dropdown-submenu.is-current > .dropdown-submenu-head,
html[data-theme="eco"] .site-header .dropdown-submenu.hover-open > .dropdown-submenu-head {
  background: rgba(255, 48, 74, .12) !important;
}

html[data-theme="eco"] .site-header .dropdown > a:hover,
html[data-theme="eco"] .site-header .dropdown > a:focus-visible,
html[data-theme="eco"] .site-header .dropdown > a[aria-current="page"],
html[data-theme="eco"] .site-header .dropdown-submenu:hover .dropdown-submenu-link,
html[data-theme="eco"] .site-header .dropdown-submenu:focus-within .dropdown-submenu-link,
html[data-theme="eco"] .site-header .dropdown-submenu.open .dropdown-submenu-link,
html[data-theme="eco"] .site-header .dropdown-submenu-link.is-current,
html[data-theme="eco"] .site-header .dropdown-submenu:hover .dropdown-submenu-toggle,
html[data-theme="eco"] .site-header .dropdown-submenu:focus-within .dropdown-submenu-toggle,
html[data-theme="eco"] .site-header .dropdown-submenu.open .dropdown-submenu-toggle,
html[data-theme="eco"] .site-header .dropdown-submenu-toggle.is-current,
html[data-theme="eco"] .site-header .dropdown-submenu.hover-open .dropdown-submenu-link,
html[data-theme="eco"] .site-header .dropdown-submenu.hover-open .dropdown-submenu-toggle {
  color: #ff5268 !important;
}

/* Segundo nível: Sistema de Alerta e Alarme */
html[data-theme="eco"] .site-header .dropdown-nested {
  background: #111318 !important;
  border-color: rgba(255, 48, 74, .24) !important;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .52) !important;
}

html[data-theme="eco"] .site-header .dropdown-nested a {
  color: #dfe2e7 !important;
  background: transparent !important;
}

html[data-theme="eco"] .site-header .dropdown-nested a:hover,
html[data-theme="eco"] .site-header .dropdown-nested a:focus-visible,
html[data-theme="eco"] .site-header .dropdown-nested a[aria-current="page"] {
  color: #ff5268 !important;
  background: rgba(255, 48, 74, .12) !important;
}

/* Mobile: o painel e todos os níveis permanecem escuros. */
@media (max-width: 820px) {
  html[data-theme="eco"] .site-header .nav-wrap {
    background: #0d0e10 !important;
    border-color: rgba(255, 48, 74, .20) !important;
  }

  html[data-theme="eco"] .site-header .dropdown,
  html[data-theme="eco"] .site-header .dropdown-nested {
    background: #111318 !important;
    border-color: rgba(255, 48, 74, .20) !important;
  }

  html[data-theme="eco"] .site-header .nav-item.open > .nav-toggle-link {
    color: #ff5268 !important;
    background: rgba(255, 48, 74, .10) !important;
  }
}
