.infra-tech-new {
  position: relative;
  padding:0;
  background: var(--gray-50, #f9fafb);
  overflow: visible;
  z-index: 1;
}

.section-title h2 {
    color: var(--primary-dark);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-top: 10px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(45deg, var(--primary-light), var(--accent-orange));
    border-radius: 2px;
}

/* Background sutil com overlay */
.infra-tech-new::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../imagens/Jundiai/pilates-2.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.08;
  z-index: -1;
  pointer-events: none;
}

.infra-tech-new__overlay {
  display: none;
}

.infra-tech-new .container {
  position: relative;
  z-index: 2;
}

/* Grid de Tecnologias */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg, 24px);
  margin-top: var(--space-2xl, 48px);
  position: relative;
  z-index: 2;
  /* garantir comportamento vertical e evitar espaços laterais inesperados */
  grid-auto-rows: auto; /* cada linha cresce conforme o conteúdo da própria célula */
  grid-auto-flow: row;
  overflow-x: hidden; /* evita criação de scroll/space horizontal por overflow inesperado */
  align-items: start; /* garante que cada item comece no topo da célula */
}

/* Column-mode: quando o JS reagrupa em colunas, usamos flex nas colunas */
.tech-grid--columns {
  display: flex;
  gap: var(--space-lg, 24px);
}
.tech-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 24px);
  flex: 1 1 0%;
}

/* Card Individual - EMPURRA AO INVÉS DE SOBREPOR */
.tech-item {
  background: linear-gradient(135deg, var(--primary-medium, #2b77ad) 0%, var(--primary-light, #4da6d9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* evita que conteúdos internos forcem expansão horizontal */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.4s ease;
  box-shadow: 0 4px 12px rgba(43, 119, 173, 0.2);
  position: relative;
  z-index: 2;
}

.tech-item:hover {
  transform: translateY(-4px) translateX(0);
  box-shadow: 0 8px 24px rgba(43, 119, 173, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

.tech-item.active {
  box-shadow: 0 12px 32px rgba(43, 119, 173, 0.4);
  border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px);
  z-index: 20; /* trazer acima dos irmãos quando expandido */
  width: 100%;
  align-self: start;
}

/* Header do Card (clicável) */
.tech-item-header {
  padding: var(--space-lg, 24px);
  max-height: 160.8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm, 12px);
  position: relative;
  background: transparent;
  transition: background 0.3s ease;
  border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px);
}

.tech-item-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Ícone - BRANCO */
.tech-item-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.tech-item:hover .tech-item-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.tech-item-icon svg {
  width: 1.8rem;
  height: 1.8rem;
}

/* Título - BRANCO */
.tech-item-header h4 {
  color: white;
  font-size: var(--text-base, 1rem);
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

/* Seta do Accordion - BRANCA */
.tech-arrow {
  position: absolute;
  bottom: 12px;
  right: 12px;
  color: white;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  opacity: 0.8;
}

.tech-item:hover .tech-arrow {
  opacity: 1;
}

.tech-item.active .tech-arrow {
  transform: rotate(180deg);
}

/* Conteúdo Expansível - EMPURRA (continuação natural do card) */
.tech-item-content {
  /* conteúdo expansível em fluxo normal: aumenta altura do próprio card */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.2,0.9,0.2,1), padding 0.35s ease;
  background: linear-gradient(135deg, var(--primary-dark, #1a365d) 0%, var(--primary-medium, #2b77ad) 100%);
  border-radius: 0 0 var(--radius-xl, 16px) var(--radius-xl, 16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 0 var(--space-lg, 24px) 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tech-item.active .tech-item-content {
  max-height: 600px; /* ajustável conforme conteúdo */
  padding: 0 var(--space-lg, 24px) var(--space-lg, 24px);
}

/* Container da Imagem */
.tech-image-container {
  margin-top: 10px;
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  margin-bottom: var(--space-md, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* garantir que conteúdos internos não ultrapassem a largura do card */
.tech-image-container,
.tech-image-container img,
.tech-lazy-image,
.tech-item-header,
.tech-item-content * {
  max-width: 100%;
  box-sizing: border-box;
}

.tech-image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(77, 166, 217, 0.15) 0%, rgba(43, 119, 173, 0.15) 100%);
  z-index: 1;
}

/* Imagem Lazy Load */
.tech-lazy-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  z-index: 2;
}

.tech-lazy-image.loaded {
  opacity: 1;
}

/* Placeholder enquanto carrega - BRANCO */
.tech-image-container:not(:has(.loaded))::after {
  content: '⏳';
  position: absolute;
  font-size: 2rem;
  color: white;
  z-index: 2;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Descrição - BRANCA */
.tech-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

/* ================================
   RESPONSIVIDADE
   ================================ */

/* Tablet */
@media (max-width: 1024px) {
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md, 20px);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .infra-tech-new {
    padding: var(--space-2xl, 56px) 0;
  }

  /* For mobile we use a single-column layout with larger cards */
  .tech-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg, 20px);
  }

  /* If JS reflowed into column-mode, force columns to stack full-width on mobile */
  .tech-grid--columns {
    display: block;
  }
  .tech-col {
    width: 100%;
    display: block;
    gap: var(--space-md, 16px);
    margin-bottom: var(--space-md, 16px);
  }


  .tech-item-header {
    padding: calc(var(--space-md, 16px) + 4px);
    max-height: 140px;
  }

  .tech-item-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }

  .tech-item-icon svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  .tech-item-header h4 {
    font-size: var(--text-sm, 0.875rem);
  }

  /* larger visual for mobile single-column cards */
  .tech-image-container {
    height: 220px;
  }

  .tech-item.active .tech-item-content {
    padding: 0 var(--space-md, 16px) var(--space-md, 16px);
  }

  .tech-description {
    font-size: 0.95rem;
  }

  .tech-arrow {
    font-size: 0.8rem;
    bottom: 8px;
    right: 8px;
  }
}

/* Mobile Pequeno */
@media (max-width: 480px) {
  .tech-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md, 14px);
  }

  .tech-grid--columns { display: block; }
  .tech-col { width: 100%; display: block; }

  .tech-item-header { padding: var(--space-sm, 12px); max-height: 120px; }

  .tech-item-icon { width: 56px; height: 56px; font-size: 1.6rem; }

  .tech-item-header h4 { font-size: 0.95rem; }

  .tech-image-container { height: 180px; }
}