/* ==============================================
   MEGA MENU STYLES - REFATORADO
   ============================================== */

/* Container principal do mega menu */
#megaMenu {
  /* Posicionamento absoluto fixo - SEMPRE em relação ao viewport */
  position: fixed !important;
  top: 59px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding-top: 10px; /* Pequeno espaço do topo */
  
  /* Visual */
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Z-index - ABAIXO do header (header tem z-50) */
  z-index: 30;
  
  /* Estado inicial (escondido acima) */
  transform: translate3d(0, -20px, 0);
  opacity: 0;
  
  /* Transição suave */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Performance */
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Estado visível - desliza para baixo */
#megaMenu.show {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Estado escondido */
#megaMenu.hidden {
  display: none;
  visibility: hidden;
}

/* Container de conteúdo */
#megaMenu .mega-menu-content {
  max-width: 1450px;
  margin: 0 auto;
  padding: 1rem 1rem;
}

@media (min-width: 1280px) {
  #megaMenu .mega-menu-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Hover states para categorias - destaque vertical */
#megaMenu .category-item {
  transition: all 0.15s ease;
}

#megaMenu .category-item:hover {
  background-color: rgb(243 232 255); /* purple-50 */
}

/* Card de destaque - visual premium */
#megaMenu .block.group.mb-4 {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#megaMenu .block.group.mb-4:hover {
  box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.1), 0 4px 6px -2px rgba(124, 58, 237, 0.05);
}

/* Otimização de performance para imagens */
#megaMenu img {
  will-change: transform;
}

.mega-editoria-card {
  min-width: 0;
}

.mega-editoria-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.mega-editoria-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: #f5f3ff;
  font-size: 0.8125rem;
}

.mega-editoria-card__name {
  min-width: 0;
  flex: 1;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.mega-editoria-card__count {
  flex-shrink: 0;
  color: #7c3aed;
  background: #f5f3ff;
  border-radius: 0.375rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
}

.mega-editoria-card__news {
  display: grid;
  gap: 0.75rem;
}

.mega-news-item {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  align-items: start;
  gap: 0.625rem;
  text-decoration: none;
}

.mega-news-item__thumb {
  position: relative;
  width: 5.75rem;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f3f4f6;
}

.mega-news-item__thumb::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 4px;
  height: 28px;
  background: #7c3aed;
  pointer-events: none;
}

.mega-news-item__thumb img,
.mega-news-item__placeholder {
  width: 100%;
  height: 100%;
}

.mega-news-item__thumb img {
  display: block;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.mega-news-item:hover .mega-news-item__thumb img {
  transform: scale(1.03);
}

.mega-news-item__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  background: #ede9fe;
}

.mega-news-item__title {
  color: #1f2937;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.mega-editoria-card__empty {
  display: block;
  padding: 0.75rem;
  border: 1px dashed #ddd6fe;
  border-radius: 0.5rem;
  color: #6d28d9;
  background: #faf5ff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.mega-quick-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  color: #374151;
  background: #f9fafb;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mega-quick-link i {
  color: #7c3aed;
  width: 1rem;
  text-align: center;
}

.mega-quick-link:hover {
  color: #6d28d9;
  background: #f5f3ff;
}

.mega-pdi-item {
  display: block;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
}

.mega-pdi-item__title {
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

/* Mobile: esconder mega menu (usa drawer) */
@media (max-width: 1023px) {
  #megaMenu {
    display: none !important;
  }
}

/* Transição suave para o ícone chevron */
#megaMenuBtn .fa-chevron-down {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

