/* ========================================
   SUNOPEN Mega Menu Styles
   ======================================== */

/* Mega Menu Container */
.mega-menu {
  position: relative;
}

.mega-menu-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #D3D3D3;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}

.mega-menu-trigger:hover,
.mega-menu-trigger.active {
  color: #FFF;
}

.mega-menu-trigger::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.2s;
}

.mega-menu-trigger:hover::after,
.mega-menu-trigger.active::after {
  width: 100%;
}

/* Arrow icon */
.mega-menu-trigger .arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.3s;
  margin-left: 2px;
}

.mega-menu:hover .mega-menu-trigger .arrow,
.mega-menu.active .mega-menu-trigger .arrow {
  transform: rotate(180deg);
}

/* Mega Menu Dropdown */

/* Mega Menu Dropdown - 深色毛玻璃风格 */
.mega-menu-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  transform: translateX(0) translateY(0px);
  min-width: 1000px;
  
  /* 修改背景为深色半透明 + 边框 */
  background: #1E3A5F; 
  backdrop-filter: blur(20px);
  border: 1px solid rgba(60, 100, 140, 0.3);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.15), 
    0 0 0 1px rgba(60, 100, 140, 0.2);
  padding: 1.5rem;
  border-radius: 16px; /* 更大的圆角 */
  
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); /* 更流畅的缓动 */
  z-index: 1001;
  display: flex;
  gap: 1.5rem; /* 减小列间距 */
}

/* 悬停显示效果 */
.mega-menu:hover .mega-menu-dropdown,
.mega-menu.active .mega-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(12px);
}

/* 内部内容卡片 - 用于承载具体菜单项 */
.mega-menu-column {
  flex: 1;
  width: 180px;
  background: rgba(255, 255, 255, 0.03); /* 每一列内部的微弱遮罩 */
  border-radius: 10px;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

/* 标题样式优化 */
.mega-menu-column h4 {
  font-size: 0.85rem;
  font-weight: 700;
  /* 修改标题颜色为青蓝色，替代原来的深色 */
  color: #4ADE80; 
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  /* 修改下划线为绿色渐变 */
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mega Menu Items - 链接列表 */
.mega-menu-items {
  list-style: none;
}

.mega-menu-items li {
  margin-bottom: 0.25rem;
}

.mega-menu-items a {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 增加图标与文字间距 */
  padding: 0.6rem 0.75rem;
  /* 修改文字颜色为浅灰色 */
  color: #F8FAFC; ; 
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  /* 移除原本的 transform位移，改用背景色变化 */
}

/* 链接悬停效果 */
.mega-menu-items a:hover {
  background: rgba(16, 185, 129, 0.2); /* 绿色半透明背景 */
  color: #FFFFFF; /* 悬停时文字变白 */
  /* 移除 transform: translateX，避免布局抖动 */
  padding-left: 1.25rem; /* 悬停时文字微微向右滑入，替代位移 */
}

/* 图标样式 */
.mega-menu-items a .item-icon {
  width: 32px;
  height: 32px;
  /* 修改图标背景为深色描边风格 */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

/* 悬停图标效果 */
.mega-menu-items a:hover .item-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

/* 文字容器 */
.mega-menu-items .item-text {
  flex: 1;
}

.mega-menu-items .item-title {
  font-weight: 500;
  /* 修改标题颜色 */
  color: #F3F4F6; 
  font-size: 0.875rem;
  line-height: 1.3;
}

.mega-menu-items .item-desc {
  font-size: 0.75rem;
  /* 修改描述颜色 */
  color: #9CA3AF; 
  margin-top: 2px;
}

/* 确保悬停时颜色正确 */
.mega-menu-items a:hover .item-title {
  color: #FFFFFF;
}

/* Featured Product in Mega Menu - 优化特色产品样式 */
.mega-menu-featured {
  /* 修改为深色强调卡片 */
  background: linear-gradient(135deg, #052E16, #064E3B); 
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  min-width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mega-menu-featured .featured-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.mega-menu-featured h5 {
  font-size: 0.95rem;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.mega-menu-featured p {
  font-size: 0.75rem;
  color: #D1D5DB;
  margin-bottom: 0.75rem;
}

.mega-menu-featured .featured-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mega-menu-featured .featured-link:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Arrow Indicator - 保持顶部样式不变 */
.mega-menu-trigger::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.2s;
}

.mega-menu-trigger:hover::after,
.mega-menu-trigger.active::after {
  width: 100%;
}


/* Mega Menu Animation */
@keyframes megaMenuFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile Mega Menu Styles */
@media (max-width: 968px) {
  .mega-menu {
    position: relative;
  }

  .mega-menu-trigger {
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .mega-menu-trigger .arrow {
    transition: transform 0.3s;
  }

  .mega-menu.active .mega-menu-trigger .arrow {
    transform: rotate(180deg);
  }

  .mega-menu-dropdown {
    position: static;
    transform: none;
    min-width: 100%;
    box-shadow: none;
    border-radius: 0;
    padding: 1rem;
    background: rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    gap: 1rem;
    opacity: 1;
    visibility: visible;
  }

  .mega-menu.active .mega-menu-dropdown {
    display: flex;
  }

  .mega-menu-column {
    min-width: 100%;
  }

  .mega-menu-column h4 {
    font-size: 0.9rem;
    color: #FFF;
    border-bottom-color: rgba(255,255,255,0.3);
    margin-bottom: 0.75rem;
  }

  .mega-menu-items a {
    color: #E5E7EB;
    padding: 0.5rem 0.75rem;
  }

  .mega-menu-items a:hover {
    background: rgba(255,255,255,0.1);
    color: #FFF;
  }

  .mega-menu-items a .item-icon {
    background: rgba(255,255,255,0.1);
  }

  .mega-menu-items a:hover .item-icon {
    background: var(--primary);
    color: #fff;
  }

  .mega-menu-items .item-title {
    color: #E5E7EB;
  }

  .mega-menu-items a:hover .item-title {
    color: #FFF;
  }

  .mega-menu-featured {
    display: none;
  }
}

/* Smooth hover transitions */
.mega-menu-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: #FFFFFF;
}

.mega-menu-dropdown::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 12px 12px 0 0;
}
