/*
 * ═══════════════════════════════════════════════════════════
 *  MEGAHPROJ — HOME STYLES
 *  Bloco 2.2 — Barra de Diferenciais e seções da Home
 * ═══════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────
   BARRA DE DIFERENCIAIS (BLOCO 2.2)
   Cor de Fundo: --megah-yellow (#FDE100)
   Texto: --megah-black (#111111)
───────────────────────────────────────────── */
.differentials-bar {
  background-color: var(--megah-yellow);
  color: var(--megah-black);
  padding: 48px 0;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.differentials-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  align-items: flex-start;
}

.diff-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-md);
  transition: transform var(--ease), background-color var(--ease);
}

/* Efeito de hover no item */
.diff-item:hover {
  transform: translateY(-4px);
  background-color: rgba(255, 255, 255, 0.25);
}

/* Ícone */
.diff-icon-wrap {
  width: 60px;
  height: 60px;
  background-color: var(--megah-white);
  color: var(--megah-burgundy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), color var(--ease), background-color var(--ease);
}

/* Hover no ícone */
.diff-item:hover .diff-icon-wrap {
  transform: scale(1.08) rotate(5deg);
  background-color: var(--megah-burgundy);
  color: var(--megah-white);
}

/* Título do diferencial */
.diff-title {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--megah-black);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Descrição do diferencial */
.diff-desc {
  font-size: 0.85rem;
  font-weight: 400;
  color: #222222; /* Contraste forte no fundo amarelo */
  margin: 0;
  line-height: 1.5;
}

/* Divisores discretos entre itens (apenas desktop) */
@media (min-width: 993px) {
  .diff-item:not(:last-child) {
    position: relative;
  }
  .diff-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: rgba(17, 17, 17, 0.15);
  }
}

/* Responsividade */
@media (max-width: 992px) {
  .differentials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .differentials-bar {
    padding: 40px 0;
  }
}

@media (max-width: 576px) {
  .differentials-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .differentials-bar {
    padding: 32px 0;
  }
  .diff-item {
    padding: 12px 8px;
  }
  .diff-icon-wrap {
    margin-bottom: 12px;
  }
}

/* ─────────────────────────────────────────────
   SOBRE NÓS RESUMIDO (BLOCO 2.3)
   Cor de Fundo: Preto/Cinza Escuro (#111111)
   Texto: Branco (#FFFFFF)
───────────────────────────────────────────── */
.home-about {
  background-color: #111111;
  color: var(--megah-white);
  min-height: 500px;
  display: flex;
  align-items: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.home-about-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start; /* Alinha os blocos juntos à direita */
  gap: 0; /* Espaço é controlado via padding nos elementos */
  width: 100%;
}

/* Watermark */
.home-about-watermark {
  flex: 0 0 20%;
  max-width: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: auto; /* Empurra o header e o body para a direita, separando a marca d'água */
}

.home-about-watermark-img {
  width: 100%;
  max-width: 160px;
  height: auto;
  opacity: 0.25;
}

/* Título */
.home-about-header {
  flex: 0 0 30%;
  max-width: 30%;
  border-right: 3px solid var(--megah-burgundy); /* Barra vertical na borda da div do título */
  padding-right: 45px; /* Espaço de 45px entre o título e a barra */
}

.home-about-title {
  font-family: var(--font-primary);
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--megah-white);
  text-align: right !important; /* Força o alinhamento à direita das linhas internas */
  margin: 0;
}

/* Corpo de texto */
.home-about-body {
  flex: 0 0 45%;
  max-width: 45%;
  padding-left: 45px; /* Espaço de 45px entre a barra e o parágrafo (simétrico!) */
}

.home-about-body p {
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.65;
  color: #dddddd;
  text-align: justify;
  margin: 0;
}

/* Responsividade */
@media (max-width: 992px) {
  .home-about {
    padding: 60px 0;
  }
  .home-about-container {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .home-about-watermark {
    flex: 0 0 auto;
    max-width: 120px;
    margin-right: 0;
  }
  .home-about-header {
    flex: 0 0 auto;
    max-width: 100%;
    border-right: none;
    padding-right: 0;
    border-bottom: 3px solid var(--megah-burgundy);
    padding-bottom: 16px;
  }
  .home-about-title {
    text-align: center !important;
    display: inline-block;
  }
  .home-about-body {
    flex: 0 0 auto;
    max-width: 100%;
    padding-left: 0;
  }
  .home-about-body p {
    text-align: center;
  }
}

/* ─────────────────────────────────────────────
   NOSSOS SEGMENTOS (BLOCO 2.4)
───────────────────────────────────────────── */
.home-segments {
  background-color: var(--bg-light);
  position: relative;
  z-index: 5;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 56px;
}

.segments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.segment-card {
  background-color: var(--megah-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Linha inferior de cor como detalhe do card */
.segment-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--megah-yellow);
  transition: background-color var(--ease);
  z-index: 3;
}

/* Hover no card */
.segment-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.segment-card:hover::after {
  background-color: var(--megah-burgundy);
}

/* Imagem do card */
.segment-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.segment-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.segment-card:hover .segment-card-image img {
  transform: scale(1.06);
}

/* Overlay sutil para escurecer imagens claras */
.segment-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

/* Conteúdo de texto do card */
.segment-card-content {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.segment-card-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--megah-black);
  margin-bottom: 14px;
  line-height: 1.2;
}

.segment-card-desc {
  font-weight: 400; /* Regular — Brand Manual */
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

/* Link / Call-to-action no card */
.segment-card-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--megah-burgundy);
  transition: color var(--ease), gap var(--ease);
}

.segment-card-link i {
  font-size: 0.8rem;
  transition: transform var(--ease);
}

.segment-card:hover .segment-card-link {
  color: var(--megah-black);
}

.segment-card:hover .segment-card-link i {
  transform: translateX(4px);
}

/* Responsividade */
@media (max-width: 992px) {
  .segments-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .segments-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .segment-card-image {
    height: 200px;
  }
  .segment-card-content {
    padding: 24px 20px;
  }
}

/* ─────────────────────────────────────────────
   PROJETOS EM DESTAQUE (BLOCO 2.5)
   Cor de Fundo: #f8f9fa
───────────────────────────────────────────── */
.home-projects {
  background-color: #f8f9fa;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.projects-carousel-wrapper {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 40px;
}

.projects-carousel-track-container {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-md);
}

.projects-carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.project-slide {
  flex: 0 0 100%;
  width: 100%;
  padding: 4px; /* Evita clipping de shadow */
  box-sizing: border-box;
}

/* Card Estilo Split */
.project-card {
  display: flex;
  flex-direction: row;
  background-color: var(--megah-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Imagem e Badge */
.project-card-image {
  flex: 0 0 50%;
  max-width: 50%;
  position: relative;
  height: 420px;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover .project-card-image img {
  transform: scale(1.04);
}

.project-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(17,17,17,0.2) 0%, rgba(17,17,17,0.5) 100%);
  pointer-events: none;
}

.project-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  background-color: var(--megah-yellow);
  color: var(--megah-black);
  padding: 6px 16px;
  border-radius: 20px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  z-index: 5;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--ease), color var(--ease);
}

.project-card:hover .project-badge {
  background-color: var(--megah-burgundy);
  color: var(--megah-white);
}

/* Conteúdo */
.project-card-content {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background-color: var(--megah-white);
}

.project-card-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--megah-black);
  margin-bottom: 16px;
  line-height: 1.25;
}

.project-card-desc {
  font-family: var(--font-primary);
  font-weight: 400; /* Regular — Brand Manual */
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 32px;
  text-align: justify;
}

.project-card .btn-outline {
  align-self: flex-start;
  padding: 12px 28px;
  border: 2px solid var(--megah-gray-dark);
  color: var(--megah-gray-dark);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  transition: all var(--ease);
  text-decoration: none;
}

.project-card .btn-outline:hover {
  background-color: var(--megah-burgundy);
  border-color: var(--megah-burgundy);
  color: var(--megah-white);
}

/* Setas de Navegação */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background-color: var(--megah-white);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--megah-gray-dark);
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.carousel-arrow:hover {
  background-color: var(--megah-burgundy);
  color: var(--megah-white);
  border-color: var(--megah-burgundy);
  box-shadow: var(--shadow-md);
}

.carousel-arrow.prev {
  left: -16px;
}

.carousel-arrow.next {
  right: -16px;
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

/* Indicadores (Dots) */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}

.carousel-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(91, 103, 112, 0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.carousel-bullet.active {
  background-color: var(--megah-burgundy);
  width: 24px;
  border-radius: 5px;
}

/* Responsividade */
@media (max-width: 992px) {
  .projects-carousel-wrapper {
    padding: 0 20px;
  }
  
  .project-card {
    flex-direction: column;
  }
  
  .project-card-image {
    flex: 0 0 auto;
    max-width: 100%;
    height: 280px;
  }
  
  .project-card-content {
    padding: 32px 24px;
  }
  
  .carousel-arrow {
    width: 48px;
    height: 48px;
    font-size: 0.95rem;
  }
  
  .carousel-arrow.prev {
    left: 4px;
  }

  .carousel-arrow.next {
    right: 4px;
  }
}

@media (max-width: 576px) {
  .home-projects {
    padding: 60px 0;
  }
  
  .project-card-image {
    height: 200px;
  }
  
  .project-card-content {
    padding: 24px 16px;
  }
  
  .project-card-title {
    font-size: 1.35rem;
  }
  
  .carousel-arrow {
    display: none; /* Em mobile puro, ocultamos as setas e usamos swipe + dots */
  }
}

/* ─────────────────────────────────────────────
   POR QUE A MEGAHPROJ? (BLOCO 2.6)
   Cor de Fundo: Branco (#FFFFFF)
   Texto: Montserrat
───────────────────────────────────────────── */
.home-why {
  background-color: var(--megah-white);
  padding: 80px 0;
  position: relative;
  z-index: 5;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.why-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  background-color: var(--megah-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
              border-color 0.4s ease;
}

/* Linha amarela que aparece no hover */
.why-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

/* Hover no card */
.why-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(153, 0, 0, 0.25);
}

.why-item:hover::after {
  background-color: var(--megah-yellow);
}

/* Wrapper do Ícone */
.why-icon-wrap {
  font-size: 2.25rem;
  color: var(--megah-gray-dark);
  margin-bottom: 20px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), color 0.4s ease;
}

.why-item:hover .why-icon-wrap {
  transform: scale(1.1) rotate(5deg);
  color: var(--megah-burgundy);
}

/* Número Estatístico */
.why-number {
  font-family: var(--font-primary);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--megah-burgundy);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

/* Título do Card */
.why-title {
  font-family: var(--font-primary);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--megah-black);
  margin-bottom: 10px;
  line-height: 1.3;
}

/* Descrição do Card */
.why-desc {
  font-family: var(--font-primary);
  font-weight: 400; /* Regular — Brand Manual */
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Responsividade */
@media (max-width: 1100px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .home-why {
    padding: 60px 0;
  }
  .why-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .why-item {
    padding: 28px 16px;
  }
  .why-number {
    font-size: 2.25rem;
  }
}

/* ─────────────────────────────────────────────
   CTA BANNER (BLOCO 2.7)
   Imagem de fundo industrial com overlay escuro
───────────────────────────────────────────── */
.home-cta {
  position: relative;
  background-image: url('../assets/images/cta-banner.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll; /* Scroll standard, compatibilidade mobile */
  padding: 100px 0;
  color: var(--megah-white);
  overflow: hidden;
}

@media (min-width: 993px) {
  .home-cta {
    background-attachment: fixed; /* Parallax suave para desktop */
  }
}

.home-cta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 17, 17, 0.65); /* Overlay escuro de acordo com o Brand Manual */
  z-index: 1;
}

.home-cta-container {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.home-cta-title {
  font-family: var(--font-primary);
  font-weight: 900;
  font-size: clamp(1.8rem, 2.75vw, 2.6rem);
  color: var(--megah-white);
  margin-bottom: 16px;
  line-height: 1.25;
}

.home-cta-subtitle {
  font-family: var(--font-primary);
  font-weight: 400; /* Regular — Brand Manual: texto de leitura */
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: #dddddd;
  margin-bottom: 36px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.home-cta .btn-secondary {
  box-shadow: var(--shadow-sm);
}

.home-cta .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────────
   CLIENTES (BLOCO 2.8)
   Fundo: Branco (--megah-white)
───────────────────────────────────────────── */
.home-clients {
  background-color: var(--megah-white);
  padding: 80px 0;
  position: relative;
  z-index: 5;
}

.clients-carousel-wrapper {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 50px;
}

.clients-carousel-track-container {
  overflow: hidden;
  width: 100%;
}

.clients-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  align-items: center;
}

.clients-carousel-item {
  flex: 0 0 33.333%; /* 3 por slide em desktop, conforme imagem */
  width: 33.333%;
  box-sizing: border-box;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
}

.clients-carousel-item img {
  max-width: 100%;
  max-height: 55px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.65;
  transition: filter 0.4s ease, opacity 0.4s ease, transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.clients-carousel-item:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.08);
}

/* Responsividade */
@media (max-width: 768px) {
  .home-clients {
    padding: 60px 0;
  }
  .clients-carousel-wrapper {
    padding: 0 20px;
  }
  .clients-carousel-item {
    flex: 0 0 50%; /* 2 por slide em mobile */
    width: 50%;
    padding: 0 12px;
  }
  .clients-carousel-item img {
    max-height: 45px;
  }
}

@media (max-width: 480px) {
  .clients-carousel-item {
    flex: 0 0 100%; /* 1 por slide em mobile pequeno */
    width: 100%;
  }
}


