/*
 * overrides.css
 * Neutraliza os estilos do BeTheme pai que conflitam com o
 * header e footer customizados do site Be Generous.
 *
 * Todos os seletores aqui usam especificidade suficiente para
 * vencer as regras do BeTheme sem precisar de !important desnecessário.
 */

/* ─── RESET DE BODY / UL / P / A DO BETHEME ──────────────────────────────── */

/*
 * BeTheme zera margin/padding de ul globalmente e define
 * list-style: none. Isso quebra o layout do nosso menu.
 * Revertemos apenas para os elementos dentro do nosso header/footer.
 */
.top_bar ul,
.header ul,
footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/*
 * BeTheme define p { margin: 0 0 15px } no base.css.
 * Nosso footer usa margin-bottom: 0.
 */
footer p {
  margin-bottom: 0;
}

/*
 * BeTheme define a, a:visited { line-height: 25px }.
 * Interfere no alinhamento vertical dos links do menu.
 */
.header .menu > li > a,
.header .menu .submenu li a,
.top_bar a,
footer a {
  line-height: inherit;
}

/*
 * BeTheme define a:hover { text-decoration: underline }.
 * Nosso CSS já trata isso – previnimos double-rule.
 */
.header .menu a:hover,
.top_bar a:hover,
footer a:hover {
  text-decoration: none;
}

/* ─── RESET DO #Top_bar DO BETHEME ───────────────────────────────────────── */

/*
 * O BeTheme tem um #Top_bar posicionado com top: 40px, z-index: 30
 * e width: 100% + estilos de logo, menu, search.
 * O nosso .top_bar é um elemento diferente (sem o #) e fica fixo no topo.
 * Garantimos que o BeTheme #Top_bar não interfira.
 */
#Top_bar {
  display: none !important;
}

/* ─── RESET DO #Header / #Header_wrapper DO BETHEME ─────────────────────── */

/*
 * O BeTheme exige min-height: 250px no #Header e aplica background
 * de subheader em #Header_wrapper. Isso cria um espaço em branco
 * enorme acima do conteúdo no blog.
 */
#Header_wrapper {
  display: none !important;
}

#Header {
  display: none !important;
}

#Subheader {
  display: none !important;
}

/* ─── RESET DO #Footer DO BETHEME ────────────────────────────────────────── */

/*
 * O BeTheme tem um #Footer com widgets_wrapper, copyright, etc.
 * O nosso footer customizado usa a tag <footer class="footer">.
 * Ocultamos o footer do BeTheme para não duplicar.
 */
#Footer {
  display: none !important;
}

/* ─── BODY PADDING ───────────────────────────────────────────────────────── */

/*
 * O nosso header-footer.css define body { padding-top: 110px }.
 * O BeTheme via style.php pode sobrescrever isso.
 * Garantimos o valor correto.
 */
body {
  padding-top: 78px !important;
}

@media (max-width: 767px) {
  body {
    padding-top: 58px !important;
  }
}

/* ─── WRAPPER / CONTENT DO BETHEME ──────────────────────────────────────── */

/*
 * O BeTheme aplica background, box-shadow e overflow em #Wrapper e #Content.
 * Também injeta margin-top no #Content via JS ou CSS dinâmico baseado
 * na altura do seu próprio header — zeramos tudo isso aqui.
 */
#Wrapper {
  background: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;
  margin-top: 0 !important;
}

#Content {
  padding: 0 !important;
  margin: 0 !important;
  margin-top: 0 !important;
  background: transparent;
}

/* ─── CONTAINER ──────────────────────────────────────────────────────────── */

/*
 * Garante que o .container do Bootstrap usado no nosso header/footer
 * não seja sobrescrito por algum .container do BeTheme.
 */
@media (min-width: 1200px) {
  .top_bar .container,
  .header .container,
  footer .container {
    max-width: 1130px;
  }
}

/* ─── GRID DE POSTS: OCULTAR OVERLAY DE HOVER (.image_links.double) ─────── */

/*
 * Remove o overlay nativo do BeTheme que aparece ao passar o mouse
 * sobre as imagens dos posts na grid (botões de zoom e permalink).
 */
.image_links.double {
  display: none !important;
}

/* ─── GRID DE POSTS: OCULTAR AUTOR E DATA ────────────────────────────────── */

/*
 * Remove autor e data de publicação da grid de posts na página principal do blog.
 * Os seletores cobrem os padrões do BeTheme para post meta (author, date, time).
 */
.post-meta.clearfix {
    display: none;
}

/* ─── TIPOGRAFIA NO CONTEÚDO DO BLOG ─────────────────────────────────────── */

/*
 * Reaplica a fonte padrão do site nas áreas de conteúdo do blog,
 * caso o BeTheme tenha sobrescrito com Roboto ou Patua One.
 */
#Content,
#Content p,
#Content h1,
#Content h2,
#Content h3,
#Content h4,
#Content h5,
#Content h6,
#Content a {
  font-family: proxima-nova, sans-serif;
}

/* ─── HEADER: TOP BAR ────────────────────────────────────────────────────── */

/*
 * O BeTheme tem estilos globais que afetam qualquer elemento
 * com classes genéricas. Reforçamos todos os valores do nosso
 * .top_bar para garantir consistência com o site principal.
 */
.top_bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: #f2f2f2 !important;
  border-bottom: 1px solid #ccc !important;
  height: auto !important;
  min-height: 0 !important;
}

.top_bar .container {
  display: flex !important;
  height: 43px !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Links da top bar (Essential Nutrition, Essentia Pharma...) */
.top_bar .links_top_bar {
  font-size: 14px !important;
  color: #707070 !important;
  display: flex !important;
  gap: 16px !important;
  float: none !important;
}

.top_bar .links_top_bar a {
  color: #707070 !important;
  text-decoration: none !important;
  line-height: normal !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  display: inline !important;
}

/* Seletor de idioma */
.top_bar .dropdown_language {
  margin: 0 0 0 auto !important;
}

.top_bar .dropdown_language ul {
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
  float: none !important;
  display: block !important;
}

.top_bar .dropdown_language .lang-toggle {
  width: 137px !important;
  height: 28px !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  color: #666 !important;
  padding: 0 6px !important;
  gap: 8px !important;
  display: flex !important;
  align-items: center !important;
  text-decoration: none !important;
  line-height: normal !important;
}

.top_bar .dropdown_language .lang-toggle span {
  display: block !important;
  line-height: 14px !important;
}

.top_bar .dropdown_language .lang-submenu {
  position: absolute !important;
  display: none !important;
  top: 100% !important;
  right: 0 !important;
  left: 0 !important;
  border: 1px solid #ccc !important;
  border-top: 0 !important;
  padding: 0 !important;
  margin: -1px 0 0 !important;
  list-style: none !important;
  z-index: 101 !important;
  background: #fff !important;
  border-radius: 0 0 4px 4px !important;
}

.top_bar .dropdown_language .lang-submenu a {
  font-size: 14px !important;
  color: #666 !important;
  padding: 4px 6px !important;
  gap: 8px !important;
  display: flex !important;
  align-items: center !important;
  text-decoration: none !important;
  line-height: normal !important;
  background: none !important;
  border: 0 !important;
}

/* Mobile: top bar */
@media (max-width: 767px) {
  .top_bar .container {
    justify-content: flex-end !important;
    height: 41px !important;
  }
  .top_bar .links_top_bar {
    display: none !important;
  }
}

/* ─── HEADER: BARRA PRINCIPAL ────────────────────────────────────────────── */

.header {
  position: fixed !important;
  top: 43px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 999 !important;
  background: #fff !important;
  border-bottom: 1px solid #ccc !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
}

.header .container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  height: 67px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Logo */
.header a.logo {
  margin-bottom: 3px !important;
  display: inline-block !important;
  height: auto !important;
  line-height: normal !important;
  padding: 0 !important;
  float: none !important;
}

.header a.logo img {
  display: block !important;
  max-height: none !important;
  vertical-align: middle !important;
}

/* ─── HEADER: MENU ───────────────────────────────────────────────────────── */

/*
 * O BeTheme define #Top_bar .menu > li { float: left; line-height: 60px }
 * e span com padding/border. Como usamos .header .menu (sem #Top_bar),
 * em geral não herda, mas os resets globais de ul/li afetam.
 * Garantimos nosso layout flex.
 */
.header .menu {
  display: flex !important;
  gap: 48px !important;
  font-size: 16px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
  background: none !important;
  border: 0 !important;
  flex-direction: row !important;
}

.header .menu > li {
  display: block !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}

.header .menu > li > a {
  display: block !important;
  color: #252424 !important;
  line-height: normal !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.header .menu > li > a:hover {
  text-decoration: none !important;
  text-shadow: 0.5px 0 0 currentColor !important;
}

.header .menu .active > a {
  font-weight: 700 !important;
}

/* Submenu */
.header .menu .has-submenu {
  position: relative !important;
}

.header .menu .submenu {
  display: none !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  padding: 8px 0 !important;
  min-width: 180px !important;
  z-index: 101 !important;
  list-style: none !important;
  margin: 0 !important;
  float: none !important;
  box-shadow: none !important;
  background-image: none !important;
}

.header .menu .has-submenu:hover .submenu {
  display: block !important;
}

.header .menu .submenu li {
  padding: 6px 16px !important;
  width: auto !important;
  float: none !important;
}

.header .menu .submenu li a {
  display: block !important;
  color: #252424 !important;
  font-size: 16px !important;
  line-height: normal !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  text-decoration: none !important;
}

.header .menu .submenu li a:hover {
  background: none !important;
  text-decoration: none !important;
  opacity: 0.8 !important;
}

/* Ícone seta do Contato */
.header .menu .icone-seta {
  margin-left: 4px !important;
  transition: transform 0.3s !important;
  vertical-align: middle !important;
}

.header .menu .has-submenu:hover .icone-seta {
  transform: rotate(180deg) !important;
}

/* ─── HEADER: CAMPO DE BUSCA ─────────────────────────────────────────────── */

.header .search_wrapper {
  position: static !important;
  float: none !important;
  display: block !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  padding: 0 !important;
  background: none !important;
}

.header #searchform {
  width: 248px !important;
  height: 38px !important;
  background: #f9f9f9 !important;
  border-radius: 19px !important;
  display: flex !important;
  align-items: center !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.header #searchform .field {
  background: transparent !important;
  border: 0 !important;
  padding-left: 16px !important;
  height: 38px !important;
  width: 206px !important;
  font-size: 14px !important;
  color: #707070 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.header .bt-search {
  background: transparent url(../img/icone-search.svg) center no-repeat !important;
  border: 0 !important;
  height: 38px !important;
  width: 20px !important;
  display: inline-block !important;
  padding: 0 !important;
  outline: none !important;
  cursor: pointer !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  font-size: 0 !important;
}

.button-stroke input.bt-search[type="submit"]:hover,
.button-stroke input.bt-search[type="submit"]:focus {
  background: transparent url(../img/icone-search.svg) center no-repeat !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  color: transparent !important;
  text-decoration: none !important;
  outline: none !important;
}

/* Neutraliza o ::after do BeTheme que cria o overlay escuro no hover */
.header .bt-search:after,
.header .bt-search:hover:after,
.header .menu-toggle:after,
.header .menu-toggle:hover:after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  background: none !important;
}

/* Ícones da busca (mfn-icons) que o BeTheme injeta */
.header #searchform .icon_search,
.header #searchform .icon_close {
  display: none !important;
}

/* ─── HEADER: MENU TOGGLE MOBILE ─────────────────────────────────────────── */

.header .menu-toggle {
  display: none !important;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  width: 24px !important;
  height: 18px !important;
  outline: none !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-width: 0 !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
  margin: 0 !important;
}

.header .menu-toggle span {
  display: block !important;
  width: 24px !important;
  height: 2px !important;
  background: #252424 !important;
  border-radius: 0 !important;
}

.header .menu-toggle:hover,
.header .menu-toggle:focus {
  background: none !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  outline: none !important;
  text-decoration: none !important;
}

.header .menu-toggle:hover span,
.header .menu-toggle:focus span {
  background: #252424 !important;
}

/* ─── HEADER: MOBILE (≤767px) ────────────────────────────────────────────── */

@media (max-width: 767px) {
  .header {
    top: 41px !important;
  }

  .header .container {
    position: relative !important;
    height: 62px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .top_bar .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .header .menu-toggle {
    display: flex !important;
  }

  .header a.logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  /* Menu mobile: oculto por padrão, abre via JS */
  .header .menu {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 63px !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff !important;
    border-bottom: 1px solid #ccc !important;
    padding: 20px !important;
    gap: 20px !important;
    z-index: 100 !important;
  }

  .header .menu.open {
    display: flex !important;
  }

  /* Busca desktop: reduz para só o ícone */
  .header .search_wrapper {
    position: static !important;
    margin-left: auto !important;
  }

  .header #searchform {
    width: 38px !important;
    background: transparent !important;
  }

  .header #searchform .field,
  .header #searchform .icon_close {
    display: none !important;
  }

  /* Busca mobile */
  .header .search_mobile {
    display: none !important;
    position: absolute !important;
    top: 63px !important;
    left: 0 !important;
    right: 0 !important;
    background: #f9f9f9 !important;
    border-bottom: 1px solid #ccc !important;
    padding: 12px 20px !important;
    z-index: 99 !important;
  }

  .header .search_mobile.open {
    display: flex !important;
  }

  .header .search_mobile form {
    width: 100% !important;
  }

  .header .search_mobile input {
    width: 100% !important;
    height: 40px !important;
    border: 1px solid #ccc !important;
    border-radius: 19px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    outline: none !important;
    background: #fff !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
}

/* ─── GRID DO FOOTER (substitui Bootstrap que não existe no WP) ──────────── */

/*
 * O BeTheme não carrega Bootstrap. As classes .row, .col-sm-* e .col-12
 * do footer não funcionam. Replicamos o comportamento do Bootstrap 4
 * escopado dentro do footer para não afetar o conteúdo do blog.
 */

footer .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

footer .col-12,
footer .col-sm-2,
footer .col-sm-3,
footer .col-sm-5,
footer .col-sm-9 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
}

@media (min-width: 576px) {
  footer .col-sm-2 {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
  }
  footer .col-sm-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
  footer .col-sm-5 {
    flex: 0 0 41.6667%;
    max-width: 41.6667%;
  }
  footer .col-sm-9 {
    flex: 0 0 75%;
    max-width: 75%;
  }
}

/* Alinhamento da segunda linha (logo + copyright) */
footer .row02 {
  align-items: flex-end;
}

@media (min-width: 576px) {
  footer .row02 .col-sm-3 {
    padding: 0;
    text-align: right;
  }
}

/* Mobile: ordem invertida na row02 igual ao site principal */
@media (max-width: 575px) {
  footer .row02 {
    flex-direction: column-reverse;
  }
  footer .copyright {
    margin-top: 33px;
    display: block;
  }
  footer .logo-group-footer {
    margin-top: 50px;
  }
  footer .column02 {
    margin: 60px 0;
  }
  footer .col-sm-2 {
    padding: 0 15px;
  }
}

/* ─── ADMIN BAR DO WORDPRESS ─────────────────────────────────────────────── */

/*
 * Quando o usuário está logado no WP, o WordPress adiciona a classe
 * .admin-bar no <body> e injeta uma barra preta de 32px no topo.
 * No mobile (≤782px) essa barra tem 46px.
 * Compensamos deslocando o .top_bar e .header para baixo.
 */
.admin-bar .top_bar {
  top: 32px !important;
}

.admin-bar .header {
  top: calc(43px + 32px) !important; /* 75px */
}

@media (max-width: 782px) {
  .admin-bar .top_bar {
    top: 46px !important;
  }
  .admin-bar .header {
    top: calc(41px + 46px) !important; /* 87px */
  }
}
