/* BLINDA O CONTAINER E FORÇA AS 4 COLUNAS EXATAS */
div#categories div.content div.categories {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  width: 100% !important;
}

/* TORNA CADA CARD UM QUADRADO PERFEITO COM FUNDO ESCURO E BORDA */
div#categories div.content div.categories div.category {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  aspect-ratio: 1 / 1 !important; /* Mantém o bloco estritamente quadrado */
  width: 100% !important;
  background: #121212 !important;
  border: 1px solid rgba(217, 119, 6, 0.2) !important;
}

/* AJUSTA O LINK INTERNO PARA CENTRALIZAR O ÍCONE */
div#categories div.content div.categories div.category a {
  text-decoration: none !important;
  height: 100% !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 15px !important;
}

/* ENQUADRA A IMAGEM INTEIRA DENTRO DO QUADRO SEM CORTAR */
div#categories div.content div.categories div.category img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: transform 0.5s ease !important;
}

div#categories div.content div.categories div.category:hover img {
  transform: scale(1.08) !important;
}

/* POSICIONA O TEXTO NA PARTE INFERIOR DO CARD */
div#categories div.content div.categories div.category .text {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: var(--categories-overlay, rgba(0,0,0,0.6)) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 15px !important;
  transition: all 0.3s ease !important;
}

div#categories div.content div.categories div.category .text span {
  color: var(--categories-text, #fff) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  text-align: center !important;
  display: -webkit-box !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

div#categories div.content div.categories div.category:hover .text {
  background: var(--categories-item-bg-hover, rgba(0,0,0,0.8)) !important;
}

/* RESPONSIVO PARA TABLETS E CELULARES */
@media (max-width: 1024px) {
  div#categories div.content div.categories {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  div#categories div.content div.categories {
    grid-template-columns: repeat(1, 1fr) !important;
  }
}