/* ============================================================
   Nav Mega Menu Plugin - Substrates & Wafers 分组样式
   Author: Yangze
   ============================================================ */

/* 隐藏原始 sub-menu，显示 mega menu */
#menu-item-17186 > .sub-menu {
    display: none !important;
}

/* mega menu 容器 */
.nmm-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 2px solid #0073aa;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 900px;
    padding: 20px 0;
}

/* 当父级 hover 或 focus-within 时展开 */
#menu-item-17186:hover > .nmm-mega-menu,
#menu-item-17186:focus-within > .nmm-mega-menu,
#menu-item-17186.menu-item--open > .nmm-mega-menu {
    display: block;
}

/* 内部横向布局 */
.nmm-mega-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    padding: 0 16px;
}

/* 每个字母分组 */
.nmm-group {
    flex: 1;
    min-width: 160px;
    padding: 0 16px;
    border-right: 1px solid #f0f0f0;
}

.nmm-group:last-child {
    border-right: none;
}

/* 分组标题 A-E / F-J ... */
.nmm-group-title {
    font-size: 13px;
    font-weight: 700;
    color: #0073aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* 分组列表 */
.nmm-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nmm-group-list li {
    margin: 0;
    padding: 0;
}

.nmm-group-list li a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.nmm-group-list li a:hover {
    color: #0073aa;
    text-decoration: underline;
}

/* 确保父级菜单项 position: relative */
#menu-item-17186 {
    position: relative;
}

/* 移动端：折叠为单列 */
@media (max-width: 768px) {
    .nmm-mega-menu {
        position: static;
        min-width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e0e0e0;
        padding: 10px 0;
    }

    .nmm-mega-inner {
        flex-direction: column;
        gap: 16px;
        padding: 0 12px;
    }

    .nmm-group {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 12px;
    }

    .nmm-group:last-child {
        border-bottom: none;
    }

    .nmm-group-list li a {
        white-space: normal;
    }
}
