/*
 * Refatoração:
 * - Estilos de menu para desktop.
 * - Menu hamburguer responsivo para mobile, com efeito de slide.
 * - Estilos de rodapé.
 */

/* --- CSS Reset para evitar problemas de layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* --- Variáveis de Estilo --- */
:root {
  --primary-color: #2e8b57;
  --text-color: #4f5b61;
  --background-color: #f5f5f5;
  --header-bg-color: #e0e6e4;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --footer-bg-color: #0d463d;
  --footer-font: Arial, sans-serif;
}

/* --- Estilos Base --- */
body {
  font-family: 'Arial', sans-serif;
  background-color: var(--background-color);
  margin: 0;
}

/* --- Cabeçalho Principal --- */
.main-header {
  background-color: var(--header-bg-color);
  box-shadow: 0 2px 4px var(--shadow-color);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
}

.logo-link img {
  height: 40px;
  display: block;
}

/* --- Navegação Desktop --- */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 10px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 11px;
  letter-spacing: 1px;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  padding-bottom: 5px;
}

.nav-menu a:hover {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

/* --- Estilos do Rodapé --- */
.main-footer {
  background-color: var(--footer-bg-color);
  color: white;
  padding: 40px 20px 20px;
  font-family: var(--footer-font);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  flex-wrap: wrap;
}

.footer-logo {
  min-width: 180px;
  text-align: center;
  padding-top: 5px;
}

.logo-footer {
  width: 180px;
  height: auto;
}

.footer-info {
  min-width: 300px;
  font-size: 12px;
  line-height: 1.5;
}

.info-title {
  font-size: 12px;
  margin-bottom: 10px;
  font-weight: normal;
}

.info-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.info-group i {
  color: white;
  font-size: 12px;
}

/* Estilos para a linha de copyright */
.footer-copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 30px;
  font-size: 12px;
}

/* --- Estilos para Mobile (<= 768px) --- */
@media (max-width: 768px) {
  /* Layout do cabeçalho em telas menores */
  .header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "left center right";
    padding: 15px 20px;
    justify-content: unset;
  }

  /* Posicionamento dos elementos no layout de grid */
  .logo-link {
    grid-area: center;
    justify-self: center;
  }
  
  .logo-link img {
    height: 60px;
  }

  /* Posiciona o botão do menu no lado direito e centraliza as barras */
  .menu-toggle {
    grid-area: right;
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    z-index: 1001;
    gap: 6px;
  }

  /* --- Estilos do Ícone de Menu Hamburguer --- */
  .hamburguer-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease;
    margin: 0 auto;
  }

  .hamburguer-icon::before,
  .hamburguer-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, top 0.3s ease;
  }

  .hamburguer-icon::before {
    top: -8px;
  }

  .hamburguer-icon::after {
    top: 8px;
  }

  /* Animação do ícone para o "X" quando o menu está ativo */
  .menu-toggle[aria-expanded="true"] .hamburguer-icon {
    background-color: transparent;
  }

  .menu-toggle[aria-expanded="true"] .hamburguer-icon::before {
    transform: rotate(45deg);
    top: 0;
  }

  .menu-toggle[aria-expanded="true"] .hamburguer-icon::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* --- Estilos do Menu de Navegação (Deslizante) --- */
  .nav-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: var(--header-bg-color);
    box-shadow: 2px 0 5px var(--shadow-color);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  .nav-menu-container.active {
    transform: translateX(0);
  }

  /* --- Estilos do Overlay para o Menu Mobile --- */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: background-color 0.3s ease;
  }

  .menu-overlay.active {
    display: block;
  }

  /* Estilos do logo no menu deslizante */
  .mobile-menu-header {
    text-align: center;
    padding: 20px 0;
  }

  .logo-mobile-link {
    display: inline-block;
  }
  
  .logo-mobile {
    height: 80px;
  }

  /* Estilos da lista de links no menu mobile */
  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px;
    gap: 15px;
  }

  /* --- Estilos do Rodapé Mobile --- */
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    padding: 0 50px;
  }
  
  .footer-logo {
    margin-bottom: 0px;
    padding-top: 0;
    text-align: center; /* Centraliza apenas o logo */
    width: 100%; /* Permite que o texto-align funcione */
  }

  .footer-info {
    text-align: left;
    min-width: auto;
  }

  .info-group {
    justify-content: flex-start;
  }

  .footer-copyright {
    margin-top: 20px;
    text-align: left;
  }
}

/* --- Estilos para Desktop (> 768px) --- */
@media (min-width: 769px) {
  /* Oculta o botão do menu hamburguer */
  .menu-toggle {
    display: none;
  }

  /* Oculta o logo do menu mobile no desktop */
  .mobile-menu-header {
    display: none;
  }

  /* Garante que o menu desktop seja visível */
  .nav-menu-container {
    display: block !important;
  }
}