/* ============================================================
   LAYOUT.CSS — GRID, HEADER, FOOTER E SEÇÕES
   POLYMAX Brasil Indústria de Plásticos LTDA
   Sprint 1 — Estrutura Base
   ============================================================ */

/* --- CONTAINER CENTRAL --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  width: 100%;
}

/* --- HEADER / NAVEGAÇÃO --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* --- LOGO --- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-img {
  /* icon-polymax.png é 723×434 — proporção ~1.664:1 */
  height: 40px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo-text span {
  color: var(--green);
}

/* --- NAVEGAÇÃO PRINCIPAL --- */
.site-nav ul {
  display: flex;
  gap: 36px;
  align-items: center;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: 0.1px;
  padding: 4px 0;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transition: width var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--dark);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

/* Botão CTA do menu */
.nav-cta {
  background: var(--green) !important;
  color: var(--white) !important;
  padding: 10px 22px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

.nav-cta::after {
  display: none !important; /* sem underline no CTA */
}

.nav-cta:hover {
  background: var(--green-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(61, 190, 110, 0.30) !important;
}

/* Botão Intranet do menu */
.nav-intranet {
  background: transparent !important;
  color: var(--blue) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  border: 2px solid var(--blue) !important;
}

.nav-intranet::after {
  display: none !important;
}

.nav-intranet:hover,
.nav-intranet.active {
  background: var(--blue) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 82, 204, 0.20) !important;
}

/* --- BOTÃO HAMBURGER (mobile) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.hamburger:hover {
  background: var(--gray-100);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all 0.28s ease;
  transform-origin: center;
}

/* Estado ativo (X) */
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- SEÇÕES --- */
section {
  padding: var(--section-gap) 0;
}

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 72px; /* altura do header fixo */
  background: var(--white);
  position: relative;
  overflow: hidden;
}

/* Decoração de fundo do hero */
.hero-bg-decor {
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--light-green) 100%);
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content {
  max-width: 560px;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- FOOTER --- */
.site-footer {
  background: var(--dark);
  color: var(--gray-400);
}

.footer-main {
  padding: 64px 0 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 56px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .logo-text {
  color: var(--white);
  display: block;
  margin-bottom: 16px;
  font-size: 20px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 24px;
}

.footer-address {
  font-size: 14px;
  line-height: 1.75;
  font-style: normal;
}

.footer-address strong {
  color: var(--white);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col a {
  font-size: 14px;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--green);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.footer-bottom a {
  color: var(--gray-400);
  transition: color var(--transition);
}

.footer-bottom a:hover {
  color: var(--green);
}

/* --- ANIMAÇÃO DO MENU MOBILE (fora do @media para máxima compatibilidade) --- */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-bg-decor {
    clip-path: none;
    width: 100%;
    height: 40%;
    top: auto;
    bottom: 0;
    background: var(--gray-50);
  }

  .hero-visual {
    order: -1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 56px;
  }

  .hamburger {
    display: flex;
  }

  /* Menu mobile oculto — position:fixed evita conflito com backdrop-filter do header no iOS Safari */
  .site-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 9000;
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    padding: 20px 24px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    /* Garante que não herde nada do backdrop-filter do pai */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  /* Menu aberto */
  .site-nav.open {
    display: block;
    animation: slideDown 0.2s ease both;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-nav a {
    font-size: 15px;
    display: flex;
    align-items: center;
    /* Tap target mínimo de 48px (WCAG 2.5.5) */
    padding: 12px 0;
    width: 100%;
    min-height: 48px;
  }

  .nav-cta {
    display: inline-flex;
    margin-top: 8px;
    width: auto !important;
  }

  /* Botão Intranet no mobile */
  .nav-intranet {
    display: inline-flex;
    margin-top: 4px;
    width: auto !important;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 60px;
  }

  .hero-bg-decor {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
