/* Cabeçalho do site: logótipo e menu principal (substitui o CSS de navegação do Brizy, que já não existe).
   Horizontal em ecrãs largos, com submenus ao passar o rato ou ao focar com o teclado;
   em ecrãs pequenos fica em coluna, com os submenus a abrir ao tocar/focar. */
.brz .brz-menu-simple ul.menu,
.brz .brz-menu-simple ul.sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.brz .brz-menu-simple ul.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
}
.brz .brz-menu-simple .menu-item {
  position: relative;
}
.brz .brz-menu-simple .menu-item > a {
  display: inline-block;
  padding: 8px 2px;
  text-decoration: none;
  white-space: nowrap;
}
.brz .brz-menu-simple .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.brz .brz-menu-simple .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  min-width: 240px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20, 37, 68, 0.14);
}
.brz .brz-menu-simple .menu-item:hover > .sub-menu,
.brz .brz-menu-simple .menu-item:focus-within > .sub-menu {
  display: block;
}
.brz .brz-menu-simple .sub-menu .menu-item > a {
  display: block;
  padding: 8px 18px;
  white-space: normal;
}
.brz .brz-menu-simple .sub-menu .menu-item > a:hover {
  background: #f3f6fb;
}
.brz .brz-menu-simple .menu-item-search {
  margin-left: 6px;
}

@media (max-width: 991px) {
  .brz .brz-menu-simple ul.menu {
    gap: 0 12px;
  }
  .brz .brz-menu-simple .sub-menu {
    min-width: 220px;
  }
}
/* Botão de hambúrguer e submenus (ecrãs pequenos). O botão é criado por assets/js/menu.js. */
.gp-burger,
.gp-sub-toggle {
  display: none;
}
@media (max-width: 1040px) {
  .gp-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0 11px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #cdd6e7;
    border-radius: 8px;
    cursor: pointer;
  }
  .gp-burger span {
    display: block;
    height: 2.5px;
    border-radius: 2px;
    background: #224870;
    transition: transform .2s, opacity .2s;
  }
  .gp-menu-open .gp-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .gp-menu-open .gp-burger span:nth-child(2) { opacity: 0; }
  .gp-menu-open .gp-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* menu fechado por defeito; aberto ao carregar no botão */
  .brz .brz-menu-simple .menu-principal-container { display: none; }
  .brz .brz-menu-simple.gp-menu-open .menu-principal-container { display: block; margin-top: 10px; }

  .brz .brz-menu-simple ul.menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    text-align: left;
    min-width: 240px;
  }
  .brz .brz-menu-simple .menu-item > a { padding: 11px 4px; white-space: normal; }
  .brz .brz-menu-simple .menu > .menu-item > a { flex-direction: row; gap: 10px; padding: 11px 4px; font-size: 15px; text-align: left; }
  .gp-top-icon svg { width: 22px; height: 22px; }
  .brz .brz-menu-simple .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8ecf5;
  }
  .brz .brz-menu-simple .menu-item-has-children > a::after { display: none; }
  .brz .brz-menu-simple .menu-item-has-children > a { flex: 1 1 auto; }
  .brz .brz-menu-simple .gp-sub-toggle {
    display: block;
    width: 40px;
    height: 40px;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
  }
  .brz .brz-menu-simple .gp-sub-toggle::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 13px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #224870;
    border-bottom: 2px solid #224870;
    transform: rotate(45deg);
    transition: transform .2s;
  }
  .brz .brz-menu-simple .gp-sub-open > .gp-sub-toggle::after { transform: rotate(-135deg); top: 17px; }

  /* submenus: só abrem pelo botão (anula o abrir ao passar o rato) */
  .brz .brz-menu-simple .menu-item:hover > .sub-menu,
  .brz .brz-menu-simple .menu-item:focus-within > .sub-menu { display: none; }
  .brz .brz-menu-simple .menu-item.gp-sub-open > .sub-menu {
    display: block;
    position: static;
    flex: 1 1 100%;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 6px 14px;
    min-width: 0;
  }
  .brz .brz-menu-simple .menu-item-search { margin: 12px 0 4px; }
}

/* Logótipo: as regras de tamanho do cabeçalho apontavam para uma classe que não existe no elemento. */
.brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent {
  flex: 0 1 auto !important; /* o Brizy define flex-basis:100%, que anula a largura */
  width: 260px !important;
  max-width: 100% !important;
}
@media (max-width: 991px) {
  .brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 210px !important; }
}
@media (max-width: 767px) {
  .brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 180px !important; }
}

/* Botão de pesquisa (ecrãs pequenos): garante que o ícone aparece */
.gp-search__toggle svg {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  fill: none;
  stroke: #224870;
  stroke-width: 2;
}

/* ===== Mega-menu ===== */
/* Primeiro nível numa só linha */
.brz .brz-menu-simple ul.menu { flex-wrap: nowrap; gap: 0 6px; }
.brz .brz-menu-simple .menu > .menu-item > a { padding: 10px 10px; }
.brz .brz-menu-simple .menu-item-search { margin-left: 4px; }

/* Primeiro nível: ícone por cima (um pouco maior) e título por baixo */
.brz .brz-menu-simple .menu > .menu-item > a {
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 12px; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center;
}
.brz .brz-menu-simple .menu > .menu-item-has-children > a::after { display: none; }
.gp-top-icon { display: inline-flex; }
.gp-top-icon svg { width: 30px; height: 30px; }
.brz .brz-menu-simple .menu > .menu-item > a:hover .gp-top-icon svg { transform: translateY(-1px); }

/* Painéis de cartões */
.brz .brz-menu-simple .sub-menu.gp-mm-panel {
  min-width: 0;
  padding: 12px;
  gap: 4px;
  border-radius: 12px;
  border: 1px solid #e3e8f2;
  box-shadow: 0 12px 34px rgba(20, 37, 68, 0.12);
}
.brz .brz-menu-simple .menu-item:hover > .sub-menu.gp-mm-panel,
.brz .brz-menu-simple .menu-item:focus-within > .sub-menu.gp-mm-panel { display: grid; }
.brz .brz-menu-simple .gp-mm--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 460px; }
.brz .brz-menu-simple .gp-mm--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 640px; }
.brz .brz-menu-simple .gp-mm--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 800px; }
@media (max-width: 1000px) {
  .brz .brz-menu-simple .gp-mm--3, .brz .brz-menu-simple .gp-mm--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 480px; }
}
/* cada painel abre centrado por baixo do seu item; o assets/js/menu.js desloca-o (--gp-shift)
   quando sairia do ecrã */
.brz .brz-menu-simple .menu > .menu-item { position: relative; }
.brz .brz-menu-simple .menu > .menu-item > .sub-menu.gp-mm-panel {
  top: calc(100% - 4px); left: 50%; right: auto; max-width: calc(100vw - 24px);
  transform: translateX(calc(-50% + var(--gp-shift, 0px)));
}
.brz .brz-menu-simple .gp-mm-panel .menu-item > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px 14px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 10px;
  white-space: normal;
}
.brz .brz-menu-simple .gp-mm-panel .menu-item > a:hover { background: #f3f6fb; border-color: #e3e8f2; }
.gp-mm-icon { flex: 0 0 auto; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: #f4f6fb; border-radius: 14px; }
.gp-mm-icon svg { width: 30px; height: 30px; }
.gp-mm-text { display: block; min-width: 0; }
.gp-mm-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; color: #224870; }
.gp-mm-desc { display: block; font-size: 12px; font-weight: 400; line-height: 1.35; color: #586ba4; margin-top: 4px; }

/* Pesquisa: só o ícone; o campo abre ao carregar na lupa */
.brz .menu-item-search .gp-search { position: relative; }
.brz .menu-item-search .gp-search__toggle { display: inline-flex !important; width: 38px; height: 38px; }
.brz .menu-item-search .gp-search__panel {
  display: none;
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 300;
  background: #fff;
  border: 1px solid #d7dfef;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 37, 68, 0.14);
  padding: 8px;
  gap: 6px;
  min-width: 250px;
}
.brz .menu-item-search .gp-search--open .gp-search__panel { display: flex; }
.brz .menu-item-search .gp-search__input { width: 180px; }

/* WhatsApp discreto */
.brz svg.brz-icon-svg[aria-label="WhatsApp"] { width: 26px !important; height: 26px !important; opacity: .85; }
.brz a.brz-a:has(> .brz-icon svg[aria-label="WhatsApp"]),
.brz .brz-a:has(svg[aria-label="WhatsApp"]) { width: auto !important; height: auto !important; padding: 0 !important; }

/* Logótipo e cabeçalho mais baixos */
.brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 185px !important; }
@media (max-width: 991px) {
  .brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 190px !important; }
}
@media (max-width: 767px) {
  .brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 165px !important; }
}
@media (max-width: 1040px) {
  /* em ecrãs pequenos os painéis voltam a ser listas simples */
  .gp-mm-icon, .gp-mm-desc { display: none; }
  .brz .brz-menu-simple .menu-item.gp-sub-open > .sub-menu.gp-mm-panel { display: block !important; padding: 0 0 6px 14px; border: 0; box-shadow: none; }
  .brz .brz-menu-simple .menu-item:hover > .sub-menu.gp-mm-panel { display: none; }
  .brz .brz-menu-simple .menu-item.gp-sub-open:hover > .sub-menu.gp-mm-panel { display: block !important; }
  .brz .brz-menu-simple .gp-mm-panel .menu-item > a { padding: 9px 4px; border: 0; display: block; text-align: left; }
  .gp-mm-title { font-size: 14px; font-weight: 500; }
  .brz .menu-item-search .gp-search__panel { right: auto; left: 0; }
}

/* Faixa "Projeto relacionado" (VelocitasCode) discreta, perto do rodapé */
.gp-velocitas { background: #f4f6fb !important; padding: 28px 24px !important; }
.gp-velocitas h3 { font-size: 18px !important; color: #224870 !important; margin: 0 0 8px !important; }
.gp-velocitas p { font-size: 14px !important; color: #586ba4 !important; margin: 0 0 14px !important; }
.gp-velocitas__label { color: #586ba4 !important; }
.gp-velocitas .gp-btn--primary { background: transparent !important; color: #224870 !important; border: 1px solid #224870; padding: 9px 18px; font-size: 13px; }

/* Ecrãs médios: aperta o espaçamento para o menu caber numa só linha */
@media (min-width: 1041px) and (max-width: 1240px) {
  .brz .brz-menu-simple ul.menu { gap: 0; }
  .brz .brz-menu-simple .menu > .menu-item > a { padding: 8px 8px; font-size: 13.5px; }
  .gp-top-icon svg { width: 28px; height: 28px; }
  .brz .brz-css-d-image-qycitoklvnrcrkqtosdlfwkbwsryrmtqsobz-parent { width: 180px !important; }
  .brz .brz-menu-simple .gp-mm--4 { width: 700px; }
  .brz .brz-menu-simple .gp-mm--3 { width: 600px; }
}

/* No menu em lista (hambúrguer) o ícone volta a ficar ao lado do texto */
@media (max-width: 1040px) {
  .brz .brz-menu-simple .menu > .menu-item > a { flex-direction: row; gap: 12px; padding: 11px 4px; font-size: 15px; text-align: left; }
  .brz .brz-menu-simple .menu > .menu-item-has-children > a { flex: 1 1 auto; }
  .gp-top-icon svg { width: 22px; height: 22px; }
}
