/*
=====================================================================
  Engecampo - Ajustes de responsividade para mobile / tablet
  Carregado DEPOIS de style.css. Nada aqui afeta o desktop:
  todas as regras estao dentro de media queries max-width.
=====================================================================
*/


/* ==========================================================
   1. BASE - vale para tablet e celular (<= 991px)
   ========================================================== */
@media (max-width: 991px) {

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    -webkit-tap-highlight-color: rgba(161, 44, 47, 0.18);
  }

  /* O tema aplica overflow-x:hidden em html E body ate 991px. No body isso
     cria um container de rolagem intermediario e quebra o position:sticky
     do header, que passa a se referenciar ao body em vez da viewport - o
     header rolava embora em vez de grudar no topo. A protecao continua no
     html, que e o scroller real da pagina. */
  body {
    overflow-x: visible;
  }

  /* Nada de imagem estourando a largura da tela */
  img {
    max-width: 100%;
    height: auto;
  }

  /* E-mails, URLs e palavras longas quebram em vez de alargar o layout */
  p, li, span, h1, h2, h3, h4, h5, h6, a, td {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* background-attachment:fixed e quebrado/travado no iOS Safari.
     No mobile o fundo passa a rolar junto, sem jank. */
  section.upcoming-meetings,
  section.our-facts,
  section.our-courses,
  section.contact-us,
  section.meetings-page,
  section.page-interna,
  section.footer,
  section.heading-page {
    background-attachment: scroll !important;
  }

  /* Texto corrido um pouco maior e mais respirado para leitura no celular */
  p {
    font-size: 15px;
    line-height: 1.75;
  }


  /* ---------- 1.1 Cabecalho: sai do posicionamento absoluto ----------
     No desktop o header e position:absolute sobre o banner. No mobile
     ele e opaco, e o top:40px fixo nao acompanha a altura real da barra
     superior (que quebra em 2 linhas), fazendo o header cobrir a barra.
     Aqui ele entra no fluxo como sticky: encosta abaixo da barra, cola no
     topo ao rolar e nao gera salto de layout na troca de estado.        */
  header.header-area,
  header.header-area.header-sticky,
  header.header-area.background-header,
  header.header-area.header-sticky.background-header {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    height: 92px !important;
    min-height: 92px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background-color: #1f262c !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    z-index: 1100 !important;
  }

  .header-area .main-nav {
    min-height: 92px;
    /* precisa ser visible: o menu aberto transborda a altura do header */
    overflow: visible;
  }

  .header-area .main-nav .logo,
  .header-area .main-nav .logo img {
    line-height: 92px;
  }

  .header-area .main-nav .logo img {
    width: auto !important;
    max-width: 152px;
    max-height: 62px;
    vertical-align: middle;
  }

  /* Botao hamburger com area de toque de verdade */
  .header-area .main-nav .menu-trigger {
    width: 46px !important;
    height: 46px !important;
    top: 50% !important;
    right: 4px !important;
    transform: translateY(-50%);
    margin: 0 !important;
  }

  .header-area .main-nav .menu-trigger span,
  .header-area .main-nav .menu-trigger span:before,
  .header-area .main-nav .menu-trigger span:after {
    background-color: #fff;
    left: 11px;
    width: 24px;
  }

  .header-area .main-nav .menu-trigger span {
    top: 22px;
  }


  /* ---------- 1.2 Barra superior (Contato / Trabalhe conosco / Compliance) ----------
     Antes: inline-block com margin-left, alinhado a direita, quebrando
     em duas linhas desalinhadas e com area de toque de 20px.           */
  .sub-header {
    position: relative;
    z-index: 1101;
    padding: 2px 0;
  }

  .sub-header .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Zera a margem negativa do .row do Bootstrap, que somada ao padding
     reduzido do container estourava a largura em 2px */
  .sub-header .row {
    margin-left: 0;
    margin-right: 0;
  }

  .sub-header .row > div {
    padding-left: 0;
    padding-right: 0;
  }

  /* A coluna da esquerda esta vazia neste layout */
  .sub-header .col-lg-6:first-child {
    display: none;
  }

  .sub-header .right-icons {
    text-align: center;
    padding: 0;
  }

  .sub-header .right-icons ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 4px;
  }

  .sub-header .right-icons ul li {
    margin-left: 0;
    display: block;
  }

  .sub-header .right-icons ul li a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 7px;
    font-size: 12.5px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .sub-header .right-icons ul li a i {
    font-size: 13px;
    opacity: 0.85;
  }


  /* ---------- 1.3 Menu hamburger ate 991px ----------
     O tema so troca para hamburger em 767px. Entre 768 e 991 os 6
     rotulos do menu nao cabem em uma linha: quebravam em duas e
     vazavam para fora do fundo do header. Ate 991px usamos o menu
     vertical; de 992px para cima o menu horizontal cabe.              */
  .header-area .main-nav .menu-trigger {
    display: block !important;
  }

  .header-area .main-nav .nav {
    float: none;
    width: 100%;
    display: none;
    margin-left: 0;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.28);
  }

  .header-area .main-nav .nav li {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .header-area .main-nav .nav li:first-child {
    border-top: 1px solid #eee;
  }

  .header-area .main-nav .nav li a {
    height: 54px !important;
    line-height: 54px !important;
    font-size: 13px !important;
    font-weight: 600;
    padding: 0 20px !important;
    text-align: left !important;
    border: none !important;
    background: #f7f7f7 !important;
    color: #191a20 !important;
  }

  .header-area .main-nav .nav li a:hover,
  .header-area .main-nav .nav li a.active {
    background: #f0f0f0 !important;
    color: #a12c2f !important;
  }

  /* Alinha o inicio do menu com a base do header */
  .header-area .nav,
  .header-area.header-sticky .nav {
    margin-top: 92px !important;
  }

  .header-area .logo {
    margin-left: 0 !important;
  }


  /* ---------- 1.4 Banner do topo (home) ----------
     O texto do hero era absoluto (top:60% + translateY) dentro de uma
     section com overflow:hidden travada em 100vh. No celular o texto
     mede ~780px: o final do texto e o botao "Saiba mais" ficavam
     cortados. Aqui o conteudo volta ao fluxo e o video vira fundo.     */
  .main-banner {
    overflow: hidden;
    margin-bottom: 0;
  }

  .main-banner #bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    object-fit: cover;
  }

  .main-banner .video-overlay {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 52px 0 58px;
    background-color: rgba(0, 0, 0, 0.7);
  }

  .main-banner .caption {
    position: static;
    top: auto;
    transform: none;
  }

  .main-banner .caption h6 {
    font-size: 13px;
    letter-spacing: 0.5px;
  }

  .main-banner .caption h2 {
    font-size: 25px;
    line-height: 1.25;
    margin-top: 12px;
    margin-bottom: 16px;
    letter-spacing: 0;
  }

  .main-banner .caption p {
    max-width: none;
    font-size: 14.5px;
    line-height: 1.75;
  }

  .main-banner .caption .main-button-red {
    margin-top: 26px;
  }


  /* ---------- 1.5 Espacamentos das secoes ----------
     Os paddings do desktop (100-140px) e o padding-top:400px que a
     folha original aplicava em upcoming-meetings deixavam telas quase
     vazias no celular.                                                 */
  section.upcoming-meetings {
    padding-top: 52px !important;
    padding-bottom: 48px;
  }

  section.our-facts {
    padding-top: 52px;
    padding-bottom: 46px;
  }

  section.our-courses {
    padding-top: 52px;
    padding-bottom: 48px;
  }

  section.page-interna {
    padding-top: 46px;
    padding-bottom: 46px;
  }

  section.meetings-page {
    padding-top: 26px;
    padding-bottom: 10px;
  }

  /* O header agora esta no fluxo, entao esta section nao precisa mais
     reservar espaco para ele. */
  section.heading-page {
    padding-top: 52px !important;
    padding-bottom: 46px !important;
  }

  section.heading-page h6 {
    font-size: 13px;
  }

  section.heading-page h2 {
    font-size: 26px;
    line-height: 1.25;
    margin-top: 10px;
    margin-bottom: 0;
    letter-spacing: 0;
  }

  .section-heading h2 {
    font-size: 19px;
    line-height: 1.3;
    padding-bottom: 14px;
    margin-bottom: 22px;
  }

  section.upcoming-meetings .categories {
    padding: 24px;
    margin-right: 0;
    margin-bottom: 26px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  }

  .meeting-item {
    margin-bottom: 22px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  }

  .meeting-item .down-content {
    padding: 20px;
  }

  /* Link inline em volta da imagem gera uma caixa de 23px e um vao de
     ~4px abaixo da figura (espaco da linha de base) */
  .meeting-item .thumb a,
  .meeting-item .down-content a,
  .thumb > a {
    display: block;
  }


  /* ---------- 1.6 Botoes com area de toque adequada ---------- */
  .main-button-red a,
  .main-button-yellow a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
  }

  section.meetings-page .filters li {
    padding: 12px 22px;
    margin-bottom: 8px;
    display: inline-block;
  }


  /* ---------- 1.7 Formulario e pagina de contato ---------- */
  section.contact-us {
    padding-top: 42px;
  }

  /* 40px de padding em cada lado comiam 80px dos 375px da tela */
  section.contact-us #contact {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  section.contact-us #contact h2 {
    font-size: 18px;
    margin-bottom: 24px;
    padding-bottom: 14px;
  }

  /* font-size >= 16px evita o zoom automatico do Safari no iOS ao focar
     um campo. Altura 48px para o toque. */
  section.contact-us #contact input,
  section.contact-us #contact textarea {
    font-size: 16px;
    margin-bottom: 18px;
  }

  section.contact-us #contact input {
    height: 48px;
  }

  section.contact-us #contact textarea {
    min-height: 130px;
    max-height: none;
  }

  section.contact-us #contact button {
    width: 100%;
    min-height: 50px;
    font-size: 14px;
    padding: 12px 20px;
  }

  /* Aceite da politica: checkbox e texto na mesma linha, alinhados */
  section.contact-us #contact input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-height: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #a12c2f;
  }

  section.contact-us #contact .col-lg-1,
  section.contact-us #contact .col-lg-11 {
    width: auto;
  }

  section.contact-us #contact .col-lg-1 {
    flex: 0 0 auto;
    padding-right: 0;
  }

  section.contact-us #contact .col-lg-1 fieldset {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
  }

  section.contact-us #contact .col-lg-11 {
    flex: 1 1 0;
    font-size: 13px;
    line-height: 1.6;
  }

  section.contact-us .right-info {
    padding: 26px 22px;
  }

  section.contact-us .right-info ul li {
    display: block;
    margin-bottom: 22px;
    padding-bottom: 22px;
  }

  section.contact-us .right-info ul li span {
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
  }

  /* O mapa vinha com height=600 fixo no HTML */
  section.contact-us iframe {
    height: 300px !important;
  }

  section.contact-us .container-fluid h2 {
    font-size: 20px;
    padding-top: 34px !important;
  }


  /* ---------- 1.8 Rodape ----------
     As colunas usam .m-3 (16px) + width 100%, o que estourava a largura
     em 32px. O overflow-x:hidden do tema escondia o sintoma. */
  section.footer {
    padding: 30px 0 26px;
    text-align: center;
  }

  section.footer .row > div {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 18px !important;
  }

  section.footer .row > div:last-child {
    margin-bottom: 0 !important;
  }

  /* Divisoria vertical do desktop vira horizontal no mobile */
  section.footer .border-start {
    border-left: 0 !important;
    border-top: 1px solid #dc3545;
    padding: 20px 14px 0 !important;
  }

  section.footer img {
    width: auto !important;
    max-width: 180px;
    margin: 0 auto;
  }

  section.footer p {
    margin-bottom: 14px;
    line-height: 1.6;
  }

  section.footer p:last-child {
    margin-bottom: 0;
  }

  /* Os <br> duplos entre blocos do rodape viram espaco morto no mobile */
  section.footer p + br {
    display: none;
  }

  /* Telefone, canal de denuncia, e-mail do DPO e endereco sao alvos de
     toque reais: cada um fica com area vertical de ~40px */
  section.footer a {
    word-break: break-word;
    display: inline-block;
    padding: 9px 2px;
    line-height: 1.4;
  }


  /* ---------- 1.9 Modais (servicos da home) ---------- */
  .modal-dialog {
    margin: 10px !important;
  }

  .modal-content {
    max-height: calc(100vh - 20px);
  }

  .modal-header,
  .modal-footer {
    padding: 14px 16px;
  }

  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
  }

  .modal-title {
    font-size: 17px;
    line-height: 1.3;
  }

  .modal .btn-close {
    width: 44px;
    height: 44px;
    margin: -8px -8px -8px auto;
  }


  /* ---------- 1.10 Banner de cookies ---------- */
  .eupopup-container {
    padding: 14px !important;
  }

  .eupopup-body {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }

  .eupopup-button,
  .eupopup-closebutton {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    font-size: 13px !important;
  }

}


/* ==========================================================
   2. CELULAR (<= 767px)
   ========================================================== */
@media (max-width: 767px) {

  header.header-area,
  header.header-area.header-sticky,
  header.header-area.background-header,
  header.header-area.header-sticky.background-header {
    text-align: left !important;
  }

  .container,
  .container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }

  section.contact-us .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }

  /* Texto justificado no celular abre "rios" de espaco entre palavras */
  [style*="justify"],
  .categories,
  .categories li {
    text-align: left !important;
  }

  .main-banner .caption h2 {
    font-size: 23px;
  }

  section.heading-page h2 {
    font-size: 24px;
  }

}


/* ==========================================================
   3. TELAS ESTREITAS (<= 400px)
   ========================================================== */
@media (max-width: 400px) {

  .sub-header .right-icons ul li a {
    font-size: 11.5px;
    padding: 0 5px;
    gap: 5px;
  }

  .header-area .main-nav .logo img {
    max-width: 132px;
  }

  .main-banner .caption h2 {
    font-size: 21px;
  }

  section.heading-page h2 {
    font-size: 22px;
  }

  section.contact-us #contact {
    padding: 20px 16px;
  }

  section.contact-us .right-info {
    padding: 22px 18px;
  }

}


/* ==========================================================
   3b. TELAS MUITO ESTREITAS (<= 360px)
   Os icones da barra superior sao decorativos: sem eles os tres
   links cabem em uma linha unica em vez de duas.
   ========================================================== */
@media (max-width: 360px) {

  .sub-header .container {
    padding-left: 4px;
    padding-right: 4px;
  }

  .sub-header .right-icons ul li a i {
    display: none;
  }

  .sub-header .right-icons ul li a {
    font-size: 11px;
    padding: 0 4px;
    gap: 0;
  }

}


/* ==========================================================
   4. PAISAGEM EM CELULAR (altura baixa)
   ========================================================== */
@media (max-width: 991px) and (orientation: landscape) and (max-height: 500px) {

  .main-banner .video-overlay {
    padding: 34px 0 40px;
  }

  header.header-area,
  header.header-area.header-sticky,
  header.header-area.background-header {
    height: 72px !important;
    min-height: 72px !important;
  }

  .header-area .main-nav,
  .header-area .main-nav .logo,
  .header-area .main-nav .logo img {
    min-height: 72px;
    line-height: 72px;
  }

  .header-area.header-sticky .nav {
    margin-top: 72px !important;
  }

  .header-area .main-nav .nav li a {
    height: 44px !important;
    line-height: 44px !important;
  }

}
